X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9F9BD52818 for ; Thu, 16 Jun 2005 14:17:57 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 03056-01 for ; Thu, 16 Jun 2005 17:17:48 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.195]) by svr1.postgresql.org (Postfix) with ESMTP id 672AD5280A for ; Thu, 16 Jun 2005 14:17:47 -0300 (ADT) Received: by rproxy.gmail.com with SMTP id i8so398022rne for ; Thu, 16 Jun 2005 10:17:47 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=by3LFYah/RkzPDTYFuxBgtEENSg/DME/bNLnVmt5a241Y9ltjFZAqnFE5YHwBmWuG30l3tBhsoxO+xHR/WwpdyhZsTcUnKyzqS1/r32U3cO114po/RRx9Pye5uX+yj+XMBUElJ4c3nAukwwutwYwrzd3T7gSK6gY1hKOUFgvB2I= Received: by 10.38.101.35 with SMTP id y35mr676389rnb; Thu, 16 Jun 2005 10:17:47 -0700 (PDT) Received: by 10.38.97.37 with HTTP; Thu, 16 Jun 2005 10:17:47 -0700 (PDT) Message-ID: Date: Thu, 16 Jun 2005 12:17:47 -0500 From: Jaime Casanova Reply-To: Jaime Casanova To: Cedric BRINER Subject: Re: is this a bug ? Cc: pgsql-general@postgresql.org In-Reply-To: <20050616175239.GA23283@obs.unige.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050616175239.GA23283@obs.unige.ch> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.238 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200506/801 X-Sequence-Number: 79509 On 6/16/05, Cedric BRINER wrote: > hi, >=20 > I'm facing this problem >=20 > DROP TABLE test; > DROP TABLE new_test; > CREATE TABLE test (id serial NOT NULL UNIQUE, nom varchar(32)); > INSERT INTO test ("nom") values ('cedric'); > INSERT INTO test ("nom") values ('felix'); > INSERT INTO test ("nom") values ('julien'); >=20 > CREATE TABLE new_test (id serial NOT NULL UNIQUE, nom varchar(32)); > INSERT INTO new_test SELECT * FROM test; >=20 Why create the table with a serial field if you're going to drop the seq anyway just making it integer and this way you avoid your problem? > ALTER TABLE new_test ALTER COLUMN id SET DEFAULT nextval('public.test_id_= seq'); > DROP TABLE test; >=20 > ALTER TABLE new_test RENAME TO test; > ALTER TABLE new_test_id_key RENAME TO test_id_key; >=20 > DROP SEQUENCE new_test_id_seq ; > -- this give an error... is this normal >=20 > is this the normal behaviour ? >=20 --=20 Atentamente, Jaime Casanova (DBA: DataBase Aniquilator ;)