Re: Postgres query doesn't accept double quote around schema name in query statement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Xu <online(dot)mxu(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Postgres query doesn't accept double quote around schema name in query statement
Date: 2023-04-27 19:45:15
Message-ID: 1205676.1682624715@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Xu <online(dot)mxu(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2023-04-27 19:46:35 Re: Postgres query doesn't accept double quote around schema name in query statement
Previous Message Christophe Pettus 2023-04-27 19:44:56 Re: Postgres query doesn't accept double quote around schema name in query statement