Posting COPY data with shared sequences

Поиск
Список
Период
Сортировка
От Robert Fitzpatrick
Тема Posting COPY data with shared sequences
Дата
Msg-id 1100891565.21069.70.camel@columbus.webtent.org
обсуждение исходный текст
Список pgsql-general
I share the same sequences across 3 tables and have a COPY that send
data to one of those tables. That table has a before insert trigger
function that looks for a condition and redirect records to the other
two depending on that condition result. Sharing the sequence is needed
to act as a primary key for the view that UNION ALL's the tables.

Since I'm posting all the data from one COPY command, the sequence
number is duplicated in the tables. Should I move the moving the trigger
function to after, which would require me to delete entries that get
moved -or- separate the different data into separate incoming COPY
commands? Anyone have suggestions on how I would best achieve what I'm
looking to do.

Thanks,
--
Robert


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

Предыдущее
От: Jeremiah Jahn
Дата:
Сообщение: altre table and large object deletion
Следующее
От: Matt
Дата:
Сообщение: Re: phpPgAdmin problem - this list?