From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Wooten <kdubb@me.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: pg_type name quotability
Date: Wed, 02 Dec 2015 10:11:04 -0500
Message-ID: <15966.1449069064@sss.pgh.pa.us> (raw)
In-Reply-To: <0B141016-7180-46E4-9FCB-31ADB231DCF5@me.com>
References: <0B141016-7180-46E4-9FCB-31ADB231DCF5@me.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
Kevin Wooten <kdubb@me.com> writes:
> Does anybody know if the name of a type/table in these system tables is guaranteed to be in a quotable format? Ran into a specific instance where the table name needs to be quoted by the driver (e.g. “user”) but want to make sure it’s always valid to quote the name from pg_type.
AFAIK, locutions like quote_ident(pg_type.typname) should always
work, keeping in mind the possible need to schema-qualify as well.
This will often not give you what you might think is the most common
name for the type, but it will parse correctly.
regards, tom lane
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
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-jdbc@postgresql.org
Cc: tgl@sss.pgh.pa.us, kdubb@me.com
Subject: Re: pg_type name quotability
In-Reply-To: <15966.1449069064@sss.pgh.pa.us>
References: <0B141016-7180-46E4-9FCB-31ADB231DCF5@me.com> <15966.1449069064@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