Re: ALTER TABLE lock strength reduction patch is unsafe
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Simon Riggs <simon@2ndquadrant.com>, pgsql-hackers@postgresql.org
Date: 2011-06-17T21:25:01Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add bytea_agg, parallel to string_agg.
- d5448c7d31b5 9.2.0 cited
-
Fix ALTER TABLE ONLY .. DROP CONSTRAINT.
- c0f03aae0469 9.2.0 cited
On Fri, Jun 17, 2011 at 5:02 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > As far as I can see, the only simple way to return pg_dump to its > previous level of safety while retaining this patch is to make it take > ShareUpdateExclusiveLocks, so that it will still block all forms of > ALTER TABLE. This is rather unpleasant, since it will also block > autovacuum for the duration of the dump. I have been thinking for a while now that it would be sensible to make vacuum use a different lock type, much as we do for relation extension. DROP TABLE and CLUSTER and at least some forms of ALTER TABLE and maybe a few other things like CREATE INDEX would need to grab that lock in addition to the ones they already acquire, but a whole lot of other things wouldn't. In particular, it's currently not possible to lock a table against SELECT without also locking it against VACUUM - and booting off any auto-vacuum worker that happens to already be processing it. If you imagine a large table with a bunch of short-duration exclusive locks, it's not too hard to see how you can end up with VACUUM starvation. But that's not something I want to do in 9.1, and I doubt it would completely solve this problem anyway. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company