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

From Peter Smith
Subject Re: Added schema level support for publication.
Date
Msg-id CAHut+PsveUwX+0EvU9dDLLnMc-PRcbhAy23eCBbApFLVh+rUzA@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.
List pgsql-hackers
FYI -  I spotted a trivial SQL mistake (?) of the schema publication patch [1].

See the file describe.c, function describeOneTableDetails.
The new SQL has a 3rd UNION that looks like:

...
"UNION\n"
"SELECT pubname\n"
"FROM pg_catalog.pg_publication p\n"
"WHERE puballtables AND pg_catalog.pg_relation_is_publishable('%s')\n"
"ORDER BY 1;",
oid, oid, oid, oid);

Notice that there is a table alias "p" but it is never used. It seems
to me like it is just an accidental omission. I think it should be
written like -

BEFORE:
"WHERE puballtables AND pg_catalog.pg_relation_is_publishable('%s')\n"
AFTER:
"WHERE p.puballtables AND pg_catalog.pg_relation_is_publishable('%s')\n"

Doing this will make it consistent with the SQL of the nearby "else"
case which uses the same alias as expected.

------
[1] https://github.com/postgres/postgres/commit/5a2832465fd8984d089e8c44c094e6900d987fcd

Kind Regards,
Peter Smith.
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Improve error context after some failed XLogReadRecord()
Next
From: Michael Paquier
Date:
Subject: Re: XLogReadRecord() error in XlogReadTwoPhaseData()