pgsql: Fix thinko in comment.

2022-09-22 Thread Etsuro Fujita
Fix thinko in comment.

This comment has been wrong since its introduction in commit 0d5f05cde;
backpatch to v12 where that came in.

Discussion: 
https://postgr.es/m/CAPmGK14VGf-xQjGQN4o1QyAbXAaxugU5%3DqfcmTDh1iufUDnV_w%40mail.gmail.com

Branch
--
REL_13_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/5f9dda4c0664faf36fdf931f00e2206dad2d3066

Modified Files
--
src/backend/commands/copy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgsql: Fix thinko in comment.

2022-09-22 Thread Etsuro Fujita
Fix thinko in comment.

This comment has been wrong since its introduction in commit 0d5f05cde;
backpatch to v12 where that came in.

Discussion: 
https://postgr.es/m/CAPmGK14VGf-xQjGQN4o1QyAbXAaxugU5%3DqfcmTDh1iufUDnV_w%40mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/cbe6dd17ac453fece214b2a430b354d4f7d5a15d

Modified Files
--
src/backend/commands/copyfrom.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgsql: Fix thinko in comment.

2022-09-22 Thread Etsuro Fujita
Fix thinko in comment.

This comment has been wrong since its introduction in commit 0d5f05cde;
backpatch to v12 where that came in.

Discussion: 
https://postgr.es/m/CAPmGK14VGf-xQjGQN4o1QyAbXAaxugU5%3DqfcmTDh1iufUDnV_w%40mail.gmail.com

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/e4514aafad0b134e67d7d0cf1612fb5c76fc8fec

Modified Files
--
src/backend/commands/copyfrom.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgsql: Fix thinko in comment.

2022-09-22 Thread Etsuro Fujita
Fix thinko in comment.

This comment has been wrong since its introduction in commit 0d5f05cde;
backpatch to v12 where that came in.

Discussion: 
https://postgr.es/m/CAPmGK14VGf-xQjGQN4o1QyAbXAaxugU5%3DqfcmTDh1iufUDnV_w%40mail.gmail.com

Branch
--
REL_12_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/6359e4b0fe7138f7b89e07858e1563c46d36459a

Modified Files
--
src/backend/commands/copy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgsql: Fix thinko in comment.

2022-09-22 Thread Etsuro Fujita
Fix thinko in comment.

This comment has been wrong since its introduction in commit 0d5f05cde;
backpatch to v12 where that came in.

Discussion: 
https://postgr.es/m/CAPmGK14VGf-xQjGQN4o1QyAbXAaxugU5%3DqfcmTDh1iufUDnV_w%40mail.gmail.com

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/901ef14afe981065a0c5c61b1759d36482869d98

Modified Files
--
src/backend/commands/copyfrom.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgsql: Use min/max bounds defined by Zstd for compression level

2022-09-22 Thread Michael Paquier
Use min/max bounds defined by Zstd for compression level

The bounds hardcoded in compression.c since ffd5365 (minimum at 1 and
maximum at 22) do not match the reality of what zstd is able to
handle, these values being available via ZSTD_maxCLevel() and
ZSTD_minCLevel() at run-time.  The maximum of 22 is actually correct
in recent versions, but the minimum was not as the library can go down
to -131720 by design.  This commit changes the code to use the run-time
values in the code instead of some hardcoded ones.

Zstd seems to assume that these bounds could change in the future, and
Postgres will be able to adapt automatically to such changes thanks to
what's being done in this commit.

Reported-by: Justin Prysby
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 15

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/ade925e1693a595ef1c278583fa699ca6fc1ff45

Modified Files
--
doc/src/sgml/protocol.sgml | 6 --
src/common/compression.c   | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)



pgsql: Use min/max bounds defined by Zstd for compression level

2022-09-22 Thread Michael Paquier
Use min/max bounds defined by Zstd for compression level

