Re: Information about columns - Mailing list pgsql-general

From darioteixeira@yahoo.com
Subject Re: Information about columns
Date
Msg-id 91950.19366.qm@web111515.mail.gq1.yahoo.com
Whole thread Raw
In response to Information about columns  (Dario Teixeira <darioteixeira@yahoo.com>)
Responses Re: Information about columns
List pgsql-general
Hi,

> It's intentional; IIRC, the current behavior is defined that way because
> that's what the JDBC driver needs to implement the JDBC specs.  Putting
> information about composite types where information about tables is
> expected would confuse the heck out of existing client code.

Thanks for the info.  So, given that RowDescription is a dead-end, is there
any other way I can determine the composite type associated with a function
return?  If, for example, I have the following defined in the database,

CREATE TABLE foobar (quant int);
CREATE TYPE foobar_t AS (quant int);
CREATE FUNCTION foobar2 () RETURNS SETOF foobar_t AS
'SELECT * FROM foobar' LANGUAGE sql STABLE;

and the client side issues a "SELECT * FROM foobar2 ()", is there some
means of determining that a function "foobar2" returning "foobar_t" was
invoked?  I don't care how convoluted the steps may be, since all of this
happens at compile-time and has a zero runtime penalty.

Barring client-side parsing of SQL (a dumb idea), the only solution I can
think of requires the client code to explicitly mark the function invoked.
I would rather avoid this solution, however, since it is error prone and
defeats the premise of the library.

Thanks again for your time and attention!
Cheers,
Dario





pgsql-general by date:

Previous
From: Dave Page
Date:
Subject: Re: [BUGS] Integrity check
Next
From: David Fetter
Date:
Subject: Re: [BUGS] Integrity check