| From: | vignesh C <vignesh21(at)gmail(dot)com> |
|---|---|
| To: | Peter Smith <smithpb2250(at)gmail(dot)com> |
| Cc: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Euler Taveira <euler(at)eulerto(dot)com>, "shveta(dot)malik(at)gmail(dot)com" <shveta(dot)malik(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 11:04:39 |
| Message-ID: | CALDaNm17Vh8OccJDD97=88R5fSyo-BtJ4aKkfMtkGSDGsYDWEA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, 11 May 2026 at 13:18, Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> 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 think this is acceptable, since we already emit similar quoting in
other error messages involving schema qualified identifiers.
For example:
CREATE MATERIALIZED VIEW "my matv1" as select sum(c1) from t1;
REFRESH MATERIALIZED VIEW concurrently "my matv1";
produces:
ERROR: cannot refresh materialized view "public."my matv1"" concurrently
HINT: Create a unique index with no WHERE clause on one or more
columns of the materialized view.
So the current behavior appears to be consistent with existing
PostgreSQL error reporting.
Regards,
Vignesh
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tomas Vondra | 2026-05-11 11:44:13 | Re: Parallel INSERT SELECT take 2 |
| Previous Message | solaimurugan vellaipandiyan | 2026-05-11 11:04:20 | Re: Review - Patch for pg_bsd_indent: improve formatting of multiline comments |