diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2022-09-22 19:02:25 +0200 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2022-09-22 19:02:25 +0200 |
commit | 790bf615ddba8a0ba3b870915d03438ce9cb7860 (patch) | |
tree | c7d90ce91890f024292293bc74bac0ceaaa8d494 /doc/src | |
parent | ba50834551f936719450a287c0d7f1d0d769e9c9 (diff) | |
download | postgresql-790bf615ddba8a0ba3b870915d03438ce9cb7860.tar.gz postgresql-790bf615ddba8a0ba3b870915d03438ce9cb7860.zip |
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
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/logical-replication.sgml | 4 | ||||
-rw-r--r-- | doc/src/sgml/ref/alter_publication.sgml | 16 | ||||
-rw-r--r-- | doc/src/sgml/ref/create_publication.sgml | 14 | ||||
-rw-r--r-- | doc/src/sgml/ref/create_subscription.sgml | 2 | ||||
-rw-r--r-- | doc/src/sgml/system-views.sgml | 2 |
5 files changed, 19 insertions, 19 deletions
diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml index 48fd8e33dcc..7fe3a1043e6 100644 --- a/doc/src/sgml/logical-replication.sgml +++ b/doc/src/sgml/logical-replication.sgml @@ -700,7 +700,7 @@ test_sub=# SELECT * FROM t3; <listitem> <para> one of the publications was created using - <literal>FOR ALL TABLES IN SCHEMA</literal> and the table belongs to + <literal>FOR TABLES IN SCHEMA</literal> and the table belongs to the referred schema. This clause does not allow row filters. </para> </listitem> @@ -1530,7 +1530,7 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER Moreover, if untrusted users can create tables, use only publications that list tables explicitly. That is to say, create a subscription <literal>FOR ALL TABLES</literal> or - <literal>FOR ALL TABLES IN SCHEMA</literal> only when superusers trust + <literal>FOR TABLES IN SCHEMA</literal> only when superusers trust every user permitted to create a non-temp table on the publisher or the subscriber. </para> diff --git a/doc/src/sgml/ref/alter_publication.sgml b/doc/src/sgml/ref/alter_publication.sgml index d8ed89ee917..fc2d6d4885f 100644 --- a/doc/src/sgml/ref/alter_publication.sgml +++ b/doc/src/sgml/ref/alter_publication.sgml @@ -31,7 +31,7 @@ ALTER PUBLICATION <replaceable class="parameter">name</replaceable> RENAME TO <r <phrase>where <replaceable class="parameter">publication_object</replaceable> is one of:</phrase> TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [ ( <replaceable class="parameter">column_name</replaceable> [, ... ] ) ] [ WHERE ( <replaceable class="parameter">expression</replaceable> ) ] [, ... ] - ALL TABLES IN SCHEMA { <replaceable class="parameter">schema_name</replaceable> | CURRENT_SCHEMA } [, ... ] + TABLES IN SCHEMA { <replaceable class="parameter">schema_name</replaceable> | CURRENT_SCHEMA } [, ... ] </synopsis> </refsynopsisdiv> @@ -71,19 +71,19 @@ ALTER PUBLICATION <replaceable class="parameter">name</replaceable> RENAME TO <r <para> You must own the publication to use <command>ALTER PUBLICATION</command>. Adding a table to a publication additionally requires owning that table. - The <literal>ADD ALL TABLES IN SCHEMA</literal> and - <literal>SET ALL TABLES IN SCHEMA</literal> to a publication requires the + The <literal>ADD TABLES IN SCHEMA</literal> and + <literal>SET TABLES IN SCHEMA</literal> to a publication requires the invoking user to be a superuser. To alter the owner, you must also be a direct or indirect member of the new owning role. The new owner must have <literal>CREATE</literal> privilege on the database. Also, the new owner - of a <literal>FOR ALL TABLES</literal> or <literal>FOR ALL TABLES IN - SCHEMA</literal> publication must be a superuser. However, a superuser can + of a <literal>FOR ALL TABLES</literal> or <literal>FOR TABLES IN SCHEMA</literal> + publication must be a superuser. However, a superuser can change the ownership of a publication regardless of these restrictions. </para> <para> Adding/Setting a table that is part of schema specified in - <literal>ALL TABLES IN SCHEMA</literal>, adding/setting a schema to a + <literal>TABLES IN SCHEMA</literal>, adding/setting a schema to a publication that already has a table that is part of the specified schema or adding/setting a table to a publication that already has a table's schema as part of the specified schema is not supported. @@ -200,7 +200,7 @@ ALTER PUBLICATION mypublication SET TABLE users (user_id, firstname, lastname), <structname>sales</structname> to the publication <structname>sales_publication</structname>: <programlisting> -ALTER PUBLICATION sales_publication ADD ALL TABLES IN SCHEMA marketing, sales; +ALTER PUBLICATION sales_publication ADD TABLES IN SCHEMA marketing, sales; </programlisting> </para> @@ -210,7 +210,7 @@ ALTER PUBLICATION sales_publication ADD ALL TABLES IN SCHEMA marketing, sales; <structname>production</structname> to the publication <structname>production_publication</structname>: <programlisting> -ALTER PUBLICATION production_publication ADD TABLE users, departments, ALL TABLES IN SCHEMA production; +ALTER PUBLICATION production_publication ADD TABLE users, departments, TABLES IN SCHEMA production; </programlisting></para> </refsect1> diff --git a/doc/src/sgml/ref/create_publication.sgml b/doc/src/sgml/ref/create_publication.sgml index 0a68c4bf734..2e097a81e52 100644 --- a/doc/src/sgml/ref/create_publication.sgml +++ b/doc/src/sgml/ref/create_publication.sgml @@ -29,7 +29,7 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable> <phrase>where <replaceable class="parameter">publication_object</replaceable> is one of:</phrase> TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [ ( <replaceable class="parameter">column_name</replaceable> [, ... ] ) ] [ WHERE ( <replaceable class="parameter">expression</replaceable> ) ] [, ... ] - ALL TABLES IN SCHEMA { <replaceable class="parameter">schema_name</replaceable> | CURRENT_SCHEMA } [, ... ] + TABLES IN SCHEMA { <replaceable class="parameter">schema_name</replaceable> | CURRENT_SCHEMA } [, ... ] </synopsis> </refsynopsisdiv> @@ -112,7 +112,7 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable> <para> Specifying a table that is part of a schema specified by - <literal>FOR ALL TABLES IN SCHEMA</literal> is not supported. + <literal>FOR TABLES IN SCHEMA</literal> is not supported. </para> </listitem> </varlistentry> @@ -128,7 +128,7 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable> </varlistentry> <varlistentry> - <term><literal>FOR ALL TABLES IN SCHEMA</literal></term> + <term><literal>FOR TABLES IN SCHEMA</literal></term> <listitem> <para> Marks the publication as one that replicates changes for all tables in @@ -224,7 +224,7 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable> <para> If <literal>FOR TABLE</literal>, <literal>FOR ALL TABLES</literal> or - <literal>FOR ALL TABLES IN SCHEMA</literal> are not specified, then the + <literal>FOR TABLES IN SCHEMA</literal> are not specified, then the publication starts out with an empty set of tables. That is useful if tables or schemas are to be added later. </para> @@ -243,7 +243,7 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable> <para> To add a table to a publication, the invoking user must have ownership rights on the table. The <command>FOR ALL TABLES</command> and - <command>FOR ALL TABLES IN SCHEMA</command> clauses require the invoking + <command>FOR TABLES IN SCHEMA</command> clauses require the invoking user to be a superuser. </para> @@ -354,7 +354,7 @@ CREATE PUBLICATION insert_only FOR TABLE mydata all changes for all the tables present in the schema <structname>production</structname>: <programlisting> -CREATE PUBLICATION production_publication FOR TABLE users, departments, ALL TABLES IN SCHEMA production; +CREATE PUBLICATION production_publication FOR TABLE users, departments, TABLES IN SCHEMA production; </programlisting> </para> @@ -363,7 +363,7 @@ CREATE PUBLICATION production_publication FOR TABLE users, departments, ALL TABL the schemas <structname>marketing</structname> and <structname>sales</structname>: <programlisting> -CREATE PUBLICATION sales_publication FOR ALL TABLES IN SCHEMA marketing, sales; +CREATE PUBLICATION sales_publication FOR TABLES IN SCHEMA marketing, sales; </programlisting></para> <para> diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml index 4e001f81119..bd12e71e336 100644 --- a/doc/src/sgml/ref/create_subscription.sgml +++ b/doc/src/sgml/ref/create_subscription.sgml @@ -372,7 +372,7 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl publications has no <literal>WHERE</literal> clause (referring to that publish operation) or the publication is declared as <literal>FOR ALL TABLES</literal> or - <literal>FOR ALL TABLES IN SCHEMA</literal>, rows are always published + <literal>FOR TABLES IN SCHEMA</literal>, rows are always published regardless of the definition of the other expressions. If the subscriber is a <productname>PostgreSQL</productname> version before 15 then any row filtering is ignored during the initial data synchronization diff --git a/doc/src/sgml/system-views.sgml b/doc/src/sgml/system-views.sgml index 3f573a4f089..1ca7c3f9bfc 100644 --- a/doc/src/sgml/system-views.sgml +++ b/doc/src/sgml/system-views.sgml @@ -2090,7 +2090,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx tables they contain. Unlike the underlying catalog <link linkend="catalog-pg-publication-rel"><structname>pg_publication_rel</structname></link>, this view expands publications defined as <literal>FOR ALL TABLES</literal> - and <literal>FOR ALL TABLES IN SCHEMA</literal>, so for such publications + and <literal>FOR TABLES IN SCHEMA</literal>, so for such publications there will be a row for each eligible table. </para> |