[WIP] The shared dependency patch

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема [WIP] The shared dependency patch
Дата
Msg-id 20041216015755.GB1492@dcc.uchile.cl
обсуждение исходный текст
Ответы Re: [WIP] The shared dependency patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Hackers,

Here is the current shared dependency patch I promised.  (The new files
are src/include/catalog/pg_shdepend.h and
src/backend/catalog/pg_shdepend.c).

The big problem with the current patch is this:

-- session 1
BEGIN;
DROP USER foo;
-- checks dependencies, all is OK
                -- session 2
                ALTER TABLE foo OWNER TO foo;
COMMIT;

Everything works, a dependency on user foo is recorded, but now it's
useless (it will be never checked).

Of course, there needs to be a lock to protect this from happening.  But
I'm not sure what should be locked.  The whole pg_shadow relation?  That
might be overkill.

I was trying to find out if I could lock the user (and have the ALTER
TABLE get a shared lock on the user before checking its existance, and
the DROP USER get an exclusive lock which would be release at
transaction end.  So everything would remain consistant.)  However the
LOCKTAG does not have provisions to lock arbitrary objects, only
relations (I could end up locking some completely unrelated table, I
guess).

Any ideas on how to handle this?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Aprende a avergonzarte más ante ti que ante los demás" (Demócrito)

Вложения

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Threading fix for AIX
Следующее
От: Aleksander Kmetec
Дата:
Сообщение: sl translations of .po files