From: Magnus Hagander <mha@sollentuna.net>
To: Dag Gullberg <dag.gullberg@telia.com>
To: pgsql-sql@postgresql.org
Subject: Re: Concurrency problem
Date: Mon, 4 Oct 2004 13:39:31 +0200
Message-ID: <6BCB9D8A16AC4241919521715F4D8BCE475DF5@algol.sollentuna.se> (raw)
> 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 :-)
//Magnus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mha@sollentuna.net, dag.gullberg@telia.com
Subject: Re: Concurrency problem
In-Reply-To: <6BCB9D8A16AC4241919521715F4D8BCE475DF5@algol.sollentuna.se>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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