Re: Reducing some DDL Locks to ShareLock

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Reducing some DDL Locks to ShareLock
Дата
Msg-id 1223379173.4747.145.camel@ebony.2ndQuadrant
обсуждение исходный текст
Ответ на Re: Reducing some DDL Locks to ShareLock  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: Reducing some DDL Locks to ShareLock  ("Robert Haas" <robertmhaas@gmail.com>)
Re: Reducing some DDL Locks to ShareLock  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, 2008-10-07 at 07:21 +0100, Simon Riggs wrote:

> It was an excellent question because that aspect isn't handled correctly
> in the enclosed patch for subcommands, other than index-creating
> constraints.
>
> My main focus is on these commands
> * CREATE TRIGGER
> * ALTER TABLE ..  ADD PRIMARY KEY
> * ALTER TABLE ..  ADD FOREIGN KEY
 * CREATE RULE

> because those are the most painful ones. We could make it work against
> more, but we'd need to rewrite lots and lots of catalog update code.

OK, patch updated, tested, working.

Points of note.

1. I've left the infrastructure there for further changes, but we can
rip that out if desired.

2. Also need to decide whether we want pg_class.reltriggers as int2 (as
implemented here) or switch to relhastriggers as boolean.

3. The patch introduces a slight weirdness: if you create two FKs on the
same column at the same time you end up with two constraints with
identical names. Drop constraint then removes them both, though in other
respects they are both valid, just not uniquely. CREATE INDEX avoids
this by way of the unique index on relname. The equivalent index on
pg_constraint is not unique, though *cannot* be made unique without
breaking some corner cases of table inheritance.

--
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Weird behaviour with ALTER TABLE ... SET TABLESPACE ... statement
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Reducing some DDL Locks to ShareLock