pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thor Michael Støre <thormichael@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: java.sql.DatabaseMetaData.getProcedures and overloaded functions
Date: Sun, 02 Jan 2011 21:47:07 +0100
Message-ID: <1294001227.4756.306.camel@localhost> (raw)
In-Reply-To: <1338.1293811761@sss.pgh.pa.us>
References: <1293738434.11427.34.camel@localhost>
	<alpine.BSO.2.00.1012302219220.2548@leary.csoft.net>
	<1293806627.4629.42.camel@localhost>
	<1338.1293811761@sss.pgh.pa.us>

On Fri, 2010-12-31 at 11:09 -0500, Tom Lane wrote:
> Thor Michael =?ISO-8859-1?Q?St=F8re?= <thormichael@gmail.com> writes:
> > Right, it says it should "uniquely" identify the function within the
> > schema, which as far as I can tell means that for overloaded functions
> > it would have to list up the input argument types. (Or at least the
> > other only unique way to identify a function I can think of is the OID,
> > which I can't believe one would want there.)
> 
> I'll bet a nickel that the expectation is for this to be pulled from
> information_schema.routines.specific_name, which is defined thusly in
> Postgres:
> 
> 	CAST(p.proname || '_' || CAST(p.oid AS text) AS sql_identifier)
> 	... FROM pg_proc p
> 
> As best I can tell from the SQL spec, the <specific name> of a function
> is implementation-dependent, so this is a compliant way of doing it.

Aah, wasn't aware of that, that makes sense.

Also, I see SPECIFIC_NAME was added to JDBC 4, so I imagine that to
correctly add it one would override getProcedures and
getProcedureColumns in
org.postgresql.jdbc4.AbstractJdbc4DatabaseMetaData and have them return
the additional column(s). I took a look at the code and it seem straight
forward enough for getProcedures, but getProcedureColumns has six other
new columns as well and seems a bit hairier so I'm not sure if should
throw myself over adding this.

Thanks either way to everyone, I quite understand the state of things
now.

- thormick





view thread (8+ messages)  latest in thread

Message-ID: <1294001227.4756.306.camel@localhost>
Permalink:  ../1294001227.4756.306.camel@localhost/
Also on:    postgresql.org/message-id/1294001227.4756.306.camel@localhost

 · 

reply

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: thormichael@gmail.com, tgl@sss.pgh.pa.us, books@ejurka.com
  Subject: Re: java.sql.DatabaseMetaData.getProcedures and overloaded functions
  In-Reply-To: <1294001227.4756.306.camel@localhost>
  References: <1293738434.11427.34.camel@localhost> <alpine.BSO.2.00.1012302219220.2548@leary.csoft.net> <1293806627.4629.42.camel@localhost> <1338.1293811761@sss.pgh.pa.us> <1294001227.4756.306.camel@localhost>

* 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