Re: Copy and serial type problem - Mailing list pgsql-general

From missive@frontiernet.net (Lee Harr)
Subject Re: Copy and serial type problem
Date
Msg-id 9jflp7$ph6$1@node21.cwnet.roc.gblx.net
Whole thread Raw
List pgsql-general
On Sun, 22 Jul 2001 21:13:26 +0200, <morphik@irc.nospam.gdansk.pl>:
> Hi,
>
> I've created a small table:
>
> CREATE TABLE "table" (
>   "id" int4 DEFAULT nextval('"table_idd_seq"') NOT NULL,
>   "file" character varying(40) NOT NULL
> );
>
> Table sequence 'table_idd_seq' is also available with a next id number.
>
> Question is how to use postgres copy function with this 'id'. Table 'table'
> is not empty... I've tried to insert nextval("table_idd_seq") into file but
> it doesn't work.
>


Not sure how you can do this in one step, but you can create a
temporary table to hold the "file" data and copy in to that,
then INSERT ... SELECT that data in to "table".

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Planner estimates cost of 'like' a lot lower than '='??
Next
From: Justin Clift
Date:
Subject: Re: psql on red hat 7.1