The bounds hardcoded in compression.c since ffd5365 (minimum at 1 and
maximum at 22) do not match the reality of what zstd is able to
handle, these values being available via ZSTD_maxCLevel() and
ZSTD_minCLevel() at run-time.  The maximum of 22 is actually correct
in recent versions, but the minimum was not as the library can go down
to -131720 by design.  This commit changes the code to use the run-time
values in the code instead of some hardcoded ones.

Zstd seems to assume that these bounds could change in the future, and
Postgres will be able to adapt automatically to such changes thanks to
what's being done in this commit.

Reported-by: Justin Prysby
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 15

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/18ac08f0b42de3cf35f07199c9f482746c8b12c0

Modified Files
--
doc/src/sgml/protocol.sgml | 6 --
src/common/compression.c   | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)



pgsql: Restore archive_command documentation

2022-09-22 Thread Peter Eisentraut
Restore archive_command documentation

Commit 5ef1eefd76f404ddc59b885d50340e602b70f05f, which added
archive_library, purged most mentions of archive_command from the
documentation.  This is inappropriate, since archive_command is still
a feature in use and users will want to see information about it.

This restores all the removed mentions and rephrases things so that
archive_command and archive_library are presented as alternatives of
each other.

Reviewed-by: Nathan Bossart 
Discussion: 
https://www.postgresql.org/message-id/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/ba50834551f936719450a287c0d7f1d0d769e9c9

Modified Files
--
doc/src/sgml/backup.sgml| 92 ++---
doc/src/sgml/config.sgml| 61 +---
doc/src/sgml/high-availability.sgml |  6 +--
doc/src/sgml/ref/pg_receivewal.sgml |  7 ++-
doc/src/sgml/wal.sgml   |  3 +-
5 files changed, 88 insertions(+), 81 deletions(-)



pgsql: Restore archive_command documentation

2022-09-22 Thread Peter Eisentraut
Restore archive_command documentation

Commit 5ef1eefd76f404ddc59b885d50340e602b70f05f, which added
archive_library, purged most mentions of archive_command from the
documentation.  This is inappropriate, since archive_command is still
a feature in use and users will want to see information about it.

This restores all the removed mentions and rephrases things so that
archive_command and archive_library are presented as alternatives of
each other.

Reviewed-by: Nathan Bossart 
Discussion: 
https://www.postgresql.org/message-id/[email protected]

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/5f56933ea5d5b0b1a0bbe4c7b8f5110f8fe256ed

Modified Files
--
doc/src/sgml/backup.sgml| 88 ++---
doc/src/sgml/config.sgml| 61 +
doc/src/sgml/high-availability.sgml |  6 +--
doc/src/sgml/ref/pg_receivewal.sgml |  7 ++-
doc/src/sgml/wal.sgml   |  3 +-
5 files changed, 86 insertions(+), 79 deletions(-)



pgsql: Remove ALL keyword from TABLES IN SCHEMA for publication

2022-09-22 Thread Alvaro Herrera
Remove ALL keyword from TABLES IN SCHEMA for publication

This may be a bit too subtle, but removing that word from there makes
this clause no longer a perfect parallel of the GRANT variant "ALL
TABLES IN SCHEMA": indeed, for publications what we record is the schema
itself, not the tables therein, which means that any tables added to the
schema in the future are also published.  This is completely different
to what GRANT does, which is affect only the tables that exist when the
command is executed.

There isn't resounding support for this change, but there are a few
positive votes and no opposition.  Because the time to 15 RC1 is very
short, let's get this out now.

Backpatch to 15.

Discussion: https://postgr.es/m/2729c9e2-9aac-8cda-f2f4-34f2bcc18f4e

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/f256236fb1b00e9d05f889a53e93feeecbd50991

