Re: INSERT ... SELECT ... FOR SHARED? - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: INSERT ... SELECT ... FOR SHARED?
Date
Msg-id 87od838jbl.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: INSERT ... SELECT ... FOR SHARED?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: INSERT ... SELECT ... FOR SHARED?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> The lack of regression tests covering this area is a bit annoying
> at this point.  However, it's hard to see how to test FOR UPDATE
> until we get some concurrent-sessions support in psql.

Well, end-to-end testing would e better but we can test that the locks are
at least being recorded by white-box inspection:

postgres=# begin;
BEGIN
postgres=# select * from tellers for share;tid | bid | tbalance | filler 
-----+-----+----------+--------  1 |   1 |        0 |   2 |   1 |        0 |   3 |   1 |        0 |   4 |   1 |
0|   5 |   1 |        0 |   6 |   1 |        0 |   7 |   1 |        0 |   8 |   1 |        0 |   9 |   1 |        0 |
10|   1 |        0 | 
 
(10 rows)

postgres=# select distinct age(xmax) from tellers;age 
-----  0
(1 row)

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's RemoteDBA services!


pgsql-hackers by date:

Previous
From: "Pavan Deolasee"
Date:
Subject: Re: Regression test fails when BLCKSZ is 1kB
Next
From: Alvaro Herrera
Date:
Subject: Re: TODO, FAQs to Wiki?