Inserting result of query into ORDERED temporary table

From: "Joseph N(dot) Hall" <" <heard_it_on_the_internet> "(at)5sigma(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Inserting result of query into ORDERED temporary table
Date: 2001-01-23 16:20:16
Message-ID: 3A6DAF40.BF4D00B4@5sigma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Something that I can do in mysql is (please excuse the Java):

(connection.createStatement()).executeUpdate(
"create temporary table tmp1_" + localUniqueId + " " +
"(_index int not null auto_increment primary key) " +
queryString
);

Basically I'm creating a temporary table from the query contained
in queryString, "annotated" by an additional column called _index
that runs from 1 to the number of rows in the result.

I can also do this in a different way with Oracle.

I need this capability, or something like it, in order to
give client software the ability to scroll visually through large
result sets without having to send the entire result set across
the network (and potentially running the Java client out of
memory). Once I have this temporary table I can translate
scrolling into requests for individual rows or row ranges, which
works very nicely especially when combined with a little client
side caching.

Is there a way to do this in Postgresql -- without the need to
at least partially parse the SQL in queryString?

-joseph

Joseph N. Hall / Author, Effective Perl Programming

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-01-23 16:30:44 Re: Outer Joins
Previous Message Bruce Momjian 2001-01-23 16:17:26 Re: Re: OID/XID allocation (was Re: is PG able to handle a >500 GB Da tabase?)