pgsql: Revise test case added in 43746996399541ecb5c7b188725a5f097c15ce

2022-07-29 Thread Robert Haas
Revise test case added in 43746996399541ecb5c7b188725a5f097c15ceae. Instead of using command_ok() to run psql, use safe_psql(). wrasse isn't happy, and it be because of failure to pass -X to the psql invocation, which safe_psql() will do automatically. Since safe_psql() returns standard output in

pgsql: Revise test case added in 43746996399541ecb5c7b188725a5f097c15ce

2022-07-29 Thread Robert Haas
Revise test case added in 43746996399541ecb5c7b188725a5f097c15ceae. Instead of using command_ok() to run psql, use safe_psql(). wrasse isn't happy, and it be because of failure to pass -X to the psql invocation, which safe_psql() will do automatically. Since safe_psql() returns standard output in

Re: pgsql: Fix new recovery test for log_error_verbosity=verbose case

2022-07-29 Thread Andrew Dunstan
On 2022-07-29 Fr 18:08, Tom Lane wrote: > Andrew Dunstan writes: >> Fix new recovery test for log_error_verbosity=verbose case >> The new test is from commit 9e4f914b5e. >> With this setting messages have SQL error numbers included, so that >> needs to be provided for in the pattern looked for.

pgsql: Fix new recovery test for log_error_verbosity=verbose case

2022-07-29 Thread Andrew Dunstan
Fix new recovery test for log_error_verbosity=verbose case The new test is from commit 9e4f914b5e. With this setting messages have SQL error numbers included, so that needs to be provided for in the pattern looked for. Backpatch to all live branches like the original. Branch -- REL_13_STABL

pgsql: Fix new recovery test for log_error_verbosity=verbose case

2022-07-29 Thread Andrew Dunstan
Fix new recovery test for log_error_verbosity=verbose case The new test is from commit 9e4f914b5e. With this setting messages have SQL error numbers included, so that needs to be provided for in the pattern looked for. Backpatch to all live branches like the original. Branch -- REL_10_STABL

pgsql: Fix new recovery test for log_error_verbosity=verbose case

2022-07-29 Thread Andrew Dunstan
Fix new recovery test for log_error_verbosity=verbose case The new test is from commit 9e4f914b5e. With this setting messages have SQL error numbers included, so that needs to be provided for in the pattern looked for. Backpatch to all live branches like the original. Branch -- REL_12_STABL

pgsql: Fix new recovery test for log_error_verbosity=verbose case

2022-07-29 Thread Andrew Dunstan
Fix new recovery test for log_error_verbosity=verbose case The new test is from commit 9e4f914b5e. With this setting messages have SQL error numbers included, so that needs to be provided for in the pattern looked for. Backpatch to all live branches like the original. Branch -- REL_14_STABL

pgsql: Fix new recovery test for log_error_verbosity=verbose case

2022-07-29 Thread Andrew Dunstan
Fix new recovery test for log_error_verbosity=verbose case The new test is from commit 9e4f914b5e. With this setting messages have SQL error numbers included, so that needs to be provided for in the pattern looked for. Backpatch to all live branches like the original. Branch -- REL_11_STABL

pgsql: Fix new recovery test for log_error_verbosity=verbose case

2022-07-29 Thread Andrew Dunstan
Fix new recovery test for log_error_verbosity=verbose case The new test is from commit 9e4f914b5e. With this setting messages have SQL error numbers included, so that needs to be provided for in the pattern looked for. Backpatch to all live branches like the original. Branch -- REL_15_STABL

Re: pgsql: Fix new recovery test for log_error_verbosity=verbose case

2022-07-29 Thread Tom Lane
Andrew Dunstan writes: > Fix new recovery test for log_error_verbosity=verbose case > The new test is from commit 9e4f914b5e. > With this setting messages have SQL error numbers included, so that > needs to be provided for in the pattern looked for. That needs to be back-patched, no?

pgsql: Fix new recovery test for log_error_verbosity=verbose case

2022-07-29 Thread Andrew Dunstan
Fix new recovery test for log_error_verbosity=verbose case The new test is from commit 9e4f914b5e. With this setting messages have SQL error numbers included, so that needs to be provided for in the pattern looked for. Branch -- master Details --- https://git.postgresql.org/pg/commitdif