Modified Files
--
doc/src/sgml/logical-replication.sgml  |   4 +-
doc/src/sgml/ref/alter_publication.sgml|  16 +--
doc/src/sgml/ref/create_publication.sgml   |  14 +--
doc/src/sgml/ref/create_subscription.sgml  |   2 +-
doc/src/sgml/system-views.sgml |   2 +-
src/backend/catalog/pg_publication.c   |   4 +-
src/backend/commands/publicationcmds.c |   8 +-
src/backend/parser/gram.y  |  18 ++--
src/backend/replication/pgoutput/pgoutput.c|   3 +-
src/bin/pg_dump/pg_dump.c  |   2 +-
src/bin/pg_dump/t/002_pg_dump.pl   |  15 ++-
src/bin/psql/tab-complete.c|  15 ++-
src/test/regress/expected/alter_table.out  |   2 +-
src/test/regress/expected/object_address.out   |   2 +-
src/test/regress/expected/publication.out  | 120 ++---
src/test/regress/sql/alter_table.sql   |   2 +-
src/test/regress/sql/object_address.sql|   2 +-
src/test/regress/sql/publication.sql   | 104 +-
.../subscription/t/025_rep_changes_for_schema.pl   |   6 +-
src/test/subscription/t/028_row_filter.pl  |  12 +--
src/test/subscription/t/031_column_list.pl |   4 +-
21 files changed, 177 insertions(+), 180 deletions(-)



pgsql: Remove ALL keyword from TABLES IN SCHEMA for publication

2022-09-22 Thread Alvaro Herrera
Remove ALL keyword from TABLES IN SCHEMA for publication

This may be a bit too subtle, but removing that word from there makes
this clause no longer a perfect parallel of the GRANT variant "ALL
TABLES IN SCHEMA": indeed, for publications what we record is the schema
itself, not the tables therein, which means that any tables added to the
schema in the future are also published.  This is completely different
to what GRANT does, which is affect only the tables that exist when the
command is executed.

There isn't resounding support for this change, but there are a few
positive votes and no opposition.  Because the time to 15 RC1 is very
short, let's get this out now.

Backpatch to 15.

Discussion: https://postgr.es/m/2729c9e2-9aac-8cda-f2f4-34f2bcc18f4e

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/790bf615ddba8a0ba3b870915d03438ce9cb7860

Modified Files
--
doc/src/sgml/logical-replication.sgml  |   4 +-
doc/src/sgml/ref/alter_publication.sgml|  16 +--
doc/src/sgml/ref/create_publication.sgml   |  14 +--
doc/src/sgml/ref/create_subscription.sgml  |   2 +-
doc/src/sgml/system-views.sgml |   2 +-
src/backend/catalog/pg_publication.c   |   4 +-
src/backend/commands/publicationcmds.c |   6 +-
src/backend/parser/gram.y  |  18 ++--
src/backend/replication/pgoutput/pgoutput.c|   3 +-
src/bin/pg_dump/pg_dump.c  |   2 +-
src/bin/pg_dump/t/002_pg_dump.pl   |  15 ++-
src/bin/psql/tab-complete.c|  15 ++-
src/test/regress/expected/alter_table.out  |   2 +-
src/test/regress/expected/object_address.out   |   2 +-
src/test/regress/expected/publication.out  | 120 ++---
src/test/regress/sql/alter_table.sql   |   2 +-
src/test/regress/sql/object_address.sql|   2 +-
src/test/regress/sql/publication.sql   | 104 +-
.../subscription/t/025_rep_changes_for_schema.pl   |   6 +-
src/test/subscription/t/028_row_filter.pl  |  12 +--
src/test/subscription/t/031_column_list.pl |   4 +-
21 files changed, 176 insertions(+), 179 deletions(-)



pgsql: Fix race condition where heap_delete() fails to pin VM page.

2022-09-22 Thread Jeff Davis
Fix race condition where heap_delete() fails to pin VM page.

Similar to 5f12bc94dc, the code must re-check PageIsAllVisible() after
buffer lock is re-acquired. Backpatching to the same version, 12.

