On Fri, Sep 18, 2026 at 9:48 AM shveta malik <[email protected]> wrote:
>
> On Fri, Sep 18, 2026 at 8:20 AM Peter Smith <[email protected]> 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.


Reply via email to