pgsql: Fix brown paper bag bug in bbe08b8869bd29d587f24ef18eb45c7d4d14a

2022-07-29 Thread Robert Haas
Fix brown paper bag bug in bbe08b8869bd29d587f24ef18eb45c7d4d14afca. We must issue the TRUNCATE command first and update relfrozenxid and relminmxid afterward; otherwise, TRUNCATE overwrites the previously-set values. Add a test case like I should have done the first time. Per buildfarm report f

pgsql: Fix brown paper bag bug in bbe08b8869bd29d587f24ef18eb45c7d4d14a

2022-07-29 Thread Robert Haas
Fix brown paper bag bug in bbe08b8869bd29d587f24ef18eb45c7d4d14afca. We must issue the TRUNCATE command first and update relfrozenxid and relminmxid afterward; otherwise, TRUNCATE overwrites the previously-set values. Add a test case like I should have done the first time. Per buildfarm report f

pgsql: Support pg_read_[binary_]file (filename, missing_ok).

2022-07-29 Thread Tom Lane
Support pg_read_[binary_]file (filename, missing_ok). There wasn't an especially nice way to read all of a file while passing missing_ok = true. Add an additional overloaded variant to support that use-case. While here, refactor the C code to avoid a rats-nest of PG_NARGS checks, instead handlin

pgsql: In transformRowExpr(), check for too many columns in the row.

2022-07-29 Thread Tom Lane
In transformRowExpr(), check for too many columns in the row. A RowExpr with more than MaxTupleAttributeNumber columns would fail at execution anyway, since we cannot form a tuple datum with more than that many columns. While heap_form_tuple() has a check for too many columns, it emerges that the

pgsql: In transformRowExpr(), check for too many columns in the row.

2022-07-29 Thread Tom Lane
In transformRowExpr(), check for too many columns in the row. A RowExpr with more than MaxTupleAttributeNumber columns would fail at execution anyway, since we cannot form a tuple datum with more than that many columns. While heap_form_tuple() has a check for too many columns, it emerges that the

pgsql: In transformRowExpr(), check for too many columns in the row.

2022-07-29 Thread Tom Lane
In transformRowExpr(), check for too many columns in the row. A RowExpr with more than MaxTupleAttributeNumber columns would fail at execution anyway, since we cannot form a tuple datum with more than that many columns. While heap_form_tuple() has a check for too many columns, it emerges that the

pgsql: In transformRowExpr(), check for too many columns in the row.

2022-07-29 Thread Tom Lane
In transformRowExpr(), check for too many columns in the row. A RowExpr with more than MaxTupleAttributeNumber columns would fail at execution anyway, since we cannot form a tuple datum with more than that many columns. While heap_form_tuple() has a check for too many columns, it emerges that the

pgsql: In transformRowExpr(), check for too many columns in the row.

2022-07-29 Thread Tom Lane
In transformRowExpr(), check for too many columns in the row. A RowExpr with more than MaxTupleAttributeNumber columns would fail at execution anyway, since we cannot form a tuple datum with more than that many columns. While heap_form_tuple() has a check for too many columns, it emerges that the

pgsql: In transformRowExpr(), check for too many columns in the row.

2022-07-29 Thread Tom Lane
In transformRowExpr(), check for too many columns in the row. A RowExpr with more than MaxTupleAttributeNumber columns would fail at execution anyway, since we cannot form a tuple datum with more than that many columns. While heap_form_tuple() has a check for too many columns, it emerges that the

pgsql: In transformRowExpr(), check for too many columns in the row.

2022-07-29 Thread Tom Lane
In transformRowExpr(), check for too many columns in the row. A RowExpr with more than MaxTupleAttributeNumber columns would fail at execution anyway, since we cannot form a tuple datum with more than that many columns. While heap_form_tuple() has a check for too many columns, it emerges that the

pgsql: Fix mistake in bbe08b8869bd29d587f24ef18eb45c7d4d14afca.

2022-07-29 Thread Robert Haas
Fix mistake in bbe08b8869bd29d587f24ef18eb45c7d4d14afca. The earlier commit used pg_class.relfilenode where it should have used pg_class.oid. This could lead to emitting an UPDATE statement into the dump that would update nothing (or the wrong thing) when executed in the new cluster, resulting in

pgsql: Fix mistake in bbe08b8869bd29d587f24ef18eb45c7d4d14afca.