Discussion: 
https://postgr.es/m/caep4naw9jyqdkd_5y+-s2e4yiujq1vqiikfjygplshtp-k3...@mail.gmail.com
Reported-by: Robins Tharakan
Reviewed-by: Robins Tharakan
Backpatch-through: 12

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/163b0993a162ebae00fe5de8f593a5da28821a1b

Modified Files
--
src/backend/access/heap/heapam.c | 30 +++---
1 file changed, 19 insertions(+), 11 deletions(-)



pgsql: Fix race condition where heap_delete() fails to pin VM page.

2022-09-22 Thread Jeff Davis
Fix race condition where heap_delete() fails to pin VM page.

Similar to 5f12bc94dc, the code must re-check PageIsAllVisible() after
buffer lock is re-acquired. Backpatching to the same version, 12.

Discussion: 
https://postgr.es/m/caep4naw9jyqdkd_5y+-s2e4yiujq1vqiikfjygplshtp-k3...@mail.gmail.com
Reported-by: Robins Tharakan
Reviewed-by: Robins Tharakan
Backpatch-through: 12

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/dd6070bc81733c3174f2e257d43908f98b0255fb

Modified Files
--
src/backend/access/heap/heapam.c | 30 +++---
1 file changed, 19 insertions(+), 11 deletions(-)



pgsql: Fix race condition where heap_delete() fails to pin VM page.

2022-09-22 Thread Jeff Davis
Fix race condition where heap_delete() fails to pin VM page.

Similar to 5f12bc94dc, the code must re-check PageIsAllVisible() after
buffer lock is re-acquired. Backpatching to the same version, 12.

Discussion: 
https://postgr.es/m/caep4naw9jyqdkd_5y+-s2e4yiujq1vqiikfjygplshtp-k3...@mail.gmail.com
Reported-by: Robins Tharakan
Reviewed-by: Robins Tharakan
Backpatch-through: 12

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/21934612d86a1e0c83c2774b776a022b9a5a90bd

Modified Files
--
src/backend/access/heap/heapam.c | 30 +++---
1 file changed, 19 insertions(+), 11 deletions(-)



pgsql: Fix race condition where heap_delete() fails to pin VM page.

2022-09-22 Thread Jeff Davis
Fix race condition where heap_delete() fails to pin VM page.

Similar to 5f12bc94dc, the code must re-check PageIsAllVisible() after
buffer lock is re-acquired. Backpatching to the same version, 12.

Discussion: 
https://postgr.es/m/caep4naw9jyqdkd_5y+-s2e4yiujq1vqiikfjygplshtp-k3...@mail.gmail.com
Reported-by: Robins Tharakan
Reviewed-by: Robins Tharakan
Backpatch-through: 12

Branch
--
REL_13_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/410c422b75ac53a4da438c1a4b0e1fa421db0d59

Modified Files
--
src/backend/access/heap/heapam.c | 30 +++---
1 file changed, 19 insertions(+), 11 deletions(-)



pgsql: Fix race condition where heap_delete() fails to pin VM page.

2022-09-22 Thread Jeff Davis
Fix race condition where heap_delete() fails to pin VM page.

Similar to 5f12bc94dc, the code must re-check PageIsAllVisible() after
buffer lock is re-acquired. Backpatching to the same version, 12.

Discussion: 
https://postgr.es/m/caep4naw9jyqdkd_5y+-s2e4yiujq1vqiikfjygplshtp-k3...@mail.gmail.com
Reported-by: Robins Tharakan
Reviewed-by: Robins Tharakan
Backpatch-through: 12

Branch
--
REL_12_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/cab72f0fd08cceb975194d2acd2f6eed917e8fb8

Modified Files
--
src/backend/access/heap/heapam.c | 30 +++---
1 file changed, 19 insertions(+), 11 deletions(-)



pgsql: Harmonize parameter names in ecpg code.

2022-09-22 Thread Peter Geoghegan
Harmonize parameter names in ecpg code.

