Wanted: ALTER TRIGGER ... OWNED BY EXTENSION

Поиск
Список
Период
Сортировка
От Moshe Jacobson
Тема Wanted: ALTER TRIGGER ... OWNED BY EXTENSION
Дата
Msg-id CAJ4CxLmxxv3+S3ReV78DvmfDSTVkVDVLoLqb426qXY6f8TvySQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Wanted: ALTER TRIGGER ... OWNED BY EXTENSION  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-general
An extension I'm working on dynamically creates trigger functions and installs them on tables in public. The triggers are automatically created when one of the extension's config tables is populated.

Even though I mark the trigger functions as owned by my extension, the trigger definitions themselves are still dumped by pg_dump and restored by pg_restore. This is a problem when pg_restore is using parallelism (-j), and one thread starts issuing CREATE TRIGGER commands before the other thread has finished populating the config table.

What ends up happening is pg_restore throws a whole lot of errors saying that the function referenced by the CREATE TRIGGER command does not exist. However, the function and trigger are actually created later on once the config table is populated.

Using pg_restore without -j is a workaround, but I'd really like to be able to mark my extension's triggers as owned by the extension, so that these errors will not show up when restoring. 

Is there a better workaround that I'm not aware of?

Thanks.

Moshe Jacobson
Manager of Systems Engineering, Nead Werx Inc.
2323 Cumberland Parkway · Suite 201 · Atlanta, GA 30339

"Quality is not an act, it is a habit." -- Aristotle

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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: Complex query
Следующее
От: Leonardo M. Ramé
Дата:
Сообщение: Re: Complex query