pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Raise a warning if there is a possibility of data from multiple
9+ messages / 5 participants
[nested] [flat]

* pgsql: Raise a warning if there is a possibility of data from multiple
@ 2022-09-08 01:39 Amit Kapila <akapila@postgresql.org>
  2022-09-08 06:52 ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Amit Kapila @ 2022-09-08 01:39 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Raise a warning if there is a possibility of data from multiple origins.

This commit raises a warning message for a combination of options
('copy_data = true' and 'origin = none') during CREATE/ALTER subscription
operations if the publication tables were also replicated from other
publishers.

During replication, we can skip the data from other origins as we have that
information in WAL but that is not possible during initial sync so we raise
a warning if there is such a possibility.

Author: Vignesh C
Reviewed-By: Peter Smith, Amit Kapila, Jonathan Katz, Shi yu, Wang wei
Discussion: https://www.postgresql.org/message-id/CALDaNm0gwjY_4HFxvvty01BOT01q_fJLKQ3pWP9=9orqubhjcQ@mail.gmail...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/875693019053b8897ec3983e292acbb439b088c3

Modified Files
--------------
doc/src/sgml/ref/alter_subscription.sgml  |   5 ++
doc/src/sgml/ref/create_subscription.sgml |  35 ++++++++
src/backend/commands/subscriptioncmds.c   | 133 ++++++++++++++++++++++++++++--
src/test/subscription/t/030_origin.pl     | 114 +++++++++++++++++++------
4 files changed, 258 insertions(+), 29 deletions(-)



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pgsql: Raise a warning if there is a possibility of data from multiple
  2022-09-08 01:39 pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <akapila@postgresql.org>
@ 2022-09-08 06:52 ` Masahiko Sawada <sawada.mshk@gmail.com>
  2022-09-08 07:22   ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <amit.kapila16@gmail.com>
  2022-09-08 07:59   ` Re: pgsql: Raise a warning if there is a possibility of data from multiple vignesh C <vignesh21@gmail.com>
  0 siblings, 2 replies; 9+ messages in thread

From: Masahiko Sawada @ 2022-09-08 06:52 UTC (permalink / raw)
  To: Amit Kapila <akapila@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

On Thu, Sep 8, 2022 at 10:39 AM Amit Kapila <akapila@postgresql.org> wrote:
>
> Raise a warning if there is a possibility of data from multiple origins.
>
> This commit raises a warning message for a combination of options
> ('copy_data = true' and 'origin = none') during CREATE/ALTER subscription
> operations if the publication tables were also replicated from other
> publishers.
>
> During replication, we can skip the data from other origins as we have that
> information in WAL but that is not possible during initial sync so we raise
> a warning if there is such a possibility.
>
> Author: Vignesh C
> Reviewed-By: Peter Smith, Amit Kapila, Jonathan Katz, Shi yu, Wang wei
> Discussion: https://www.postgresql.org/message-id/CALDaNm0gwjY_4HFxvvty01BOT01q_fJLKQ3pWP9=9orqubhjcQ@mail.gmail...
>
> Branch
> ------
> master
>
> Details
> -------
> https://git.postgresql.org/pg/commitdiff/875693019053b8897ec3983e292acbb439b088c3
>
> Modified Files
> --------------
> doc/src/sgml/ref/alter_subscription.sgml  |   5 ++
> doc/src/sgml/ref/create_subscription.sgml |  35 ++++++++
> src/backend/commands/subscriptioncmds.c   | 133 ++++++++++++++++++++++++++++--
> src/test/subscription/t/030_origin.pl     | 114 +++++++++++++++++++------
> 4 files changed, 258 insertions(+), 29 deletions(-)

