SQL Transaction related

Поиск
Список
Период
Сортировка
От Harpreet Dhaliwal
Тема SQL Transaction related
Дата
Msg-id d86a77ef0705092324h472db668m97fd9fdb774a7f47@mail.gmail.com
обсуждение исходный текст
Ответы Re: SQL Transaction related  ("Uwe C. Schroeder" <uwe@oss4u.com>)
Re: SQL Transaction related  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Список pgsql-general
Hi,

I have a transaction like following:

BEGIN

     INSERT INTO tbl_xyz VALUES (val1, val2);
   
    SELECT INTO wid MAX(val1) FROM tbl_xyz;

END;

My question is in the SELECT INTO statement, will I get the value of val1 from the INSERT INTO in the same transaction
even though the transaction has not ended yet.
I think no.
How would I get that latest value of val1 in the same transaction because its not committed yet as the transaction has not ended.

Thanks,

~Harpreeet

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

Предыдущее
От: Naz Gassiep
Дата:
Сообщение: Re: In theory question
Следующее
От: "Uwe C. Schroeder"
Дата:
Сообщение: Re: SQL Transaction related