From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Xu <online.mxu@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Postgres query doesn't accept double quote around schema name in query statement
Date: Thu, 27 Apr 2023 15:45:15 -0400
Message-ID: <1205676.1682624715@sss.pgh.pa.us> (raw)
In-Reply-To: <CALsrRkST7=e4T5VtovA3NWBLxueUxvJqQnSPRbCSrJAWXYuxgA@mail.gmail.com>
References: <CALsrRkST7=e4T5VtovA3NWBLxueUxvJqQnSPRbCSrJAWXYuxgA@mail.gmail.com>
Michael Xu <online.mxu@gmail.com> writes:
> 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.
Works for me:
regression=# create schema ads;
CREATE SCHEMA
regression=# create table "ads"."MyTableName" (f1 int);
CREATE TABLE
regression=# select * from "ads"."MyTableName";
f1
----
(0 rows)
I'm wondering a bit about invisible white space in your schema
name; but without a self-contained test case we can do no more
than guess.
regards, tom lane
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: tgl@sss.pgh.pa.us, online.mxu@gmail.com
Subject: Re: Postgres query doesn't accept double quote around schema name in query statement
In-Reply-To: <1205676.1682624715@sss.pgh.pa.us>
References: <CALsrRkST7=e4T5VtovA3NWBLxueUxvJqQnSPRbCSrJAWXYuxgA@mail.gmail.com> <1205676.1682624715@sss.pgh.pa.us>
* 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