Re: Ambiguous description on new columns

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: kdg(dot)dev(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Ambiguous description on new columns
Date: 2024-05-21 12:43:30
Message-ID: CAECtzeWRtZTcXgyr19Zx6r9yPdQqw-_XbUXeJx6YppRNubPF8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

Hi,

Le mar. 21 mai 2024 à 12:40, PG Doc comments form <noreply(at)postgresql(dot)org>
a écrit :

> The following documentation comment has been logged on the website:
>
> Page:
> https://www.postgresql.org/docs/16/logical-replication-col-lists.html
> Description:
>
> The documentation on this page mentions:
>
> "If no column list is specified, any columns added later are automatically
> replicated."
>
> It feels ambiguous what this could mean. Does it mean:
>
> 1/ That if you alter the table on the publisher and add a new column, it
> will be replicated
>
> 2/ If you add a column list later and add a column to it, it will be
> replicated
>
> In both cases, does the subscriber automatically create this column if it
> wasn't there before? I recall reading that the initial data synchronization
> requires the schema of the publisher database to be created on the
> subscriber first. But then later updates sync newly created columns? I
> don't
> recall any pages on logical replication mentioning this, up to this point.
>
>
It feels ambiguous. DDL commands are not replicated, so the new columns
don't appear automagically on the subscriber. You have to add them to the
subscriber. But values of new columns are replicated, whether or not you
have added the new columns on the subscriber.

Regards.

--
Guillaume.

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Erik Wienhold 2024-05-22 00:59:37 column_name of ALTER MATERIALIZED VIEW should only refer to an existing column
Previous Message Laurenz Albe 2024-05-21 11:12:24 Re: 52.38 pg_proc (postgresql version 14)

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2024-05-21 12:44:32 Re: Path to unreverting "Allow planner to use Merge Append to efficiently implement UNION"
Previous Message Alvaro Herrera 2024-05-21 12:34:56 Re: Path to unreverting "Allow planner to use Merge Append to efficiently implement UNION"