X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 8F82CD1C4BD for ; Mon, 4 Aug 2003 17:26:27 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 30577-05 for ; Mon, 4 Aug 2003 14:25:11 -0300 (ADT) Received: from calma.pair.com (calma.pair.com [209.68.1.95]) by svr1.postgresql.org (Postfix) with SMTP id 7E605D1CA08 for ; Mon, 4 Aug 2003 14:26:16 -0300 (ADT) Received: (qmail 36991 invoked by uid 3059); 4 Aug 2003 17:26:17 -0000 Date: Mon, 4 Aug 2003 13:26:17 -0400 From: "Chad N. Tindel" To: Josh Berkus Cc: "scott.marlowe" , pgsql-docs@postgresql.org Subject: Re: Mysql -> Postgresql pitfalls Message-ID: <20030804172617.GB36172@calma.pair.com> References: <200308040949.01128.josh@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200308040949.01128.josh@agliodbs.com> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/29 X-Sequence-Number: 1889 > > > Yes. The documentation very clearly states using sequences instead of > > > auto-increment, but it doesn't make it clear that inserting the id's into > > > data by hand doesn't cause the sequence to be auto-matically incremented. > > > It'd be nice of postgres had a way to trigger an update of the sequence > > > value after every insert containing an id clumn. > > Um, how would this be a bennefit? If you're inserting rows 101-259, how does In mysql, when you insert into an auto_increment field and you specify an id, all future requests to insert a row without specifying the ID will still work properly. In postgres, if you specify the id, your next insert without and id will fail because the sequence won't have been updated. > 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? Chad