Re: Disabling triggers with psql (gforge 7.4 to 8.2 migration)

Поиск
Список
Период
Сортировка
От Josh Kupershmidt
Тема Re: Disabling triggers with psql (gforge 7.4 to 8.2 migration)
Дата
Msg-id 4ec1cf761002100810w520663d5m9f76e4e357967e70@mail.gmail.com
обсуждение исходный текст
Ответ на Best Replication Tool  (Kiswono Prayogo <kiswono@gmail.com>)
Список pgsql-admin
[Forgot to CC list, again]

Found the doc. page on pg_trigger I was looking for. You were right, pg_trigger changed between 8.2 and 8.3:
http://www.postgresql.org/docs/8.2/static/catalog-pg-trigger.html
http://www.postgresql.org/docs/8.3/static/catalog-pg-trigger.html

Josh

On Wed, Feb 10, 2010 at 11:03 AM, Josh Kupershmidt <schmiddy@gmail.com> wrote:
On Wed, Feb 10, 2010 at 10:30 AM, Iñigo Martinez Lasala <imartinez@vectorsf.com> wrote:
Hmmmm...

What about
UPDATE pg_trigger SET tgenabled = false;

Restore data, and after done:
UPDATE pg_trigger SET tgenabled = true;

I'm going to test it.


Perhaps this was still a boolean column in 8.2, but at least in 8.3 and above tgenabled is a "char" field. The only explanation I found of its values is here:
http://archives.postgresql.org/pgsql-hackers/2007-01/msg01302.php

Anyway, I suspect your idea will work, but if you're going to the trouble of disabling+reenabling triggers for performance reasons, you might still be better off with pg_restore, since it can handle creation of constraints and indexes at the appropriate time as well, which can really help. 

Josh

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

Предыдущее
От: Josh Kupershmidt
Дата:
Сообщение: Re: Disabling triggers with psql (gforge 7.4 to 8.2 migration)
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Disabling triggers with psql (gforge 7.4 to 8.2 migration)