Re: Added schema level support for publication. - Mailing list pgsql-hackers

From Greg Nancarrow
Subject Re: Added schema level support for publication.
Date
Msg-id CAJcOf-fzW6xyY4D9rW0cXcBfuGxtjDwB1ShBJNy-PgFiLhabow@mail.gmail.com
Whole thread Raw
In response to RE: Added schema level support for publication.  ("houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>)
Responses RE: Added schema level support for publication.  ("houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>)
List pgsql-hackers
On Wed, Sep 22, 2021 at 9:33 PM houzj.fnst@fujitsu.com
<houzj.fnst@fujitsu.com> wrote:
>
> >
> > How do you suggest changing it?
>
> Personally, I think we'd better move the code about changing publication's
> tablelist into AlterPublicationTables and the code about changing publication's
> schemalist into AlterPublicationSchemas. It's similar to what the v29-patchset
> did, the difference is the SET action, I suggest we drop all the tables in
> function AlterPublicationTables when user only set schemas and drop all the
> schema in AlterPublicationSchemas when user only set tables. In this approach,
> we can keep schema and relation code separate and don't need to worry
> about the locking order.
>
> Attach a top-up patch which refactor the code like above.
> Thoughts ?
>

Sounds like a good idea.
Is it possible to incorporate the existing
CheckPublicationAlterTables() and CheckPublicationAlterSchemas()
functions into your suggested update?
I think it might tidy up the error-checking a bit.

Regards,
Greg Nancarrow
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: stat() vs ERROR_DELETE_PENDING, round N + 1
Next
From: Amit Kapila
Date:
Subject: Re: relation OID in ReorderBufferToastReplace error message