Re: WIP: extensible enums
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Dunstan <andrew@dunslane.net>, Dean Rasheed <dean.a.rasheed@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2010-10-24T04:04:03Z
Lists: pgsql-hackers
On Sat, Oct 23, 2010 at 8:11 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Robert Haas <robertmhaas@gmail.com> writes: >> Why would you need to lock out type comparisons? > > Didn't you get the point? The hazard is to a concurrent process that is > merely trying to load up its enum-values cache so that it can perform an > enum comparison. I don't want such an operation to have to block, > especially not against something that's trying to acquire a more or less > exclusive lock. Hmm, yeah, I missed the point. Sorry. I suppose you could fix this by always updating every row, and storing in each row the total count of elements (or a random number). Then it'd be obvious if you'd read an inconsistent view of the world. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company