Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 3BDF71337BEA for ; Sun, 3 Apr 2011 22:54:16 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 12289-05 for ; Mon, 4 Apr 2011 01:53:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pv0-f174.google.com (mail-pv0-f174.google.com [74.125.83.174]) by mail.postgresql.org (Postfix) with ESMTP id 15EEA1337BE4 for ; Sun, 3 Apr 2011 22:53:57 -0300 (ADT) Received: by pvg12 with SMTP id 12so1180414pvg.19 for ; Sun, 03 Apr 2011 18:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=2pwqfInd94u8dxnGqrJX6c8GZnoWrCZMT16xBbMjNTQ=; b=cZ/YMJmwHyblJQ9D4LZrzOEM0p/s7kmtDbX5oP7BDNsA8p5w1tQ2QggRcmqzDrM0Y7 jQLXCTOcE9lwrsFi1zt5xKGkm2rMxhyBLCe1wc3jDKNHOdeDtw525CbsNPVT2Ii3f/5k Y+DJmMZo6QrA54O3BQcE616qwTzAuGfO0VRmA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=pIXd/copO0Sjcm4rPoPqLoTOBLdqpiSCyrhiAUYt5z9PwsfdB7SjcpnMh5xzx8NWT1 aXM9J3QfC9+p4E4T5TFeOaWNOZFAvLb2qXb50XEGIC8/EijsiurZGunnhLYRcjCnzjZ5 8ba4wvUoRr1qELVxBazjEbIHoO3ekmRM4ysVQ= MIME-Version: 1.0 Received: by 10.142.152.2 with SMTP id z2mr5385072wfd.78.1301882037855; Sun, 03 Apr 2011 18:53:57 -0700 (PDT) Received: by 10.68.62.65 with HTTP; Sun, 3 Apr 2011 18:53:57 -0700 (PDT) In-Reply-To: <20110401045629.GA9314@tornado.gateway.2wire.net> References: <201101311142.p0VBgVGd019556@wwwmaster.postgresql.org> <20110331100649.GA7286@tornado.gateway.2wire.net> <20110401045629.GA9314@tornado.gateway.2wire.net> Date: Sun, 3 Apr 2011 21:53:57 -0400 Message-ID: Subject: Re: BUG #5856: pg_attribute.attinhcount is not correct. From: Robert Haas To: Noah Misch Cc: Naoya Anzai , pgsql-hackers@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201104/101 X-Sequence-Number: 185304 On Fri, Apr 1, 2011 at 12:56 AM, Noah Misch wrote: > On Thu, Mar 31, 2011 at 11:11:49AM -0400, Robert Haas wrote: >> On Thu, Mar 31, 2011 at 6:06 AM, Noah Misch wrote: >> >> I think this is a manifestation the same problem mentioned here: >> >> >> >> http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=31b6fc06d83c6de3644c8f2921eb7de0eb92fac3 >> >> >> >> I believe this requires some refactoring to fix. ?It would be good to do that. >> > >> > The best way I can see is to make ATExecAddColumn more like ATExecDropColumn, >> > ATAddCheckConstraint, and ATExecDropConstraint. ?Namely, recurse at Exec-time >> > rather than Prep-time, and cease recursing when we satisfy the ADD COLUMN with a >> > merge. ?Did you have something else in mind? >> >> I had exactly what you just said in mind. > > Patch attached, then. Committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company