+       appendStringInfoString(&cmd,
+                                                  "SELECT DISTINCT
P.pubname AS pubname\n"
+                                                  "FROM pg_publication P,\n"
+                                                  "     LATERAL
pg_get_publication_tables(P.pubname) GPT\n"
+                                                  "     JOIN
pg_subscription_rel PS ON (GPT.relid = PS.srrelid),\n"
+                                                  "     pg_class C
JOIN pg_namespace N ON (N.oid = C.relnamespace)\n"
+                                                  "WHERE C.oid =
GPT.relid AND P.pubname IN (");

Should the tables and the function in this query be schema-qualified?
Looking at other code in subscriptioncmd.c, we use schema-qualified
names. It works even without the schema names but it may be better to
make them consistent.

FYI, looking at tablesync.c, there are both styles; it seems that
recently added codes use schema-unqualified names.

Regards,

--
Masahiko Sawada





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pgsql: Raise a warning if there is a possibility of data from multiple
  2022-09-08 01:39 pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <akapila@postgresql.org>
  2022-09-08 06:52 ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
@ 2022-09-08 07:22   ` Amit Kapila <amit.kapila16@gmail.com>
  2022-09-08 09:07     ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
  1 sibling, 1 reply; 9+ messages in thread

From: Amit Kapila @ 2022-09-08 07:22 UTC (permalink / raw)
  To: Masahiko Sawada <sawada.mshk@gmail.com>; +Cc: Amit Kapila <akapila@postgresql.org>; pgsql-committers@lists.postgresql.org

On Thu, Sep 8, 2022 at 12:22 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> On Thu, Sep 8, 2022 at 10:39 AM Amit Kapila <akapila@postgresql.org> wrote:
> >
> > Raise a warning if there is a possibility of data from multiple origins.
> >
> > This commit raises a warning message for a combination of options
> > ('copy_data = true' and 'origin = none') during CREATE/ALTER subscription
> > operations if the publication tables were also replicated from other
> > publishers.
> >
> > During replication, we can skip the data from other origins as we have that
> > information in WAL but that is not possible during initial sync so we raise
> > a warning if there is such a possibility.
> >
> > Author: Vignesh C
> > Reviewed-By: Peter Smith, Amit Kapila, Jonathan Katz, Shi yu, Wang wei
> > Discussion: https://www.postgresql.org/message-id/CALDaNm0gwjY_4HFxvvty01BOT01q_fJLKQ3pWP9=9orqubhjcQ@mail.gmail...
> >
> > Branch
> > ------
> > master
> >
> > Details
> > -------
> > https://git.postgresql.org/pg/commitdiff/875693019053b8897ec3983e292acbb439b088c3
> >
> > Modified Files
> > --------------
> > doc/src/sgml/ref/alter_subscription.sgml  |   5 ++
> > doc/src/sgml/ref/create_subscription.sgml |  35 ++++++++
> > src/backend/commands/subscriptioncmds.c   | 133 ++++++++++++++++++++++++++++--
> > src/test/subscription/t/030_origin.pl     | 114 +++++++++++++++++++------
> > 4 files changed, 258 insertions(+), 29 deletions(-)
>
> +       appendStringInfoString(&cmd,
> +                                                  "SELECT DISTINCT
> P.pubname AS pubname\n"
> +                                                  "FROM pg_publication P,\n"
> +                                                  "     LATERAL
> pg_get_publication_tables(P.pubname) GPT\n"
> +                                                  "     JOIN
> pg_subscription_rel PS ON (GPT.relid = PS.srrelid),\n"
> +                                                  "     pg_class C
> JOIN pg_namespace N ON (N.oid = C.relnamespace)\n"
> +                                                  "WHERE C.oid =
> GPT.relid AND P.pubname IN (");
>
> Should the tables and the function in this query be schema-qualified?
> Looking at other code in subscriptioncmd.c, we use schema-qualified
> names. It works even without the schema names but it may be better to
> make them consistent.
>
> FYI, looking at tablesync.c, there are both styles; it seems that
> recently added codes use schema-unqualified names.
>

Yeah, it is better to be consistent in all places and add a schema
name before accessing an object rather than for one or two places. Do
we need similar handling for pg_dump code as well, see
getPublications()?

-- 
With Regards,
Amit Kapila.





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pgsql: Raise a warning if there is a possibility of data from multiple
  2022-09-08 01:39 pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <akapila@postgresql.org>
  2022-09-08 06:52 ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
  2022-09-08 07:22   ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <amit.kapila16@gmail.com>
@ 2022-09-08 09:07     ` Masahiko Sawada <sawada.mshk@gmail.com>
  2022-09-08 09:21       ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <amit.kapila16@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Masahiko Sawada @ 2022-09-08 09:07 UTC (permalink / raw)
  To: Amit Kapila <amit.kapila16@gmail.com>; +Cc: Amit Kapila <akapila@postgresql.org>; pgsql-committers@lists.postgresql.org

On Thu, Sep 8, 2022 at 4:23 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Thu, Sep 8, 2022 at 12:22 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> >
> > On Thu, Sep 8, 2022 at 10:39 AM Amit Kapila <akapila@postgresql.org> wrote:
> > >
> > > Raise a warning if there is a possibility of data from multiple origins.
> > >
> > > This commit raises a warning message for a combination of options
> > > ('copy_data = true' and 'origin = none') during CREATE/ALTER subscription
> > > operations if the publication tables were also replicated from other
> > > publishers.
> > >
> > > During replication, we can skip the data from other origins as we have that
> > > information in WAL but that is not possible during initial sync so we raise
> > > a warning if there is such a possibility.
> > >
> > > Author: Vignesh C
> > > Reviewed-By: Peter Smith, Amit Kapila, Jonathan Katz, Shi yu, Wang wei
> > > Discussion: https://www.postgresql.org/message-id/CALDaNm0gwjY_4HFxvvty01BOT01q_fJLKQ3pWP9=9orqubhjcQ@mail.gmail...
> > >
> > > Branch
> > > ------
> > > master
> > >
> > > Details
> > > -------
> > > https://git.postgresql.org/pg/commitdiff/875693019053b8897ec3983e292acbb439b088c3
> > >
> > > Modified Files
> > > --------------
> > > doc/src/sgml/ref/alter_subscription.sgml  |   5 ++
> > > doc/src/sgml/ref/create_subscription.sgml |  35 ++++++++
> > > src/backend/commands/subscriptioncmds.c   | 133 ++++++++++++++++++++++++++++--
> > > src/test/subscription/t/030_origin.pl     | 114 +++++++++++++++++++------
> > > 4 files changed, 258 insertions(+), 29 deletions(-)
> >
> > +       appendStringInfoString(&cmd,
> > +                                                  "SELECT DISTINCT
> > P.pubname AS pubname\n"
> > +                                                  "FROM pg_publication P,\n"
> > +                                                  "     LATERAL
> > pg_get_publication_tables(P.pubname) GPT\n"
> > +                                                  "     JOIN
> > pg_subscription_rel PS ON (GPT.relid = PS.srrelid),\n"
> > +                                                  "     pg_class C
> > JOIN pg_namespace N ON (N.oid = C.relnamespace)\n"
> > +                                                  "WHERE C.oid =
> > GPT.relid AND P.pubname IN (");
> >
> > Should the tables and the function in this query be schema-qualified?
> > Looking at other code in subscriptioncmd.c, we use schema-qualified
> > names. It works even without the schema names but it may be better to
> > make them consistent.
> >
> > FYI, looking at tablesync.c, there are both styles; it seems that
> > recently added codes use schema-unqualified names.
> >
>
> Yeah, it is better to be consistent in all places and add a schema
> name before accessing an object rather than for one or two places. Do
> we need similar handling for pg_dump code as well, see
> getPublications()?

We can fix at least getPublications() and getSubscriptions() as well.
I'll make a patch for that. Or do you want to fix all of them,
including non-logical-replication-related ones?

Regards,

-- 
Masahiko Sawada





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pgsql: Raise a warning if there is a possibility of data from multiple
  2022-09-08 01:39 pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <akapila@postgresql.org>
  2022-09-08 06:52 ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
  2022-09-08 07:22   ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <amit.kapila16@gmail.com>
  2022-09-08 09:07     ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
@ 2022-09-08 09:21       ` Amit Kapila <amit.kapila16@gmail.com>
  2022-09-08 13:58         ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 9+ messages in thread

From: Amit Kapila @ 2022-09-08 09:21 UTC (permalink / raw)
  To: Masahiko Sawada <sawada.mshk@gmail.com>; +Cc: Amit Kapila <akapila@postgresql.org>; pgsql-committers@lists.postgresql.org

On Thu, Sep 8, 2022 at 2:38 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> On Thu, Sep 8, 2022 at 4:23 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
> > On Thu, Sep 8, 2022 at 12:22 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> > >
> > >
> > > Should the tables and the function in this query be schema-qualified?
> > > Looking at other code in subscriptioncmd.c, we use schema-qualified
> > > names. It works even without the schema names but it may be better to
> > > make them consistent.
> > >
> > > FYI, looking at tablesync.c, there are both styles; it seems that
> > > recently added codes use schema-unqualified names.
> > >
> >
> > Yeah, it is better to be consistent in all places and add a schema
> > name before accessing an object rather than for one or two places. Do
> > we need similar handling for pg_dump code as well, see
> > getPublications()?
>
> We can fix at least getPublications() and getSubscriptions() as well.
> I'll make a patch for that.

Thanks.

> Or do you want to fix all of them,
> including non-logical-replication-related ones?
>

I feel it is better to be consistent across the entire code base
unless there is a reason for doing it differently. Does anyone else
have any thoughts on this matter?


-- 
With Regards,
Amit Kapila.





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pgsql: Raise a warning if there is a possibility of data from multiple
  2022-09-08 01:39 pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <akapila@postgresql.org>
  2022-09-08 06:52 ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
  2022-09-08 07:22   ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <amit.kapila16@gmail.com>
  2022-09-08 09:07     ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
  2022-09-08 09:21       ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <amit.kapila16@gmail.com>
@ 2022-09-08 13:58         ` Tom Lane <tgl@sss.pgh.pa.us>
  2022-09-09 01:03           ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <amit.kapila16@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Tom Lane @ 2022-09-08 13:58 UTC (permalink / raw)
  To: Amit Kapila <amit.kapila16@gmail.com>; +Cc: Masahiko Sawada <sawada.mshk@gmail.com>; Amit Kapila <akapila@postgresql.org>; pgsql-committers@lists.postgresql.org

Amit Kapila <amit.kapila16@gmail.com> writes:
> I feel it is better to be consistent across the entire code base
> unless there is a reason for doing it differently. Does anyone else
> have any thoughts on this matter?

That sounds like it would be a pretty massive and unnecessary patch.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pgsql: Raise a warning if there is a possibility of data from multiple
  2022-09-08 01:39 pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <akapila@postgresql.org>
  2022-09-08 06:52 ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
  2022-09-08 07:22   ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <amit.kapila16@gmail.com>
  2022-09-08 09:07     ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
  2022-09-08 09:21       ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <amit.kapila16@gmail.com>
  2022-09-08 13:58         ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-09-09 01:03           ` Amit Kapila <amit.kapila16@gmail.com>
  2022-09-09 02:34             ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 9+ messages in thread

From: Amit Kapila @ 2022-09-09 01:03 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Masahiko Sawada <sawada.mshk@gmail.com>; Amit Kapila <akapila@postgresql.org>; pgsql-committers@lists.postgresql.org

On Thu, Sep 8, 2022 at 7:28 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Amit Kapila <amit.kapila16@gmail.com> writes:
> > I feel it is better to be consistent across the entire code base
> > unless there is a reason for doing it differently. Does anyone else
> > have any thoughts on this matter?
>
> That sounds like it would be a pretty massive and unnecessary patch.
>

Fair enough. Do you mind being consistent in this regard for logical
replication-related code? BTW, is there a reason we prefer to write in
one or another way (with or without appending schema_name)?

-- 
With Regards,
Amit Kapila.





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pgsql: Raise a warning if there is a possibility of data from multiple
  2022-09-08 01:39 pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <akapila@postgresql.org>
  2022-09-08 06:52 ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
  2022-09-08 07:22   ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <amit.kapila16@gmail.com>
  2022-09-08 09:07     ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
  2022-09-08 09:21       ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <amit.kapila16@gmail.com>
  2022-09-08 13:58         ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Tom Lane <tgl@sss.pgh.pa.us>
  2022-09-09 01:03           ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <amit.kapila16@gmail.com>
@ 2022-09-09 02:34             ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 9+ messages in thread

From: Tom Lane @ 2022-09-09 02:34 UTC (permalink / raw)
  To: Amit Kapila <amit.kapila16@gmail.com>; +Cc: Masahiko Sawada <sawada.mshk@gmail.com>; Amit Kapila <akapila@postgresql.org>; pgsql-committers@lists.postgresql.org

Amit Kapila <amit.kapila16@gmail.com> writes:
> Fair enough. Do you mind being consistent in this regard for logical
> replication-related code?

As long as not too many individual changes are involved, sure.
But consistency of this sort doesn't seem worth creating a lot
of back-patching land mines, IMO.

> BTW, is there a reason we prefer to write in
> one or another way (with or without appending schema_name)?

In places where we can trust the search_path to be just pg_catalog,
there's no real strong reason to write a schema name, I think.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pgsql: Raise a warning if there is a possibility of data from multiple
  2022-09-08 01:39 pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <akapila@postgresql.org>
  2022-09-08 06:52 ` Re: pgsql: Raise a warning if there is a possibility of data from multiple Masahiko Sawada <sawada.mshk@gmail.com>
@ 2022-09-08 07:59   ` vignesh C <vignesh21@gmail.com>
  1 sibling, 0 replies; 9+ messages in thread

From: vignesh C @ 2022-09-08 07:59 UTC (permalink / raw)
  To: Masahiko Sawada <sawada.mshk@gmail.com>; +Cc: Amit Kapila <akapila@postgresql.org>; pgsql-committers@lists.postgresql.org

On Thu, 8 Sept 2022 at 12:22, Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> On Thu, Sep 8, 2022 at 10:39 AM Amit Kapila <akapila@postgresql.org> wrote:
> >
> > Raise a warning if there is a possibility of data from multiple origins.
> >
> > This commit raises a warning message for a combination of options
> > ('copy_data = true' and 'origin = none') during CREATE/ALTER subscription
> > operations if the publication tables were also replicated from other
> > publishers.
> >
> > During replication, we can skip the data from other origins as we have that
> > information in WAL but that is not possible during initial sync so we raise
> > a warning if there is such a possibility.
> >
> > Author: Vignesh C
> > Reviewed-By: Peter Smith, Amit Kapila, Jonathan Katz, Shi yu, Wang wei
> > Discussion: https://www.postgresql.org/message-id/CALDaNm0gwjY_4HFxvvty01BOT01q_fJLKQ3pWP9=9orqubhjcQ@mail.gmail...
> >
> > Branch
> > ------
> > master
> >
> > Details
> > -------
> > https://git.postgresql.org/pg/commitdiff/875693019053b8897ec3983e292acbb439b088c3
> >
> > Modified Files
> > --------------
> > doc/src/sgml/ref/alter_subscription.sgml  |   5 ++
> > doc/src/sgml/ref/create_subscription.sgml |  35 ++++++++
> > src/backend/commands/subscriptioncmds.c   | 133 ++++++++++++++++++++++++++++--
> > src/test/subscription/t/030_origin.pl     | 114 +++++++++++++++++++------
> > 4 files changed, 258 insertions(+), 29 deletions(-)
>
> +       appendStringInfoString(&cmd,
> +                                                  "SELECT DISTINCT
> P.pubname AS pubname\n"
> +                                                  "FROM pg_publication P,\n"
> +                                                  "     LATERAL
> pg_get_publication_tables(P.pubname) GPT\n"
> +                                                  "     JOIN
> pg_subscription_rel PS ON (GPT.relid = PS.srrelid),\n"
> +                                                  "     pg_class C
> JOIN pg_namespace N ON (N.oid = C.relnamespace)\n"
> +                                                  "WHERE C.oid =
> GPT.relid AND P.pubname IN (");
>
> Should the tables and the function in this query be schema-qualified?
> Looking at other code in subscriptioncmd.c, we use schema-qualified
> names. It works even without the schema names but it may be better to
> make them consistent.
>
> FYI, looking at tablesync.c, there are both styles; it seems that
> recently added codes use schema-unqualified names.

There will be no issues as such because we set search_path to
always-secure search path while creating connection
(libpqrcv_connect-> libpqrcv_PQexec(conn->streamConn,
ALWAYS_SECURE_SEARCH_PATH_SQL). But I agree it will be better to keep
it consistent across all places.

Regards,
Vignesh





^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2022-09-09 02:34 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-09-08 01:39 pgsql: Raise a warning if there is a possibility of data from multiple Amit Kapila <akapila@postgresql.org>
2022-09-08 06:52 ` Masahiko Sawada <sawada.mshk@gmail.com>
2022-09-08 07:22   ` Amit Kapila <amit.kapila16@gmail.com>
2022-09-08 09:07     ` Masahiko Sawada <sawada.mshk@gmail.com>
2022-09-08 09:21       ` Amit Kapila <amit.kapila16@gmail.com>
2022-09-08 13:58         ` Tom Lane <tgl@sss.pgh.pa.us>
2022-09-09 01:03           ` Amit Kapila <amit.kapila16@gmail.com>
2022-09-09 02:34             ` Tom Lane <tgl@sss.pgh.pa.us>
2022-09-08 07:59   ` vignesh C <vignesh21@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox