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 5DD12D1C9F7 for ; Mon, 4 Aug 2003 21:02:04 +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 49143-05 for ; Mon, 4 Aug 2003 18:00:49 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 921D4D1C518 for ; Mon, 4 Aug 2003 18:01:53 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 7CD3510258; Mon, 4 Aug 2003 16:54:34 -0400 (EDT) Received: from [192.168.1.200] (dyn-133-81.tor.dsl.tht.net [134.22.133.81]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 105DB10248; Mon, 4 Aug 2003 16:54:32 -0400 (EDT) Subject: Re: Mysql -> Postgresql pitfalls From: Rod Taylor To: "scott.marlowe" Cc: "Chad N. Tindel" , Josh Berkus , PostgreSQL Docs In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-tH2h0Pt62mdl6ub80Ho8" Message-Id: <1060030888.91190.22.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Mon, 04 Aug 2003 17:01:29 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/31 X-Sequence-Number: 1891 --=-tH2h0Pt62mdl6ub80Ho8 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > speak in the \copy command. I.e. you wouldn't use inserts to load your= =20 > data, you'd use a bulk copy, which bypassess all the serial / IDENTITY=20 > stuff. Basically, with the IDENTITY type, if you try to insert a value,= =20 COPY enforces everything that insert does. It's simply a little quicker than insert due to a different string parsing method and avoiding places that are for advanced features (subselects, functions, etc.). A default is still applied if the column has not been provided.=20 Likewise, triggers (constraint triggers anyway) still run. Bumping the start value for an IDENTITY is simple: CREATE TABLE tab ( col integer GENERATED ALWAYS AS IDENTITY(START WITH 42) ); I suppose we'll need a GUC so that GENERATED ALWAYS isn't actually always -- just usually. --=-tH2h0Pt62mdl6ub80Ho8 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA/Lsmn6DETLow6vwwRAsNYAKCDY3vbw6TT43csMB7ygg6RaQ074gCeO+m9 h5xvVX6y3WhJXJ+R4VczcvY= =ADq9 -----END PGP SIGNATURE----- --=-tH2h0Pt62mdl6ub80Ho8--