Re: OID of type by name.

From: tahoe-gary <gbaker(at)salesforce(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: OID of type by name.
Date: 2013-03-29 16:07:41
Message-ID: 1364573261589-5750103.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In what version of PG is the 'my_type'::regtype::oid syntax available? I
want to introduce this to the JDBC driver which currently does the most
ridiculous query that totally ignores search path.

JDBC driver does this currently: SELECT oid FROM pg_catalog.pg_type WHERE
typname = ?

So if you have more than one type of the same name (or perhaps a UDT and a
table with the same name as in my case) it just grabs whichever one first
appears in pg_type regardless of search path.

So I intend to change that query to: SELECT ?::regtype::oid

But I need to know if I should be checking the server version or not. What
is the min version that that query will work on?

--
View this message in context: http://postgresql.1045698.n5.nabble.com/OID-of-type-by-name-tp3297240p5750103.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Quentin Hartman 2013-03-29 16:19:11 Streaming replication slave crash
Previous Message Tom Lane 2013-03-29 15:46:40 Re: Money casting too liberal?