Re: java.sql.DatabaseMetaData.getProcedures and overloaded functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thor Michael Støre <thormichael(at)gmail(dot)com>
Cc: Kris Jurka <books(at)ejurka(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: java.sql.DatabaseMetaData.getProcedures and overloaded functions
Date: 2010-12-31 16:09:21
Message-ID: 1338.1293811761@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Thor Michael =?ISO-8859-1?Q?St=F8re?= <thormichael(at)gmail(dot)com> writes:
> On Thu, 2010-12-30 at 22:24 -0500, Kris Jurka wrote:
>> Hmm, the JDBC4 spec has added an additional column to the getProcedures
>> return value called SPECIFIC_NAME which might be for differentiating
>> between overloaded functions.

> 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.

regards, tom lane

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thor Michael Støre 2011-01-02 20:47:07 Re: java.sql.DatabaseMetaData.getProcedures and overloaded functions
Previous Message Thomas Kellerer 2010-12-31 15:04:20 Re: java.sql.DatabaseMetaData.getProcedures and overloaded functions