X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id ADE208B9E23 for ; Thu, 3 Feb 2005 09:53:50 +0000 (GMT) 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 14763-02 for ; Thu, 3 Feb 2005 09:53:40 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.196]) by svr1.postgresql.org (Postfix) with ESMTP id 872FD8B9BD6 for ; Thu, 3 Feb 2005 09:53:41 +0000 (GMT) Received: by rproxy.gmail.com with SMTP id z35so216603rne for ; Thu, 03 Feb 2005 01:53:41 -0800 (PST) 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:references; b=VveAPJMWx18KS7UomiF2cOpDSlDgZBcv5VMJ25NByKz8nEZQUL0/Dt5GN2JAt0q+ROcLOxKkvfxCzRSOG5zdLj59VYZwUgsBGyArJm9DX6QYSe0pHAyvYA2mnXzc6wfhC8K2kPhtgubDsHVDXx+4urJ6WXJd7E18A+/Pn8uy3LM= Received: by 10.38.11.31 with SMTP id 31mr124671rnk; Thu, 03 Feb 2005 01:53:41 -0800 (PST) Received: by 10.38.163.72 with HTTP; Thu, 3 Feb 2005 01:53:41 -0800 (PST) Message-ID: <758d5e7f050203015316cdabb7@mail.gmail.com> Date: Thu, 3 Feb 2005 10:53:41 +0100 From: Dawid Kuroczko Reply-To: Dawid Kuroczko To: Alvaro Herrera Subject: Re: pg_dump bug in 7.3.9 with sequences Cc: PostgreSQL-development In-Reply-To: <20050202220404.GC1967@dcc.uchile.cl> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <42013187.7040806@commandprompt.com> <6686.1107379308@sss.pgh.pa.us> <42014C28.1070300@commandprompt.com> <20050202220404.GC1967@dcc.uchile.cl> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.545 tagged_above=0 required=5 tests=AWL, FROM_ENDS_IN_NUMS, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200502/131 X-Sequence-Number: 63959 On Wed, 2 Feb 2005 19:04:04 -0300, Alvaro Herrera wrote: > > It is not pilot error if PostgreSQL allows it. There is > > nothing "illegal" about the above commands in their execution. > > The pg_dump application should recognize that the object has > > changed and react accordingly. > > ISTM this is a bug, but it's not clear to me what is the solution. > I can think of two: > > 1. Changing the default is forbidden > 2. When the default is changed, the dependency on the sequence is > dropped, and the sequence itself is dropped. In my humble opinion, the command: ALTER TABLE ALTER COLUMN fooser SET DEFAULT nextval('aaa_seq'); should be equivalent to: ALTER TABLE ALTER COLUMN fooser TYPE integer; ALTER TABLE ALTER COLUMN fooser SET DEFAULT nextval('aaa_seq'); ...ie, if we mess with 'default' it is no longer a serial, but a plain integer with default sequence. Regards, Dawid