From: Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Newbie dbadmin out of his league
Date: Fri, 27 Aug 1999 17:11:40 -0500
Message-ID: <19990827171140.A15338@wallace.ece.rice.edu> (raw)
In-Reply-To: <7648.935788758@sss.pgh.pa.us>
References: <3.0.3.32.19990827211232.006f4c40@popmail.dircon.co.uk>
<7648.935788758@sss.pgh.pa.us>
On Fri, Aug 27, 1999 at 05:19:18PM -0400, Tom Lane wrote:
> Tim Pizey <tim@paneris.co.uk> writes:
> > 2. How do I use COPY?
>
>
> Just create the sequence with the right starting value (one past last
> ID being loaded). You can do that before or after the COPY, doesn't
> matter.
What I always do with sequences that are autocreated for serial types
(and so have a start value of 1), after the COPY puts all my data in place:
select setval('tablename_field_seq',max(field)) from tablename;
Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: reedstrm@wallace.ece.rice.edu
Subject: Re: [SQL] Newbie dbadmin out of his league
In-Reply-To: <19990827171140.A15338@wallace.ece.rice.edu>
References: <3.0.3.32.19990827211232.006f4c40@popmail.dircon.co.uk> <7648.935788758@sss.pgh.pa.us> <19990827171140.A15338@wallace.ece.rice.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox