Consecutive queries - Mailing list pgsql-general

From Raymond O'Donnell
Subject Consecutive queries
Date
Msg-id 3E909AB8.26119.1678AF9@localhost
Whole thread Raw
Responses Re: Consecutive queries
Re: Consecutive queries
List 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@iol.ie                          Galway Cathedral Recitals
-------------------------------------------------------------


pgsql-general by date:

Previous
From: Lonni Friedman
Date:
Subject: Re: unable to dump database, toast errors
Next
From: Jan Wieck
Date:
Subject: Re: unable to dump database, toast errors