Re: Include schema-qualified names in publication error messages.

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Euler Taveira <euler(at)eulerto(dot)com>, "shveta(dot)malik(at)gmail(dot)com" <shveta(dot)malik(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, shveta malik <shvetamalik(at)gmail(dot)com>
Subject: Re: Include schema-qualified names in publication error messages.
Date: 2026-05-11 07:47:59
Message-ID: CAHut+Put4UiDwqKkPVOL-EvSQf7vwiM-zU2Oep4-M3Wchy_ovQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I was looking at the code that got pushed [1] for this thread, and I
think there is some quirky quote behaviour:

* The code ends up calling 'quote_qualified_identifier'. That function
does "quoting each component if necessary" (the function name is a
hint!).

* Meanwhile, the error message where the result is substituted already
has hardwired quotes:
errormsg = gettext_noop("cannot specify relation \"%s\" in the
publication EXCEPT clause");

So, nested quoting might occur in the error message.

e.g.
------
test_pub=# CREATE UNLOGGED TABLE "my table"(c int);
CREATE TABLE
test_pub=# CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT (TABLE "my table");
ERROR: cannot specify relation "public."my table"" in the publication
EXCEPT clause
DETAIL: This operation is not supported for unlogged tables.
------

Is that quote nesting OK?

I didn't see this behaviour discussed or tested anywhere, so I cannot
tell whether this was considered already or not.

======
[1] https://github.com/postgres/postgres/commit/a49b9cfd72d89a8fd68c90e84c38aa7e2ada756b

Kind Regards,
Peter Smith.
Fujitsu Australia

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-05-11 08:06:45 Re: Refactor code around GUC default_toast_compression
Previous Message SATYANARAYANA NARLAPURAM 2026-05-11 07:35:06 Re: SUBSCRIPTION SERVER ALTER/DROP operations stuck when user mapping is dropped