Re: Pgoutput not capturing the generated columns
Ajin Cherian <itsajin@gmail.com>
On Mon, Nov 4, 2024 at 2:20 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > On Thu, Oct 31, 2024 at 4:26 PM Ajin Cherian <itsajin@gmail.com> wrote: > > > > 5. Verified that publications with different column list are disallowed to be subscribed by one subscription > > a. PUB_A(column list = (a, b)) PUB_B(no column list, with publish_generated_column) - OK > > b. PUB_A(column list = (a, b)) PUB_B(no column list, without publish_generated_column) - FAIL > > c. PUB_A(no column list, without publish_generated_column) PUB_B(no column list, with publish_generated_column) - FAIL > > > > Tests did not show any unexpected behaviour. > > > > Thanks for the tests, but the results of step 5 do not clearly show > whether they are correct because you haven't shared the table schema. > Here are the tests: 5. Verified that publications with different column list are disallowed to be subscribed by one subscription a. PUB_A(column list = (a, b)) PUB_B(no column list, with publish_generated_column) - OK PUB: CREATE TABLE gencols (a int, gen1 int GENERATED ALWAYS AS (a * 2) STORED); CREATE PUBLICATION pub1 FOR table gencols with (publish_generated_columns=true); CREATE PUBLICATION pub2 FOR table gencols(a,gen1); SUB: postgres=# CREATE SUBSCRIPTION sub1 CONNECTION 'dbname=postgres host=localhost port=6972' PUBLICATION pub1, pub2; NOTICE: created replication slot "sub1" on publisher CREATE SUBSCRIPTION b. PUB_A(column list = (a, b)) PUB_B(no column list, without publish_generated_column) - FAIL PUB: CREATE TABLE gencols (a int, gen1 int GENERATED ALWAYS AS (a * 2) STORED); CREATE PUBLICATION pub1 FOR table gencols with (publish_generated_columns=false); CREATE PUBLICATION pub2 FOR table gencols(a,gen1); SUB: postgres=# CREATE SUBSCRIPTION sub1 CONNECTION 'dbname=postgres host=localhost port=6972' PUBLICATION pub1, pub2; ERROR: cannot use different column lists for table "public.gencols" in different publications c. PUB_A(no column list, without publish_generated_column) PUB_B(no column list, with publish_generated_column) - FAIL PUB: CREATE TABLE gencols (a int, gen1 int GENERATED ALWAYS AS (a * 2) STORED); CREATE PUBLICATION pub1 FOR table gencols with (publish_generated_columns=false); CREATE PUBLICATION pub2 FOR table gencols with (publish_generated_columns=true); SUB: postgres=# CREATE SUBSCRIPTION sub1 CONNECTION 'dbname=postgres host=localhost port=6972' PUBLICATION pub1, pub2; ERROR: cannot use different column lists for table "public.gencols" in different publications regards, Ajin Cherian Fujitsu Australia
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Doc: Generated column replication.
- 6252b1eaf82b 18.0 landed
-
Rename pubgencols_type to pubgencols in pg_publication.
- 75eb9766ec20 18.0 landed
-
Doc: Fix column name in pg_publication catalog.
- 117f9f328e0f 18.0 landed
-
Fix buildfarm failure introduced by commit e65dbc9927.
- b35434b134b1 18.0 landed
-
Change publication's publish_generated_columns option type to enum.
- e65dbc9927fb 18.0 landed
-
Fix \dRp+ output when describing publications with a lower server version.
- 991974bb4888 18.0 landed
-
Replicate generated columns when 'publish_generated_columns' is set.
- 7054186c4ebe 18.0 landed
-
Doc: Update the behavior of generated columns in Logical Replication.
- 5b0c46ea0932 18.0 landed
-
Replicate generated columns when specified in the column list.
- 745217a051a9 18.0 landed
-
Doc: Generated columns are skipped for logical replication.
- 7a089f6e6a14 17.0 cited