Re: Postgres - how to skip 'sequence' columns

From: Date: Mon, 12 Apr 2010 22:48:34 +0000
Subject: Re: Postgres - how to skip 'sequence' columns
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-47043@lists.php.net to get a copy of this message
Gary . wrote:
Is it possible to skip column(s) in the target table when using pg_copy_from? When I tried to bulk insert some data from a csv file by way of pg_copy_from I received the error "Warning: pg_copy_from() [function.pg-copy-from]: Copy command failed: ERROR: permission denied for relation xyz", pretty much as I expected since things look like: CREATE SEQUENCE xyz; CREATE TABLE some_table ( id int NOT NULL PRIMARY KEY DEFAULT nextval('xyz') ... (i.e. the first column is automatically populated by the db itself).
It seems not from looking at the php manual. You could use http://www.php.net/manual/en/function.pg-put-line.php instead. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#47043) next »