Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 765FBB5DF86 for ; Tue, 7 Jun 2011 19:06:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 62344-03 for ; Tue, 7 Jun 2011 22:06:19 +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 2BCD2B5DF46 for ; Tue, 7 Jun 2011 19:06:18 -0300 (ADT) Received: by pvg12 with SMTP id 12so1083769pvg.19 for ; Tue, 07 Jun 2011 15:06:18 -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 :content-transfer-encoding; bh=Szj1zbo7ovz0iHZ0BUNFpB3/Bhp2RGh03fGy3Ax+nIA=; b=bTAeISpdTUoRieH7TGZxcBlSjQ679hUbGPwzY9Lrxn6xlvxUm6gptmvb9rI5W+WdYX eHZ4o7u4B2tYMV1IHg/+nNv3zX2379gqQqGn/Zf2plfmsv/JGJrq9+LokAXkubhQhTbe y9Y83vpvvHe9Tu1j/SgICl9TD6hlzhKGrohzs= 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:content-transfer-encoding; b=jipTpI8q/Hd8CaL1KMDbGFFHfeL3H3B6JNHXqBKJj43Xp1/poIsKrQDuUnWjruGrjP NZmsNYvQIB5Xr8CxM3D2fwSkt03i7f3p661ArwS+rVQqUmoqPXen6qiH0azFdclQ+pXT uJ/4UEw9yghBGoxBAmxPJtQQKlOody6UV6jMQ= MIME-Version: 1.0 Received: by 10.68.27.138 with SMTP id t10mr470715pbg.245.1307484378341; Tue, 07 Jun 2011 15:06:18 -0700 (PDT) Received: by 10.68.56.70 with HTTP; Tue, 7 Jun 2011 15:06:18 -0700 (PDT) In-Reply-To: <20427.1307480706@sss.pgh.pa.us> References: <201105261137.p4QBbTlt077425@wwwmaster.postgresql.org> <4DDE7905.6050406@timbira.com> <1306427067-sup-7622@alvh.no-ip.org> <25332.1306427674@sss.pgh.pa.us> <1307120363-sup-3085@alvh.no-ip.org> <14416.1307461823@sss.pgh.pa.us> <19171.1307476439@sss.pgh.pa.us> <20427.1307480706@sss.pgh.pa.us> Date: Tue, 7 Jun 2011 18:06:18 -0400 Message-ID: Subject: Re: BUG #6041: Unlogged table was created bad in slave node From: Robert Haas To: Tom Lane Cc: Alvaro Herrera , Euler Taveira de Oliveira , Emanuel , pgsql-bugs Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201106/79 X-Sequence-Number: 30458 On Tue, Jun 7, 2011 at 5:05 PM, Tom Lane wrote: > Robert Haas writes: >> On Tue, Jun 7, 2011 at 3:53 PM, Tom Lane wrote: >>> It might be that it'd be best just to have both the planner and executo= r >>> throwing errors on unlogged tables, rather than rejiggering pieces of >>> the planner to sort-of not fail on an unlogged table. > >> Mmm, that's not a bad thought either. =A0Although I think if we can be >> certain that the planner will error out, the executor checks aren't >> necessary. =A0It would disallow preparing a statement and then executing >> it after promotion, but that doesn't seem terribly important. =A0Any >> idea where to put the check? > > Well, I'd recommend keeping the test in ExecOpenScanRelation, since it's > cheap insurance against the situation changing since the plan was made. Well, the system can't very well go back into recovery once it's emerged. I guess it's possible that a table could be switched from LOGGED to UNLOGGED during recovery though, in some hypothetical future release. No one's proposed that feature yet, but since there IS a proposal to go the other way it doesn't seem unlikely we may see the other direction eventually too. I can't get too excited about blocking this in multiple places just for the sake of preserving a nicer error message in the face of a possible future feature development, though. > But for the planner, why not just put the same kind of test in > get_relation_info, just after it does heap_open? OK, let me try that. --=20 Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company