Re: Inserting values into a SERIAL field - Mailing list pgsql-general

From GH
Subject Re: Inserting values into a SERIAL field
Date
Msg-id 20010306171309.B14057@over-yonder.net
Whole thread Raw
In response to Inserting values into a SERIAL field  ("Ian deSouza" <iandesouza@earthlink.net>)
Responses Re: Inserting values into a SERIAL field  (Warren Vanichuk <pyber@street-light.com>)
List pgsql-general
On Sun, Mar 04, 2001 at 05:22:46PM +0000, some SMTP stream spewed forth:
> Hi all,
>
> Is there any SQL statement to PostgreSQL that will allow me to insert rows
> with a specified value for the SERIAL value. I know this is not what you
> want to do normally, but I'm trying to provide a kind of general export and
> import function to a generic database. Since there exists foreign key values
> in instances of other tables that point into field values for a table that
> has a SERIAL id, I'd like to somehow import all this data and continue using
> the SERIAL functionality for the highest value of the id fields.

I think what you want is
insert into table (<serial_col>, <whatever>,...) values (...);


dan

>
> Ian
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

pgsql-general by date:

Previous
From: Randy Hall
Date:
Subject: Re: how to find DB names in Postgres 7.1?
Next
From: Boulat Khakimov
Date:
Subject: Undefined symbol