what's the default lock in pgsql?

if I issued insert(copy)/or update processed
on the same table but on different records
the same time, how those processes will
affect each other? 

thanks.

johnl


Tue, 1 Oct 2002 15:30:38 -0500
"John Liu" <johnl@synthesys.com>
table lock and record lock
On Tue, Oct 01, 2002 at 03:30:38PM -0500, John Liu wrote:
> what's the default lock in pgsql?
> 
> if I issued insert(copy)/or update processed
> on the same table but on different records
> the same time, how those processes will
> affect each other? 

You might want to check out the docs at

<http://developer.postgresql.org/docs/pgsql/src/tools/backend/index.html>

and 

<http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/mvcc.html>

to learn the answers to these questions.  There's no general answer
to your question, exactly, since you talk about insert, copy, and
update.

A

-- 
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110


Tue, 1 Oct 2002 16:37:10 -0400
Andrew Sullivan <andrew@libertyrms.info>
Re: table lock and record lock
On Tue, 1 Oct 2002, John Liu wrote:

> what's the default lock in pgsql?
> 
> if I issued insert(copy)/or update processed
> on the same table but on different records
> the same time, how those processes will
> affect each other? 

postgresql does not do "locking" in the sense of how most database do 
locking. It uses a system called multi-version concurrency control that 
prevents writers from blocking readers and vice versa.  It has advantages 
and disadvantages over the row locking methodology used by most other 
databases, but you can read for yourself by looking in the docs at:

http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/mvcc.html

Good luck.


Tue, 1 Oct 2002 15:24:07 -0600 (MDT)
"scott.marlowe" <scott.marlowe@ihs.com>
Re: table lock and record lock