Reduce lock levels for ADD and DROP COLUMN

Поиск
Список
Период
Сортировка
Искать
От
Simon Riggs
Тема
Reduce lock levels for ADD and DROP COLUMN
Дата
Msg-id
1293450154.1193.62851.camel@ebony
Список
Дерево обсуждения
Reduce lock levels for ADD and DROP COLUMN Simon Riggs <simon@2ndQuadrant.com>
Re: Reduce lock levels for ADD and DROP COLUMN Robert Haas <robertmhaas@gmail.com>
Re: Reduce lock levels for ADD and DROP COLUMN Simon Riggs <simon@2ndQuadrant.com>
Re: Reduce lock levels for ADD and DROP COLUMN Tom Lane <tgl@sss.pgh.pa.us>
Re: Reduce lock levels for ADD and DROP COLUMN Simon Riggs <simon@2ndQuadrant.com>
Re: Reduce lock levels for ADD and DROP COLUMN Tom Lane <tgl@sss.pgh.pa.us>
Re: Reduce lock levels for ADD and DROP COLUMN Simon Riggs <simon@2ndQuadrant.com>

Idea is to reduce lock level of ADD/DROP COLUMN from AccessExclusiveLock
down to ShareRowExclusiveLock.

To make it work, we need to recognise that we are adding a column
without rewriting the table. That's a simple test at post parse analysis
stage, but what I can't do is work out whether the column name used is a
domain name which contains a constraint.

So if we want this, then it seems we need to add a separate subcommand,
so we can then throw an error if a domain is specified.

ALTER TABLE foo
  ADD [COLUMN] colname CONCURRENTLY;

Or other ideas? Do we really care?

DROP ... RESTRICT works fine at reduced lock level, assuming I'm not
missing anything...

ALTER TABLE foo
  DROP [COLUMN] colname RESTRICT;

Patch needs docs, tests and a check for the domain, so just a quick hack
just to get my dev muscles back in shape after Christmas. (Jokes
please).

Comments?

-- 
 Simon Riggs           http://www.2ndQuadrant.com/books/
 PostgreSQL Development, 24x7 Support, Training and Services
 
В списке pgsql-hackers по дате отправления
От: Florian Pflug
Дата:
От: Itagaki Takahiro
Дата:
Сообщение: Re: MULTISET patch
FAQ