On 01.11.24 19:09, PG Bug reporting form wrote:
> It seems that if you (1) create a logical replication slot (2) and activity
> happens in your database then (3) you create a publication, the combination
> of that slot + publication is not usable (you can't connect).
>
> i.e. if there is any activity "in" a slot that predates the create statement
> for a pub, the slot+pub combo will not work.
>
> Is this known behavior? It's surprising just insofar as I'd hope either:
>
> - the docs cover this
> - the error message that one gets could be made clearer
Do the docs anywhere suggest you can do this? The normal way to set up
logical replication is to run CREATE SUBSCRIPTION, which makes the slot
for you. And CREATE SUBSCRIPTION requires specifying a publication, so
it already has to exist beforehand.