Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9CE81B5DF61 for ; Tue, 7 Jun 2011 18:05:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 16801-01 for ; Tue, 7 Jun 2011 21:05:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 50D56B5DF5E for ; Tue, 7 Jun 2011 18:05:10 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p57L56B0020428; Tue, 7 Jun 2011 17:05:06 -0400 (EDT) To: Robert Haas cc: Alvaro Herrera , Euler Taveira de Oliveira , Emanuel , pgsql-bugs Subject: Re: BUG #6041: Unlogged table was created bad in slave node In-reply-to: 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> Comments: In-reply-to Robert Haas message dated "Tue, 07 Jun 2011 17:00:43 -0400" Date: Tue, 07 Jun 2011 17:05:06 -0400 Message-ID: <20427.1307480706@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/78 X-Sequence-Number: 30457 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 executor >> 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. Although I think if we can be > certain that the planner will error out, the executor checks aren't > necessary. It would disallow preparing a statement and then executing > it after promotion, but that doesn't seem terribly important. Any > 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. But for the planner, why not just put the same kind of test in get_relation_info, just after it does heap_open? regards, tom lane