Re: [GENERAL] Generating synthetic keys on copy

2006-10-05 Thread Scott Ribe
> Right. Instead, specify a column list to the COPY (you are using a PG > version new enough to have column lists in COPY, no?) and it will > execute the default expression for the column(s) not coming from the data > file. Thanks. (Feeling dumb here.) I am using 8.1, however I haven't read the d

Re: [GENERAL] Generating synthetic keys on copy

2006-10-04 Thread Tom Lane
Scott Ribe <[EMAIL PROTECTED]> writes: > I have data I'm extracting from a legacy database. I want to assign > newly-generated synthetic keys. I would like to use copy to get the data in. > If I put an explicit null in the data file to be imported, pg won't generate > a key, right? Right. Instead

[GENERAL] Generating synthetic keys on copy

2006-10-04 Thread Scott Ribe
Given a table def something like: create table mytbl (id int8 default nextval('myseq') primary key... I have data I'm extracting from a legacy database. I want to assign newly-generated synthetic keys. I would like to use copy to get the data in. If I put an explicit null in the data file to be im