From: Chad N. Tindel <chad@tindel.net>
To: scott.marlowe <scott.marlowe@ihs.com>
Cc: Chad N. Tindel <chad@tindel.net>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-docs@postgresql.org
Subject: Re: Mysql -> Postgresql pitfalls
Date: Mon, 4 Aug 2003 15:29:48 -0400
Message-ID: <20030804192948.GA48747@calma.pair.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0308041256030.10758-100000@css120.ihs.com>
References: <20030804172617.GB36172@calma.pair.com>
<Pine.LNX.4.33.0308041256030.10758-100000@css120.ihs.com>
> > > FWIW, in 7.5 we're likely to implement SQL3 IDENTITY columns ... basically
> > > just a SERIAL column where you don't have the option of inserting your own
> > > value, you have to take what it gives you.
> >
> > Interesting... how do you import data from a dump with such columsn?
>
> Easy, after you import the last row, you
>
> select setval('seqname',lastvalue);
>
> on the sequence. Like I said above, it's mostly just a different way of
> doing things in Postgresql, and often those different ways are less
> obvious, and quite often, being less obvious is actually safer even if
> it is a littler harder to learn up front.
But you just said that I can't actually include the id column in an insert
query. So how would I import data from a dump and ensure that the id columns
are what I expect them to be?
Chad
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 using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: chad@tindel.net, scott.marlowe@ihs.com, josh@agliodbs.com
Subject: Re: Mysql -> Postgresql pitfalls
In-Reply-To: <20030804192948.GA48747@calma.pair.com>
* 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