Make ecpg function declarations consistently use named parameters.  Also
make sure that the declarations use names that match corresponding names
from function definitions.

Like other recent commits that cleaned up function parameter names, this
commit was written with help from clang-tidy.

Author: Peter Geoghegan 
Reviewed-By: David Rowley 
Discussion: 
https://postgr.es/m/cah2-wznjt9cmm9kjtmjjh_zbl5hd9ox44qdj4aqztjfi-za...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/3535ebce5dc542b90f14d6e81cce80fe7226bda5

Modified Files
--
src/interfaces/ecpg/ecpglib/ecpglib_extern.h   | 78 
src/interfaces/ecpg/include/ecpg_informix.h| 82 +++---
src/interfaces/ecpg/include/ecpglib.h  | 60 +---
src/interfaces/ecpg/include/pgtypes_date.h | 20 +++---
src/interfaces/ecpg/include/pgtypes_interval.h |  8 +--
src/interfaces/ecpg/include/pgtypes_numeric.h  | 36 +-
src/interfaces/ecpg/include/pgtypes_timestamp.h| 12 ++--
src/interfaces/ecpg/pgtypeslib/dt.h| 22 +++---
src/interfaces/ecpg/pgtypeslib/pgtypeslib_extern.h |  8 ++-
src/interfaces/ecpg/preproc/c_keywords.c   |  8 +--
src/interfaces/ecpg/preproc/ecpg.header|  2 +-
src/interfaces/ecpg/preproc/output.c   |  2 +-
src/interfaces/ecpg/preproc/pgc.l  |  2 +-
src/interfaces/ecpg/preproc/preproc_extern.h   | 63 ++---
src/interfaces/ecpg/preproc/type.c |  2 +-
src/interfaces/ecpg/preproc/type.h | 27 ---
.../ecpg/test/expected/preproc-outofscope.c| 36 +-
src/interfaces/ecpg/test/expected/sql-sqlda.c  | 36 +-
18 files changed, 271 insertions(+), 233 deletions(-)



pgsql: Harmonize more lexer function parameter names.

2022-09-22 Thread Peter Geoghegan
Harmonize more lexer function parameter names.

Make sure that function declarations use names that exactly match the
corresponding names from function definitions for several "lexer
adjacent" backend functions.  These were missed by commit aab06442.

Author: Peter Geoghegan 
Discussion: 
https://postgr.es/m/cah2-wznjt9cmm9kjtmjjh_zbl5hd9ox44qdj4aqztjfi-za...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/8fb4e001e9c185250a95b2b13880a2a04d626b75

Modified Files
--
src/backend/utils/adt/jsonpath_scan.l   | 2 +-
src/bin/pgbench/pgbench.h   | 6 +++---
src/include/bootstrap/bootstrap.h   | 2 +-
src/include/parser/scanner.h| 2 +-
src/include/replication/walsender_private.h | 2 +-
src/test/isolation/isolationtester.h| 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)



pgsql: Harmonize parameter names in contrib code.

2022-09-22 Thread Peter Geoghegan
Harmonize parameter names in contrib code.

Make sure that function declarations use names that exactly match the
corresponding names from function definitions in contrib code.

Like other recent commits that cleaned up function parameter names, this
commit was written with help from clang-tidy.

Author: Peter Geoghegan 
Discussion: 
https://postgr.es/m/cah2-wznjt9cmm9kjtmjjh_zbl5hd9ox44qdj4aqztjfi-za...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/0faf7d933f625eb1668dcaa518b472f722b53a55

