Consecutive queries

From: "Raymond O'Donnell" <rod(at)iol(dot)ie>
To: pgsql-general(at)postgresql(dot)org
Subject: Consecutive queries
Date: 2003-04-06 20:23:04
Message-ID: 3E909AB8.26119.1678AF9@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,

Is there any way to ensure that one query has completed before a
second one is executed? I have to execute an UPDATE and follow it
immediately with a SELECT, but I find that the SELECT is picking up
incorrect data because - I assume - the UPDATE hasn't completed yet.
When I re-run the SELECT a few seconds later I gvet the correct data.

I'm accessing PostgresSQL via ADO on a windows machine, and I tried -

(i) enclosing the two queries in one transaction, as follows:

begin;
update ... (etc)... ;
select ...(etc)...;
commit;

(ii) putting a COMMIT before the SELECT, as follows:

begin;
update ... (etc)... ;
commit;
select ...(etc)...;

Neither produces what I want. Any help will be greatly appreciated!

--Ray.

-------------------------------------------------------------
Raymond O'Donnell http://www.galwaycathedral.org/recitals
rod(at)iol(dot)ie Galway Cathedral Recitals
-------------------------------------------------------------

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2003-04-06 21:50:21 Re: unable to dump database, toast errors
Previous Message Lonni Friedman 2003-04-06 19:58:40 Re: unable to dump database, toast errors