Skip site navigation (1) Skip section navigation (2)

Re: Concurrency problem

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Dag Gullberg" <dag(dot)gullberg(at)telia(dot)com>,<pgsql-sql(at)postgresql(dot)org>
Subject: Re: Concurrency problem
Date: 2004-10-04 11:39:31
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
> 	Yes, I have several clients connecting to the db, using 
> the same username, doing the same things, pretty much.
> 	Please educate me: 
> When a table is accessed, is there an entry that is updated 
> in pg_catalog.pg_tables (or somewhere else) in such a fashion 
> that the MVCC cannot handle it and that consecutive selects 
> from other clients will cause concurrency errors? Are these 
> entries not "locked" while accessed?

No, but the GRANT statement is translated into doing an UPDATE on a
system catalog. The concurrency error only happens when you do UPDATEs,
you can do any number of parallell SELECTs. If you wrote the SQL
directly you would use SELECT FOR UPDATE, but with GRANT I don't think
there is a way to make it use that semantic.

And no, without using FOR UPDATE, rows are not locked when they are read
in MVCC. That's what's so great about it :-)


pgsql-sql by date

Next:From: Tom LaneDate: 2004-10-04 14:17:16
Subject: Re: Difference between IN and JOIN
Previous:From: Dag GullbergDate: 2004-10-04 11:35:35
Subject: Re: Concurrency problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group