Re: Distinguish publication exclusions in object addresses

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Manuel Reyes Bravo <manuelreyesbravo(at)gmail(dot)com>
Subject: Re: Distinguish publication exclusions in object addresses
Date: 2026-09-18 04:26:36
Message-ID: CAA4eK1J3NwiEJY1diZ806K4frosnNQp4mK1pqEgSQ-=TYfkHRQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 18, 2026 at 9:48 AM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> On Fri, Sep 18, 2026 at 8:20 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
> >
> > AFAICT, the patch has traded one kind of quoting problem for another.
> >
> > Before patch v3, the message might show nested quotes.
> >
> > After patch v3, the message might show mismatched quotes:
> > CREATE PUBLICATION testpub9 FOR ALL TABLES EXCEPT (TABLE "schema has
> > embedded "" quotes"."part has embedded "" quotes");
> > ERROR: cannot specify relation "schema has embedded " quotes.part has
> > embedded " quotes" in the publication EXCEPT clause
> >
> > ~
> >
> > PSA a v3 top-up patch to address the new problem.
> >
> > Of course, putting my escape_embedded_quotes() function where I did in
> > the top-up doesn't seem appropriate. It would be better to associate
> > that with the original RelationGetQualifiedRelationName() and call it
> > from there, but RelationGetQualifiedRelationName was removed, so...
> >
>
> At first, I felt it was a problem in the entire code for base Postgres
> and thus could be fixed separately. I tried to find queries on HEAD
> where it already works and where it does not. Here are a few samples:
>
> Problematic cases on HEAD:
> 1)
> postgres=# SELECT '"schema has embedded "" quotes".nonexistent_table'::regclass;
> ERROR: relation "schema has embedded " quotes.nonexistent_table" does not exist
> LINE 1: SELECT '"schema has embedded "" quotes".nonexistent_table'::...
> ^
> 2)
> postgres=# DROP TABLE "my""table";
> ERROR: table "my"table" does not exist
>
>
> The case where it is correctly quoted:
>
> 1)
> postgres=# CREATE MATERIALIZED VIEW "schema has embedded ""
> quotes"."my_mv" AS SELECT 1 AS id;
> SELECT 1
>
> postgres=# REFRESH MATERIALIZED VIEW CONCURRENTLY "schema has embedded
> "" quotes"."my_mv";
> ERROR: cannot refresh materialized view ""schema has embedded ""
> quotes".my_mv" concurrently
> HINT: Create a unique index with no WHERE clause on one or more
> columns of the materialized view.
>
> 2)
> postgres=# SELECT '"schema has embedded ""
> quotes".nonexistent_func(int)'::regprocedure;
> ERROR: function ""schema has embedded ""
> quotes".nonexistent_func(int)" does not exist
> LINE 1: SELECT '"schema has embedded "" quotes".nonexistent_func(int...
>
> So, I don't have a strong opinion on whether we should fix it here or
> separately. Fixing it here would be slightly better though.
>

At first, I am not sure if this is a problem at all because we don't
use embedded quoting while storing objects and we display like that at
many places. It is better to start a new thread if one really feels
one or or the other way is correct.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Henson Choi 2026-09-18 04:31:21 Re: Row pattern recognition
Previous Message shveta malik 2026-09-18 04:18:26 Re: Distinguish publication exclusions in object addresses