pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
locks and "select for update"
2+ messages / 2 participants
[nested] [flat]

* locks and "select for update"
@ 2012-08-31 17:05  Wayne Cuddy <lists-pgsql@useunix.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Wayne Cuddy @ 2012-08-31 17:05 UTC (permalink / raw)
  To: pgsql-sql

The documentation about concurrency states that all the different types
of locks are table locks even if the word row appears in the lock name.

The documentation about select statements states that when "for update
of" is used that only the selected rows will be locked. Is this true or
does this really mean that when any target row is found the entire table
is locked until the end of the transaction?

Thanks,
Wayne




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: locks and "select for update"
@ 2012-08-31 19:28  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Wayne Cuddy <lists-pgsql@useunix.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2012-08-31 19:28 UTC (permalink / raw)
  To: Wayne Cuddy <lists-pgsql@useunix.net>; +Cc: pgsql-sql

Wayne Cuddy <lists-pgsql@useunix.net> writes:
> The documentation about concurrency states that all the different types
> of locks are table locks even if the word row appears in the lock name.

Section 13.3.1, "Table-level Locks", states that all the lock types
discussed therein are table-level locks, even though some of them have
names containing the word ROW for historical reasons.  I don't see how
you'd read it to imply that there are no finer-grained locks anywhere in
Postgres.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2012-08-31 19:28 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-08-31 17:05 locks and "select for update" Wayne Cuddy <lists-pgsql@useunix.net>
2012-08-31 19:28 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox