Skip site navigation (1) Skip section navigation (2)

Manipulating a dataset on the client side

From: Havasvölgyi Ottó <h(dot)otto(at)freemail(dot)hu>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Manipulating a dataset on the client side
Date: 2005-02-25 15:09:40
Message-ID: 022901c51b4c$07aa6880$ba00a8c0@otto (view raw or flat)
Thread:
Lists: pgsql-general
Hi,

Situation:
The client program queries a dataset from the PG server, and it displays it, say, in a table. The user can navigate and update fields, insert new records, delete records. And any change should be visible on all clients.
I think I have basically 2 choices:
 1 : using SELECT and download the whole dataset with pg_exec()
 2 : using cursors (pg_exec(..,'DECLARE ... '))

In the 1st case after each update,insert delete of the user I should run the query again to see the changes on this client ? This can be slow if the table is large.

The behaviour of the 2nd case is not so trivial for me. I know that this will be faster for large tables, but I don't know if the change I perform will be visible for this user after a simple refetch without opening another cursor. DECLARE and CLOSE should be enclosed in a transaction, and with SAVEPOINTs I think I can commit the user's operations before closing the cursor.

Please help,

Otto

pgsql-general by date

Next:From: Joe MaldonadoDate: 2005-02-25 15:15:12
Subject: Re: view/pgpgsql functions bug
Previous:From: Sean DavisDate: 2005-02-25 14:53:09
Subject: Re: postgresql 8.0 advantages

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group