Re: Added schema level support for publication.

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: Added schema level support for publication.
Дата
Msg-id CAA4eK1L9U4bBNUXm6rj_GAyEBiDJgvKbNy+Jz1Nw0DQ3zZXqEQ@mail.gmail.com
обсуждение исходный текст
Ответ на RE: Added schema level support for publication.  ("houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>)
Ответы RE: Added schema level support for publication.  ("houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>)
Список pgsql-hackers
On Wed, Sep 29, 2021 at 9:07 AM houzj.fnst@fujitsu.com
<houzj.fnst@fujitsu.com> wrote:
>
> On Tues, Sep 28, 2021 10:46 PM vignesh C <vignesh21@gmail.com> wrote:
> > Attached v34 patch has the changes for the same.
>
> 3)
> +       /*
> +        * Check if setting the relation to a different schema will result in the
> +        * publication having schema and same schema's table in the publication.
> +        */
> +       if (stmt->objectType == OBJECT_TABLE)
> +       {
> +               ListCell   *lc;
> +               List       *schemaPubids = GetSchemaPublications(nspOid);
> +               foreach(lc, schemaPubids)
> +               {
> +                       Oid             pubid = lfirst_oid(lc);
> +                       if (list_member_oid(GetPublicationRelations(pubid, PUBLICATION_PART_ALL),
> +                                                               relid))
> +                               ereport(ERROR,
>
> How about we check this case like the following ?
>
> List       *schemaPubids = GetSchemaPublications(nspOid);
> List       *relPubids = GetRelationPublications(RelationGetRelid(rel));
> if (list_intersection(schemaPubids, relPubids))
>         ereport(ERROR, ...
>

Won't this will allow changing one of the partitions for which only
partitioned table is part of the target schema? And then probably we
won't be able to provide the exact publication in the error message if
we followed the above?

-- 
With Regards,
Amit Kapila.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: how to distinguish between using the server as a standby or for executing a targeted recovery in PG 11?
Следующее
От: bt21tanigaway
Дата:
Сообщение: Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented