Re: Transaction and table partitioning - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Transaction and table partitioning
Date
Msg-id 87y7vaqi37.fsf@stark.xeocode.com
Whole thread Raw
In response to Transaction and table partitioning  ("Dragan Zubac" <zubacdragan@gmail.com>)
List pgsql-hackers
"Dragan Zubac" <zubacdragan@gmail.com> writes:

> Hello
> 
> Is it possible to use transactions with 'per sub table' locks? What I
> mean,if I partition a table and use transaction on that table with
> constraint,will the database lock the master table (and all subtables),or
> only sub table where the data is ?

Unless you're doing ALTER TABLE or something like that Postgres never locks
tables. Two backends can insert into the same table at the same time and
neither has to wait until the other is done.

If you are updating the same record then of course one has to wait but then
partitioning isn't going to help in that case.

-- 
greg



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: mysterious nbtree.c comment
Next
From: Agent M
Date:
Subject: binds only for s,u,i,d?