X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9AA6132AD85 for ; Mon, 4 Oct 2004 12:39:42 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 72936-02 for ; Mon, 4 Oct 2004 11:39:30 +0000 (GMT) Received: from mx-2.sollentuna.net (mx-2.sollentuna.net [195.84.163.199]) by svr1.postgresql.org (Postfix) with ESMTP id BDE2D32AD7B for ; Mon, 4 Oct 2004 12:39:32 +0100 (BST) Received: from ALGOL.sollentuna.se (janus.sollentuna.se [62.65.68.67]) by mx-2.sollentuna.net (Postfix) with ESMTP id 04F858F2BD; Mon, 4 Oct 2004 13:39:32 +0200 (CEST) content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Subject: Re: Concurrency problem Date: Mon, 4 Oct 2004 13:39:31 +0200 Message-ID: <6BCB9D8A16AC4241919521715F4D8BCE475DF5@algol.sollentuna.se> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] Concurrency problem Thread-Index: AcSqBjoGVfkAND5SSd+ylrCWy2kuugAADdug From: "Magnus Hagander" To: "Dag Gullberg" , X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/20 X-Sequence-Number: 19123 > Yes, I have several clients connecting to the db, using=20 > the same username, doing the same things, pretty much. >=20 > Please educate me:=20 > When a table is accessed, is there an entry that is updated=20 > in pg_catalog.pg_tables (or somewhere else) in such a fashion=20 > that the MVCC cannot handle it and that consecutive selects=20 > from other clients will cause concurrency errors? Are these=20 > 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