Standard Solutions with Perl DBI::Pg for results tables

Started by Matalmost 23 years ago2 messagesgeneral
Jump to latest
#1Mat
psql-mail@freeuk.com

I have users doing searches via a web front end.

No authentication is required.

I would like the result of the last search of each user to be stored in
a temporary table to allow for re-ordering, searching within results,
and stepping through results 10 (n) at a time using offset and limit.

Currently I am preforming the search again for each of these - pretty
annoying when it might take 10 minutes to return the results to begin
with!

Is there a standard way of doing this?
I'd thought perhaps session id's and cookies?

Can i specify a lifespan for a temporary table?

Thanks!

Matt

#2Dennis Gearon
gearond@cvc.net
In reply to: Mat (#1)
Re: Standard Solutions with Perl DBI::Pg for results tables

1/ 10 each per page seems small, but maybe not if your retrieved row is large.

2/ cookies can be used to store AUTHENTICATION OF A USER, but since you are not doing that, cookies probably are not what you want.

3/ Form values originally used to search with can be used, and returned using:
A/ Javascript filling in POST values and submitting, when a button is pressed
B/ GET values on a URL on a button.
C/ GET values on a URL on a text anchor

4/ to do 3 above, you will need either:
A/ A cursor search in your original and second search.
B/ A simulated cursor using the files system stored result set,
in the manner of PHP library 'ADODB'. Perhaps
Perl has such a library.

It comes down to two parts:

A/ returning the same search criteria with a page begin and page size value
in a form.
B/ using native or simulated cursors to access the search

Mr Mat psql-mail wrote:

Show quoted text

I have users doing searches via a web front end.

No authentication is required.

I would like the result of the last search of each user to be stored in
a temporary table to allow for re-ordering, searching within results,
and stepping through results 10 (n) at a time using offset and limit.

Currently I am preforming the search again for each of these - pretty
annoying when it might take 10 minutes to return the results to begin
with!

Is there a standard way of doing this?
I'd thought perhaps session id's and cookies?

Can i specify a lifespan for a temporary table?

Thanks!

Matt

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster