SQL Transaction related

From: "Harpreet Dhaliwal" <harpreet(dot)dhaliwal01(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: SQL Transaction related
Date: 2007-05-10 06:24:40
Message-ID: d86a77ef0705092324h472db668m97fd9fdb774a7f47@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Uwe C. Schroeder 2007-05-10 06:49:02 Re: SQL Transaction related
Previous Message Naz Gassiep 2007-05-10 05:47:48 Re: In theory question