From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Michael Xu <online.mxu@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Postgres query doesn't accept double quote around schema name in query statement
Date: Thu, 27 Apr 2023 21:27:30 -0700
Message-ID: <fd93d2b8-8822-cc18-4020-7a29d681366f@aklaver.com> (raw)
In-Reply-To: <CALsrRkQxLs=yQaNQqaZpcw35qRZ_Gi-7zWB89dX9ohJarHamyw@mail.gmail.com>
References: <CALsrRkST7=e4T5VtovA3NWBLxueUxvJqQnSPRbCSrJAWXYuxgA@mail.gmail.com>
<a8acca6d-3e8d-afa8-0093-e8092ce840d0@aklaver.com>
<CALsrRkQxLs=yQaNQqaZpcw35qRZ_Gi-7zWB89dX9ohJarHamyw@mail.gmail.com>
On 4/27/23 17:58, Michael Xu wrote:
Please reply to list also.
Ccing list.
> 1) Are you sure whatever client you are using is not doing
> "ads.MyTableName"?
>
> Confirm, it is not ads.MyTableName.
1) What client(and it's version) are you using?
2) What I asked was whether the schema and table name where being quoted
together as "ads.MyTableName"?
Check the Postgres log to see what is actually hitting the database.
3) What is the database encoding?
>
> We also ran the query in pgadmin against similar tables but under
> default public schema, got the same error.
> (*MyTableName* is a table name)
>
> select * from "public"."MyTableName", the same error.
> select * from public."MyTableName", works.
>
>
> 2) Not sure if this is a copy and paste thing but the quotes look like
> typographical quotes, not straight quotes.
>
> sorry for the confusion, it is copied/pasted from OneNote which may have
> brought invalid quote, but the quotes used in pgadmin are correct.
>
>
> On Thu, Apr 27, 2023 at 12:46 PM Adrian Klaver
> <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:
>
> On 4/27/23 12:40, Michael Xu wrote:
> > Hi,
> >
> > By default, pgsql accepts double quotes around schema's name in a
> query,
> > e.g. select * from "ads"."MyTableName". In our env, it throws
> > 42P01:relation "ads.MyTableName" does not exist. It is okay if no
> double
> > quote around schema name, select * from ads."MyTableName".
> >
> > Is there settings in pssql server or db level to change it back
> to its
> > default to allow double quotes around schema.
>
> To repeat what I asked on SO:
>
> https://stackoverflow.com/questions/76123696/postgres-double-quote-around-schema-name-cause-42p01rel... <https://stackoverflow.com/questions/76123696/postgres-double-quote-around-schema-name-cause-42p01rel...;
>
> Works here.
>
> 1) Are you sure whatever client you are using is not doing
> "ads.MyTableName"?
>
> 2) Not sure if this is a copy and paste thing but the quotes look like
> typographical quotes, not straight quotes.
>
>
> >
> > We're using PostgreSQL 13.7 on x86_64-pc-linux-gnu, compiled by gcc
> > (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10), 64-bit
> >
> >
> > Thanks!
> >
> >
> > Michael
> >
> >
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, online.mxu@gmail.com
Subject: Re: Postgres query doesn't accept double quote around schema name in query statement
In-Reply-To: <fd93d2b8-8822-cc18-4020-7a29d681366f@aklaver.com>
References: <CALsrRkST7=e4T5VtovA3NWBLxueUxvJqQnSPRbCSrJAWXYuxgA@mail.gmail.com> <a8acca6d-3e8d-afa8-0093-e8092ce840d0@aklaver.com> <CALsrRkQxLs=yQaNQqaZpcw35qRZ_Gi-7zWB89dX9ohJarHamyw@mail.gmail.com> <fd93d2b8-8822-cc18-4020-7a29d681366f@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox