Re: Missing query plan for auto_explain.

2022-09-01 Thread Julien Rouhaud
Hi, On Thu, Sep 01, 2022 at 08:20:13PM +0100, Matheus Martin wrote: > We tried running the prepared statement six times as suggested but wasn't > still able to recreate the original problem. > > Perhaps more concerning/relevant is that we have not found any explanation > to why the explain plan

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Adrian Klaver
On 9/1/22 6:31 PM, Jeffrey Walton wrote: On Thu, Sep 1, 2022 at 8:51 PM Tom Lane wrote: "Peter J. Holzer" writes: However, the symlink doesn't seem to be the culprit. If I run % sudo -u postgres -H /usr/lib/postgresql/13/bin/psql (which is not a symlink) I get the same behaviour. So it

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Ken Tanzer
On Thu, Sep 1, 2022 at 4:09 PM Peter wrote: > > ! It produces failures: > ! > ! could not change directory to "/home/jwalton/godojo": Permission > denied > > ... this appears to me as rather a sudo issue. Because certainly > psql cannot execute /as user postgres/ in a directory where user >

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Jeffrey Walton
On Thu, Sep 1, 2022 at 8:51 PM Tom Lane wrote: > > "Peter J. Holzer" writes: > > However, the symlink doesn't seem to be the culprit. If I run > > % sudo -u postgres -H /usr/lib/postgresql/13/bin/psql > > (which is not a symlink) > > I get the same behaviour. So it seems that psql changes to its

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Tom Lane
"Peter J. Holzer" writes: > However, the symlink doesn't seem to be the culprit. If I run > % sudo -u postgres -H /usr/lib/postgresql/13/bin/psql > (which is not a symlink) > I get the same behaviour. So it seems that psql changes to its basedir > and then can't change back again. Ah --- looking

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Jeffrey Walton
On Thu, Sep 1, 2022 at 8:23 PM Peter J. Holzer wrote: > > On 2022-09-01 18:16:14 -0400, Tom Lane wrote: > > Jeffrey Walton writes: > > > We are having a heck of a time getting PostreSQL utilities to honor > > > home directories. For example, when I execute this script: > > > > > sudo -H -u

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Peter J. Holzer
On 2022-09-01 18:16:14 -0400, Tom Lane wrote: > Jeffrey Walton writes: > > We are having a heck of a time getting PostreSQL utilities to honor > > home directories. For example, when I execute this script: > > > sudo -H -u postgres PGPASSWORD=${password} \ > > psql -h "${hostname}"

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Peter
Well, like others mentioned before, it is not getting fully clear what You are trying to achieve. But, in any case, if this is Your problem On Thu, Sep 01, 2022 at 06:01:02PM -0400, Jeffrey Walton wrote: ! Hi Everyone, ! ! We are having a heck of a time getting PostreSQL utilities to

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Adrian Klaver
On 9/1/22 3:01 PM, Jeffrey Walton wrote: Hi Everyone, We are having a heck of a time getting PostreSQL utilities to honor home directories. For example, when I execute this script: sudo -H -u postgres PGPASSWORD=${password} \ psql -h "${hostname}" -U "${username}" -d

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Tom Lane
Jeffrey Walton writes: > We are having a heck of a time getting PostreSQL utilities to honor > home directories. For example, when I execute this script: > sudo -H -u postgres PGPASSWORD=${password} \ > psql -h "${hostname}" -U "${username}" -d "${database}" \ >

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Adrian Klaver
On 9/1/22 3:01 PM, Jeffrey Walton wrote: Hi Everyone, We are having a heck of a time getting PostreSQL utilities to honor home directories. For example, when I execute this script: sudo -H -u postgres PGPASSWORD=${password} \ psql -h "${hostname}" -U "${username}" -d

How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Jeffrey Walton
Hi Everyone, We are having a heck of a time getting PostreSQL utilities to honor home directories. For example, when I execute this script: sudo -H -u postgres PGPASSWORD=${password} \ psql -h "${hostname}" -U "${username}" -d "${database}" \ --command="..." It produces

Re: Bind Parameter is Too Big

2022-09-01 Thread Tom Lane
"Kluzak, Matthew C." writes: > The Sybase databases use > Character Set = 1, iso_1 > ISO 8859-1 (Latin-1) - Western European 8-bit character set. > Sort Order = 50, bin_iso_1 > Binary ordering, for the ISO 8859/1 or Latin-1 character set ( > iso_1). > The Postgres database uses

Re: Bind Parameter is Too Big

2022-09-01 Thread Adrian Klaver
On 9/1/22 1:51 PM, Kluzak, Matthew C. wrote: Hi Adrian, The Sybase databases use Character Set = 1, iso_1 ISO 8859-1 (Latin-1) - Western European 8-bit character set. Sort Order = 50, bin_iso_1 Binary ordering, for the ISO 8859/1 or Latin-1 character set ( iso_1). The Postgres

RE: Bind Parameter is Too Big

