pgsql: Fix quoting of ACL item in table for upgrade binary compatibilit

2021-11-17 Thread Michael Paquier
Fix quoting of ACL item in table for upgrade binary compatibility checks Per buildfarm member prion, that runs the regression tests under a role name that uses a hyphen. Issue introduced by 835bcba. Discussion: https://postgr.es/m/[email protected] Backpatch-through: 12 Branch --

pgsql: Fix quoting of ACL item in table for upgrade binary compatibilit

2021-11-17 Thread Michael Paquier
Fix quoting of ACL item in table for upgrade binary compatibility checks Per buildfarm member prion, that runs the regression tests under a role name that uses a hyphen. Issue introduced by 835bcba. Discussion: https://postgr.es/m/[email protected] Backpatch-through: 12 Branch --

pgsql: Fix quoting of ACL item in table for upgrade binary compatibilit

2021-11-17 Thread Michael Paquier
Fix quoting of ACL item in table for upgrade binary compatibility checks Per buildfarm member prion, that runs the regression tests under a role name that uses a hyphen. Issue introduced by 835bcba. Discussion: https://postgr.es/m/[email protected] Backpatch-through: 12 Branch --

pgsql: Fix quoting of ACL item in table for upgrade binary compatibilit

2021-11-17 Thread Michael Paquier
Fix quoting of ACL item in table for upgrade binary compatibility checks Per buildfarm member prion, that runs the regression tests under a role name that uses a hyphen. Issue introduced by 835bcba. Discussion: https://postgr.es/m/[email protected] Backpatch-through: 12 Branch --

Re: pgsql: Add table to regression tests for binary-compatibility checks in

2021-11-17 Thread Michael Paquier
On Thu, Nov 18, 2021 at 01:38:30AM +, Michael Paquier wrote: > Add table to regression tests for binary-compatibility checks in pg_upgrade > > This commit adds to the main regression test suite a table with all > the in-core data types (some exceptions apply). This table is not > dropped, so

pgsql: Add table to regression tests for binary-compatibility checks in

2021-11-17 Thread Michael Paquier
Add table to regression tests for binary-compatibility checks in pg_upgrade This commit adds to the main regression test suite a table with all the in-core data types (some exceptions apply). This table is not dropped, so as pg_upgrade would be able to check the binary compatibility of the types

pgsql: Add table to regression tests for binary-compatibility checks in

2021-11-17 Thread Michael Paquier
Add table to regression tests for binary-compatibility checks in pg_upgrade This commit adds to the main regression test suite a table with all the in-core data types (some exceptions apply). This table is not dropped, so as pg_upgrade would be able to check the binary compatibility of the types

pgsql: Add table to regression tests for binary-compatibility checks in

2021-11-17 Thread Michael Paquier
Add table to regression tests for binary-compatibility checks in pg_upgrade This commit adds to the main regression test suite a table with all the in-core data types (some exceptions apply). This table is not dropped, so as pg_upgrade would be able to check the binary compatibility of the types

pgsql: Add table to regression tests for binary-compatibility checks in

2021-11-17 Thread Michael Paquier
Add table to regression tests for binary-compatibility checks in pg_upgrade This commit adds to the main regression test suite a table with all the in-core data types (some exceptions apply). This table is not dropped, so as pg_upgrade would be able to check the binary compatibility of the types

pgsql: Provide a variant of simple_prompt() that can be interrupted by

2021-11-17 Thread Tom Lane
Provide a variant of simple_prompt() that can be interrupted by ^C. Up to now, you couldn't escape out of psql's \password command by typing control-C (or other local spelling of SIGINT). This is pretty user-unfriendly, so improve it. To do so, we have to modify the functions provided by pg_get_

pgsql: Add a planner support function for starts_with().

2021-11-17 Thread Tom Lane
Add a planner support function for starts_with(). This fills in some gaps in planner support for starts_with() and the equivalent ^@ operator: * A condition such as "textcol ^@ constant" can now use a regular btree index, not only an SP-GiST index, so long as the index's collation is C. (This wo

pgsql: Clean up error handling in pg_basebackup's walmethods.c.

2021-11-17 Thread Tom Lane
Clean up error handling in pg_basebackup's walmethods.c. The error handling here was a mess, as a result of a fundamentally bad design (relying on errno to keep its value much longer than is safe to assume) as well as a lot of just plain sloppiness, both as to noticing errors at all and as to repo

pgsql: Clean up error handling in pg_basebackup's walmethods.c.

2021-11-17 Thread Tom Lane
Clean up error handling in pg_basebackup's walmethods.c. The error handling here was a mess, as a result of a fundamentally bad design (relying on errno to keep its value much longer than is safe to assume) as well as a lot of just plain sloppiness, both as to noticing errors at all and as to repo

pgsql: Clean up error handling in pg_basebackup's walmethods.c.

2021-11-17 Thread Tom Lane
Clean up error handling in pg_basebackup's walmethods.c. The error handling here was a mess, as a result of a fundamentally bad design (relying on errno to keep its value much longer than is safe to assume) as well as a lot of just plain sloppiness, both as to noticing errors at all and as to repo

pgsql: Clean up error handling in pg_basebackup's walmethods.c.

2021-11-17 Thread Tom Lane
Clean up error handling in pg_basebackup's walmethods.c. The error handling here was a mess, as a result of a fundamentally bad design (relying on errno to keep its value much longer than is safe to assume) as well as a lot of just plain sloppiness, both as to noticing errors at all and as to repo

pgsql: Clean up error handling in pg_basebackup's walmethods.c.

