pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_type name quotability
3+ messages / 3 participants
[nested] [flat]
* pg_type name quotability
@ 2015-12-02 10:21 Kevin Wooten <kdubb@me.com>
0 siblings, 2 replies; 3+ messages in thread
From: Kevin Wooten @ 2015-12-02 10:21 UTC (permalink / raw)
To: pgsql-jdbc
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.
Thanks!
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pg_type name quotability
@ 2015-12-02 13:37 Dave Cramer <pg@fastcrypt.com>
parent: Kevin Wooten <kdubb@me.com>
1 sibling, 0 replies; 3+ messages in thread
From: Dave Cramer @ 2015-12-02 13:37 UTC (permalink / raw)
To: Kevin Wooten <kdubb@me.com>; +Cc: pgsql-jdbc
Hi Kevin,
No, but let me know when you figure it out!
Quoting identifiers in postgres has always been problematic. PgAdmin takes
the position that everything gets quoted, regardless which has it's own
issues
Dave Cramer
davec@postgresintl.com
www.postgresintl.com
On 2 December 2015 at 05:21, Kevin Wooten <kdubb@me.com> wrote:
> 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.
>
> Thanks!
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pg_type name quotability
@ 2015-12-02 15:11 Tom Lane <tgl@sss.pgh.pa.us>
parent: Kevin Wooten <kdubb@me.com>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2015-12-02 15:11 UTC (permalink / raw)
To: Kevin Wooten <kdubb@me.com>; +Cc: pgsql-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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2015-12-02 15:11 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-12-02 10:21 pg_type name quotability Kevin Wooten <kdubb@me.com>
2015-12-02 13:37 ` Dave Cramer <pg@fastcrypt.com>
2015-12-02 15:11 ` Tom Lane <tgl@sss.pgh.pa.us>
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