2022-09-01 Thread Kluzak, Matthew C.
Hi Adrian, The Sybase databases use Character Set = 1, iso_1 ISO 8859-1 (Latin-1) - Western European 8-bit character set. Sort Order = 50, bin_iso_1 Binary ordering, for the ISO 8859/1 or Latin-1 character set ( iso_1). The Postgres database uses UTF8 Matt Kluzak Technology

Re: Bind Parameter is Too Big

2022-09-01 Thread Tom Lane
"Kluzak, Matthew C." writes: > I recently updated two comment columns in two tables, both on the Sybase and > Postgres sides, from varchar (255) to varchar(1000). The app can succesfully > input data with up to 1000 characters to the updated columns in Postgres. The > generated SQL statement

Re: Bind Parameter is Too Big

2022-09-01 Thread Adrian Klaver
On 9/1/22 1:34 PM, Kluzak, Matthew C. wrote: I support a system where staff use a PowerBuilder 2019R3 app that enters data into a Postgres 12 database, generates SQL statements for the data and saves them as text files. Staff uses another PB2019R3 app to populate a Sybase ASE 15.7 database

Bind Parameter is Too Big

2022-09-01 Thread Kluzak, Matthew C.
I support a system where staff use a PowerBuilder 2019R3 app that enters data into a Postgres 12 database, generates SQL statements for the data and saves them as text files. Staff uses another PB2019R3 app to populate a Sybase ASE 15.7 database with the generated SQL statement files. Other

Re: Missing query plan for auto_explain.

2022-09-01 Thread Matheus Martin
We tried running the prepared statement six times as suggested but wasn't still able to recreate the original problem. Perhaps more concerning/relevant is that we have not found any explanation to why the explain plan is not being logged by `auto_explain`. Could this be a bug? Shall we report it?

Re: Diffs in PG output vs WAL

2022-09-01 Thread Christophe Pettus
> On Sep 1, 2022, at 10:14, V wrote: > I want new/old tuples with pgoutput. how? I assume here you are reading the pgoutput protocol directly. Logical decoding sends out two tuple structures: 1. The replica identity of the row (in the case of update and delete). 2. The new row data (in the

Diffs in PG output vs WAL

2022-09-01 Thread V
I am playing with pgoutput and logical replication. With wal2json, I could capture the old values before the row was updated. I am unable to figure out how to do that with pgoutput. Does pgoutput even support this? Relevant info from wal2json: > Also, UPDATE/DELETE old row versions can be

Re: View definition changes after reloading pg_dump export

2022-09-01 Thread Ron
On 9/1/22 09:08, Tom Lane wrote: Wesley Schwengle writes: There is a view that we create and it uses a function and the view definition changes between runs. I'm not sure why this is happening, does someone know? The core reason for the discrepancy is that the parser inserts implicit

Re: View definition changes after reloading pg_dump export

2022-09-01 Thread Wesley Schwengle
On 9/1/22 10:08, Tom Lane wrote: Wesley Schwengle writes: There is a view that we create and it uses a function and the view definition changes between runs. I'm not sure why this is happening, does someone know? The core reason for the discrepancy is that the parser inserts implicit

Re: View definition changes after reloading pg_dump export

2022-09-01 Thread Tom Lane
Wesley Schwengle writes: > There is a view that we create and it uses a function and the view > definition changes between runs. I'm not sure why this is happening, > does someone know? The core reason for the discrepancy is that the parser inserts implicit coercion steps into your initial,

Re: Vacuum Full is not returning space to OS

2022-09-01 Thread Ron
On 9/1/22 07:01, Daniel Gustafsson wrote: On 1 Sep 2022, at 13:57, Ron wrote: On 9/1/22 04:47, Sushant Postgres wrote: I am running Azure PostgreSQL database version 11 with replication enabled. Azure Postgresql is sufficiently different from Vanilla that the standard answer is "ask AWS".

Re: Vacuum Full is not returning space to OS

2022-09-01 Thread Daniel Gustafsson
> On 1 Sep 2022, at 13:57, Ron wrote: > On 9/1/22 04:47, Sushant Postgres wrote: >> I am running Azure PostgreSQL database version 11 with replication enabled. > > Azure Postgresql is sufficiently different from Vanilla that the standard > answer is "ask AWS". It will most likely be more

Re: Vacuum Full is not returning space to OS

2022-09-01 Thread Ron
On 9/1/22 04:47, Sushant Postgres wrote: Hi All, I am running Azure PostgreSQL database version 11 with replication enabled. Azure Postgresql is sufficiently different from Vanilla that the standard answer is "ask AWS". But the autovacuum is not happening. Even Vacuum full is also not

Vacuum Full is not returning space to OS

2022-09-01 Thread Sushant Postgres
Hi All, I am running Azure PostgreSQL database version 11 with replication enabled. But the autovacuum is not happening. Even Vacuum full is also not reclaiming the space and returning back to OS. when, I disable to replication then only Full Vacuum is working as expected but vacuum isn't

View definition changes after reloading pg_dump export

2022-09-01 Thread Wesley Schwengle
Hello all, For our application we are generating a template.sql file with our schema in it by using pg_dump to a template.sql file. When we apply a DB change we load this template into a new database, apply the changes and export it again. This works, but we run into a small issue recently