Re: Consecutive queries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Consecutive queries
Дата
Msg-id 20891.1049672504@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Consecutive queries  ("Raymond O'Donnell" <rod@iol.ie>)
Ответы Re: Consecutive queries
Список pgsql-general
"Raymond O'Donnell" <rod@iol.ie> writes:
> 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.

This behavior is, quite simply, not possible.  Unless perhaps you are
issuing the two queries across different connections, so that the second
one actually starts to execute before the first one is done.  If you
are (mis)using a client library that implements pooling of connections,
I can see how such a mistake might happen.  But we're not going to be
able to help you if you don't show us your code.

            regards, tom lane


В списке pgsql-general по дате отправления:

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: Consecutive queries
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: unable to dump database, toast errors