Skip site navigation (1) Skip section navigation (2)

Serial Field Autoincrementing

From: Jim Beckstrom <jrbeckstrom(at)voyager(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Serial Field Autoincrementing
Date: 2002-09-18 18:47:01
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
(Not sure which list to post this to, so I'm doing novice and php).

        Using php, I create a table with a SERIAL field. In the same
script, the last thing I do is a COPY ... FROM ... USING
load data I have outputted from another system into a text delimited
file.  I didn't get the autoincrementing of the serial field to work, so
I modified my output-from-another-system program to "manually" set the
serial field value.  That worked.  However, it does not seem to have
done a default SETVAL.  Do I do a "manual" SETVAL of 1 greater than the
highest value from the input text file, or am I missing something in the
create and copy process?

Jim Beckstrom


pgsql-novice by date

Next:From: Michael PaesoldDate: 2002-09-18 19:18:39
Subject: Re: Serial Field Autoincrementing
Previous:From: Sean ChittendenDate: 2002-09-18 18:31:44
Subject: Re: [NOVICE] Postgres storing time in strange manner

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group