Modified Files
--
contrib/amcheck/verify_nbtree.c   |  2 +-
contrib/cube/cube.c   |  2 +-
contrib/dblink/dblink.c   |  2 +-
contrib/fuzzystrmatch/dmetaphone.c|  2 +-
contrib/intarray/_int.h   |  2 +-
contrib/intarray/_int_selfuncs.c  |  4 ++--
contrib/intarray/_int_tool.c  |  4 ++--
contrib/ltree/ltree.h |  2 +-
contrib/oid2name/oid2name.c   | 14 +++---
contrib/pgcrypto/mbuf.h   | 18 +-
contrib/pgcrypto/pgcrypto.c   |  3 ++-
contrib/pgcrypto/pgp.h| 32 
contrib/pgcrypto/px-crypt.h   |  6 +++---
contrib/pgcrypto/px.h |  2 +-
contrib/postgres_fdw/deparse.c|  2 +-
contrib/postgres_fdw/postgres_fdw.c   |  2 +-
contrib/postgres_fdw/postgres_fdw.h   |  2 +-
contrib/seg/seg.c |  2 +-
contrib/seg/segdata.h |  2 +-
contrib/tablefunc/tablefunc.c |  6 +++---
contrib/test_decoding/test_decoding.c |  6 +++---
21 files changed, 59 insertions(+), 58 deletions(-)



pgsql: Harmonize parameter names in pg_dump/pg_dumpall.

2022-09-22 Thread Peter Geoghegan
Harmonize parameter names in pg_dump/pg_dumpall.

Make sure that function declarations use names that exactly match the
corresponding names from function definitions in pg_dump/pg_dumpall
related code.

Affected code happens to be inconsistent in how it applies conventions
around how Archive and Archive Handle variables are named.  Significant
code churn is required to fully fix those inconsistencies, so take the
least invasive approach possible: treat function definition names as
authoritative, and mechanically adjust corresponding names from function
definitions to match.

Like other recent commits that cleaned up function parameter names, this
commit was written with help from clang-tidy.

Author: Peter Geoghegan 
Reviewed-By: Tom Lane 
Discussion: 
https://postgr.es/m/cah2-wzmma+vzco6gr5nydz+sx0g14au-urzfutt2foraisv...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/20e69daa1348f6899fffe3c260bf44293551ee87

Modified Files
--
src/bin/pg_dump/common.c  |  2 +-
src/bin/pg_dump/pg_backup.h   | 14 +++---
src/bin/pg_dump/pg_backup_archiver.h  |  2 +-
src/bin/pg_dump/pg_backup_custom.c|  2 +-
src/bin/pg_dump/pg_backup_directory.c |  2 +-
src/bin/pg_dump/pg_backup_tar.c   |  4 ++--
src/bin/pg_dump/pg_dump.c |  8 
src/bin/pg_dump/pg_dump.h |  6 +++---
src/bin/pg_dump/pg_dumpall.c  |  6 --
9 files changed, 24 insertions(+), 22 deletions(-)



pgsql: Doc: adjust misleading phrasing of a few cross-references.

2022-09-22 Thread Tom Lane
Doc: adjust misleading phrasing of a few cross-references.

The pg_dump and pg_dumpall man pages referred to app-psql-patterns
as appearing "below", which I suspect was copied-and-pasted from
equivalent text in psql-ref.sgml rather than being actually thought
through.  At least to me, that phrasing means "later in this same
web page/section", which this link target is not.  Drop the
misleading and unnecessary-in-any-case adjective.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/d89755dac6153518a601ca0fa9e489f2bc209fdc

Modified Files
--
doc/src/sgml/ref/pg_dump.sgml| 8 
doc/src/sgml/ref/pg_dumpall.sgml | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)



pgsql: Allow publications with schema and table of the same schema.

2022-09-22 Thread Amit Kapila
Allow publications with schema and table of the same schema.

We previously thought that allowing such cases can confuse users when they
specify DROP TABLES IN SCHEMA but that doesn't seem to be the case based
on discussion. This helps to uplift the restriction during
ALTER TABLE ... SET SCHEMA which used to ensure that we couldn't end up
with a publication having both a schema and the same schema's table.

To allow this, we need to forbid having any schema on a publication if
column lists on a table are specified (and vice versa). This is because
otherwise we still need a restriction during ALTER TABLE ... SET SCHEMA to
forbid cases where it could lead to a publication having both a schema and
the same schema's table with column list.

