Posting COPY data with shared sequences - Mailing list pgsql-general

From Robert Fitzpatrick
Subject Posting COPY data with shared sequences
Date
Msg-id 1100891565.21069.70.camel@columbus.webtent.org
Whole thread Raw
List 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 by date:

Previous
From: Jeremiah Jahn
Date:
Subject: altre table and large object deletion
Next
From: Matt
Date:
Subject: Re: phpPgAdmin problem - this list?