Re: SHOW TABLES - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: SHOW TABLES
Date
Msg-id 4C4488770200002500033912@gw.wicourts.gov
Whole thread Raw
In response to Re: SHOW TABLES  (David Fetter <david@fetter.org>)
List pgsql-hackers
David Fetter <david@fetter.org> wrote:
> Would something like this do?  Thanks to Andrew Gierth for helping
> me figure out how to get this working :)
> 
> CREATE OR REPLACE FUNCTION multi_result()
> RETURNS SETOF REFCURSOR
With appropriate tweaks to JDBC and the other drivers, this would
cover a lot of ground.  You might be able to cover the last little
bit by returning a SETOF some record with (at least) three columns,
one of which would be filled in each row: REFCURSOR (for a result
set), INTEGER (for a row count), and something which could carry an
object which would map to a SQLWarning (which can be used with
SQLSTATE '00000' to deliver informational text or '01xxx' for actual
warnings).  A JDBC execute request (as opposed to executeUpdate or
executeQuery) may get back any combination of the above in an
ordered fashion.  Essentially, this meta result set would need to be
hidden within the Statement object.
http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/sql/Statement.html#execute%28java.lang.String%29
http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/sql/Statement.html#getWarnings%28%29
-Kevin


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: standard_conforming_strings
Next
From: Hitoshi Harada
Date:
Subject: Re: Parsing of aggregate ORDER BY clauses