Based on suggestions by Peter Eisentraut.

Author: Hou Zhijie and Vignesh C
Reviewed-By: Peter Smith, Amit Kapila
Backpatch-through: 15, where it was introduced
Discussion: 
https://postgr.es/m/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/13a185f54ba594a5fb42bac3e1ecbdfd62b9041f

Modified Files
--
doc/src/sgml/logical-replication.sgml   |   5 +
doc/src/sgml/ref/alter_publication.sgml |  15 ++-
doc/src/sgml/ref/create_publication.sgml|  20 ++--
src/backend/catalog/pg_publication.c|  15 ++-
src/backend/commands/publicationcmds.c  | 156 ++--
src/backend/commands/tablecmds.c|  27 -
src/backend/replication/pgoutput/pgoutput.c |  31 +++---
src/bin/pg_dump/t/002_pg_dump.pl|  14 +++
src/test/regress/expected/alter_table.out   |  14 ++-
src/test/regress/expected/publication.out   |  90 ++--
src/test/regress/sql/alter_table.sql|   3 +-
src/test/regress/sql/publication.sql|  44 +++-
src/test/subscription/t/028_row_filter.pl   |   2 +-
13 files changed, 251 insertions(+), 185 deletions(-)



pgsql: Allow publications with schema and table of the same schema.

2022-09-22 Thread Amit Kapila
Allow publications with schema and table of the same schema.

We previously thought that allowing such cases can confuse users when they
specify DROP TABLES IN SCHEMA but that doesn't seem to be the case based
on discussion. This helps to uplift the restriction during
ALTER TABLE ... SET SCHEMA which used to ensure that we couldn't end up
with a publication having both a schema and the same schema's table.

To allow this, we need to forbid having any schema on a publication if
column lists on a table are specified (and vice versa). This is because
otherwise we still need a restriction during ALTER TABLE ... SET SCHEMA to
forbid cases where it could lead to a publication having both a schema and
the same schema's table with column list.

Based on suggestions by Peter Eisentraut.

Author: Hou Zhijie and Vignesh C
Reviewed-By: Peter Smith, Amit Kapila
Backpatch-through: 15, where it was introduced
Discussion: 
https://postgr.es/m/[email protected]

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/b7256753ec251fd6a1f6bd205dbe62ccbb3261c4

Modified Files
--
doc/src/sgml/logical-replication.sgml   |   5 +
doc/src/sgml/ref/alter_publication.sgml |  15 ++-
doc/src/sgml/ref/create_publication.sgml|  20 ++--
src/backend/catalog/pg_publication.c|  15 ++-
src/backend/commands/publicationcmds.c  | 156 ++--
src/backend/commands/tablecmds.c|  27 -
src/backend/replication/pgoutput/pgoutput.c |  31 +++---
src/bin/pg_dump/t/002_pg_dump.pl|  14 +++
src/test/regress/expected/alter_table.out   |  14 ++-
src/test/regress/expected/publication.out   |  90 ++--
src/test/regress/sql/alter_table.sql|   3 +-
src/test/regress/sql/publication.sql|  44 +++-
src/test/subscription/t/028_row_filter.pl   |   2 +-
13 files changed, 251 insertions(+), 185 deletions(-)



pgsql: ci: freebsd: Set extra_{lib,include}_dirs to /usr/local/...

2022-09-22 Thread Andres Freund
ci: freebsd: Set extra_{lib,include}_dirs to /usr/local/...

Ommitted in e6b6ea025cc, but necessary for libintl to be found. All other
dependencies can be found via pkg-config (which searches in /usr/local/...)
and thus worked even without adding the directories.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/e3e6ee69641b8ea1e24f05ee64393a52e495bf86

Modified Files
--
.cirrus.yml | 1 +
1 file changed, 1 insertion(+)