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


Reply via email to