Re: pg_restore order and check constraints

Поиск
Список
Период
Сортировка
От Martín Marqués
Тема Re: pg_restore order and check constraints
Дата
Msg-id 51C762F4.7030609@2ndquadrant.com
обсуждение исходный текст
Ответ на pg_restore order and check constraints  (Moshe Jacobson <moshe@neadwerx.com>)
Ответы Re: pg_restore order and check constraints  (Moshe Jacobson <moshe@neadwerx.com>)
Список pgsql-general
El 23/06/13 13:34, Moshe Jacobson escribió:
> Hi,
>
> I recently added a check constraint onto a table in my database, that
> uses a stored procedure to check one of the inserted columns against the
> data of another table.

Is it possible to see the function?

> I know that this is stretching the limit of what a check constraint is
> meant to be, but is there a way, short of editing the pg_restore list
> manually every time, to guarantee that the table used for validation is
> populated before the table with the data being validated?

What for? If the dumps actually are taken without contraints, data
restored (much faster as no constraints have to be checked, and just
then constraints are added via ALTER TABLE.

> Right now it is restoring out of order, and the table is not getting
> populated correctly.

Why not?

> if I have to rewrite as a trigger, I will do that, but I like the check
> constraint because it checks all of the entries when it's applied. Any
> suggestions?

We'd need to see how the constraint is added, and the function you say
is used for checking the constrants.

--
Martín Marqués                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Postgres DB crashing
Следующее
От: Moshe Jacobson
Дата:
Сообщение: Re: pg_restore order and check constraints