2022-07-29 Thread Robert Haas
Fix mistake in bbe08b8869bd29d587f24ef18eb45c7d4d14afca. The earlier commit used pg_class.relfilenode where it should have used pg_class.oid. This could lead to emitting an UPDATE statement into the dump that would update nothing (or the wrong thing) when executed in the new cluster, resulting in

Re: pgsql: Use TRUNCATE to preserve relfilenode for pg_largeobject + index.

2022-07-29 Thread Robert Haas
On Fri, Jul 29, 2022 at 7:00 AM Dilip Kumar wrote: > @ -3167,15 +3168,36 @@ dumpDatabase(Archive *fout) > > > appendPQExpBuffer(loOutQry, "UPDATE pg_catalog.pg_class\n" > - "SET relfrozenxid = '%u', relminmxid = '%u', relfilenode = '%u'\n" > + "SET relfrozenxid = '%u', relminmxid = '%u'

Re: pgsql: Use TRUNCATE to preserve relfilenode for pg_largeobject + index.

2022-07-29 Thread Dilip Kumar
On Fri, Jul 29, 2022 at 1:46 AM Robert Haas wrote: > > Use TRUNCATE to preserve relfilenode for pg_largeobject + index. > > Commit 9a974cbcba005256a19991203583a94b4f9a21a9 arranged to preserve > the relfilenode of user tables across pg_upgrade, but failed to notice > that pg_upgrade treats pg_larg

pgsql: Fix test instability

2022-07-29 Thread Alvaro Herrera
Fix test instability On FreeBSD, the new test fails due to a WAL file being removed before the standby has had the chance to copy it. Fix by adding a replication slot to prevent the removal until after the standby has connected. Author: Kyotaro Horiguchi Reported-by: Matthias van de Meent Disc

pgsql: Fix test instability

2022-07-29 Thread Alvaro Herrera
Fix test instability On FreeBSD, the new test fails due to a WAL file being removed before the standby has had the chance to copy it. Fix by adding a replication slot to prevent the removal until after the standby has connected. Author: Kyotaro Horiguchi Reported-by: Matthias van de Meent Disc

pgsql: Fix test instability

2022-07-29 Thread Alvaro Herrera
Fix test instability On FreeBSD, the new test fails due to a WAL file being removed before the standby has had the chance to copy it. Fix by adding a replication slot to prevent the removal until after the standby has connected. Author: Kyotaro Horiguchi Reported-by: Matthias van de Meent Disc

pgsql: Fix test instability

2022-07-29 Thread Alvaro Herrera
Fix test instability On FreeBSD, the new test fails due to a WAL file being removed before the standby has had the chance to copy it. Fix by adding a replication slot to prevent the removal until after the standby has connected. Author: Kyotaro Horiguchi Reported-by: Matthias van de Meent Disc

pgsql: Fix test instability

2022-07-29 Thread Alvaro Herrera
Fix test instability On FreeBSD, the new test fails due to a WAL file being removed before the standby has had the chance to copy it. Fix by adding a replication slot to prevent the removal until after the standby has connected. Author: Kyotaro Horiguchi Reported-by: Matthias van de Meent Disc

pgsql: Fix test instability

2022-07-29 Thread Alvaro Herrera
Fix test instability On FreeBSD, the new test fails due to a WAL file being removed before the standby has had the chance to copy it. Fix by adding a replication slot to prevent the removal until after the standby has connected. Author: Kyotaro Horiguchi Reported-by: Matthias van de Meent Disc

pgsql: Fix test instability

2022-07-29 Thread Alvaro Herrera
Fix test instability On FreeBSD, the new test fails due to a WAL file being removed before the standby has had the chance to copy it. Fix by adding a replication slot to prevent the removal until after the standby has connected. Author: Kyotaro Horiguchi Reported-by: Matthias van de Meent Disc

pgsql: Move related functions next to each other in pg_publication.c.

2022-07-29 Thread Amit Kapila
Move related functions next to each other in pg_publication.c. This also improves comments atop is_publishable_class(). Author: Peter Smith Reviewed-by: Amit Kapila, Hou Zhijie Discussion: https://postgr.es/m/cahut+pupq5uw9a9ut0yjt21j9thhx958z5l0k8-9htyf_ny...@mail.gmail.com Branch -- maste