2021-11-17 Thread Tom Lane
Clean up error handling in pg_basebackup's walmethods.c. The error handling here was a mess, as a result of a fundamentally bad design (relying on errno to keep its value much longer than is safe to assume) as well as a lot of just plain sloppiness, both as to noticing errors at all and as to repo

pgsql: Clean up error handling in pg_basebackup's walmethods.c.

2021-11-17 Thread Tom Lane
Clean up error handling in pg_basebackup's walmethods.c. The error handling here was a mess, as a result of a fundamentally bad design (relying on errno to keep its value much longer than is safe to assume) as well as a lot of just plain sloppiness, both as to noticing errors at all and as to repo

pgsql: Handle close() failures more robustly in pg_dump and pg_baseback

2021-11-17 Thread Tom Lane
Handle close() failures more robustly in pg_dump and pg_basebackup. Coverity complained that applying get_gz_error after a failed gzclose, as we did in one place in pg_basebackup, is unsafe. I think it's right: it's entirely likely that the call is touching freed memory. Change that to inspect er

pgsql: Handle close() failures more robustly in pg_dump and pg_baseback

2021-11-17 Thread Tom Lane
Handle close() failures more robustly in pg_dump and pg_basebackup. Coverity complained that applying get_gz_error after a failed gzclose, as we did in one place in pg_basebackup, is unsafe. I think it's right: it's entirely likely that the call is touching freed memory. Change that to inspect er

pgsql: Handle close() failures more robustly in pg_dump and pg_baseback

2021-11-17 Thread Tom Lane
Handle close() failures more robustly in pg_dump and pg_basebackup. Coverity complained that applying get_gz_error after a failed gzclose, as we did in one place in pg_basebackup, is unsafe. I think it's right: it's entirely likely that the call is touching freed memory. Change that to inspect er

pgsql: Handle close() failures more robustly in pg_dump and pg_baseback

2021-11-17 Thread Tom Lane
Handle close() failures more robustly in pg_dump and pg_basebackup. Coverity complained that applying get_gz_error after a failed gzclose, as we did in one place in pg_basebackup, is unsafe. I think it's right: it's entirely likely that the call is touching freed memory. Change that to inspect er

pgsql: Fix display of SQL-standard function's arguments in INSERT/SELEC

2021-11-17 Thread Tom Lane
Fix display of SQL-standard function's arguments in INSERT/SELECT. If a SQL-standard function body contains an INSERT ... SELECT statement, any function parameters referenced within the SELECT were always printed in $N style, rather than using the parameter name if any. While not strictly incorre

pgsql: Fix display of SQL-standard function's arguments in INSERT/SELEC

2021-11-17 Thread Tom Lane
Fix display of SQL-standard function's arguments in INSERT/SELECT. If a SQL-standard function body contains an INSERT ... SELECT statement, any function parameters referenced within the SELECT were always printed in $N style, rather than using the parameter name if any. While not strictly incorre

pgsql: Improve publication error messages

2021-11-17 Thread Daniel Gustafsson
Improve publication error messages Commit 81d5995b4b introduced more fine-grained errormessages for incorrect relkinds for publication, while unlogged and temporary tables were reported with using the same message. This provides separate error messages for these types of relpersistence. Author:

pgsql: Doc: add see-also references to CREATE PUBLICATION.

2021-11-17 Thread Daniel Gustafsson
Doc: add see-also references to CREATE PUBLICATION. The "See also" section on the reference page for CREATE PUBLICATION didn't match the cross references on CREATE SUBSCRIPTION and their ALTER counterparts. Fixed by adding an xref to the CREATE and ALTER SUBSCRIPTION pages. Backpatch down to v10

pgsql: Doc: add see-also references to CREATE PUBLICATION.

2021-11-17 Thread Daniel Gustafsson
Doc: add see-also references to CREATE PUBLICATION. The "See also" section on the reference page for CREATE PUBLICATION didn't match the cross references on CREATE SUBSCRIPTION and their ALTER counterparts. Fixed by adding an xref to the CREATE and ALTER SUBSCRIPTION pages. Backpatch down to v10

pgsql: Doc: add see-also references to CREATE PUBLICATION.

2021-11-17 Thread Daniel Gustafsson
Doc: add see-also references to CREATE PUBLICATION. The "See also" section on the reference page for CREATE PUBLICATION didn't match the cross references on CREATE SUBSCRIPTION and their ALTER counterparts. Fixed by adding an xref to the CREATE and ALTER SUBSCRIPTION pages. Backpatch down to v10

pgsql: Doc: add see-also references to CREATE PUBLICATION.

2021-11-17 Thread Daniel Gustafsson
Doc: add see-also references to CREATE PUBLICATION. The "See also" section on the reference page for CREATE PUBLICATION didn't match the cross references on CREATE SUBSCRIPTION and their ALTER counterparts. Fixed by adding an xref to the CREATE and ALTER SUBSCRIPTION pages. Backpatch down to v10

pgsql: Doc: add see-also references to CREATE PUBLICATION.

2021-11-17 Thread Daniel Gustafsson
Doc: add see-also references to CREATE PUBLICATION. The "See also" section on the reference page for CREATE PUBLICATION didn't match the cross references on CREATE SUBSCRIPTION and their ALTER counterparts. Fixed by adding an xref to the CREATE and ALTER SUBSCRIPTION pages. Backpatch down to v10

pgsql: Doc: add see-also references to CREATE PUBLICATION.

2021-11-17 Thread Daniel Gustafsson
Doc: add see-also references to CREATE PUBLICATION. The "See also" section on the reference page for CREATE PUBLICATION didn't match the cross references on CREATE SUBSCRIPTION and their ALTER counterparts. Fixed by adding an xref to the CREATE and ALTER SUBSCRIPTION pages. Backpatch down to v10