From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Euler Taveira de Oliveira <euler@timbira.com>
Cc: Emanuel <postgres.arg@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #6041: Unlogged table was created bad in slave node
Date: Tue, 7 Jun 2011 18:06:18 -0400
Message-ID: <BANLkTikt5E74LBSL6h_PoiOY1F3dpqOBqw@mail.gmail.com> (raw)
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>
<BANLkTim433vF5HWjbJ0FSWm_-xA8DDaGNg@mail.gmail.com>
<BANLkTi=e7+0aXyoLoZENsNeBWX7n9Q+4Pw@mail.gmail.com>
<1307120363-sup-3085@alvh.no-ip.org>
<BANLkTinuA4fFnGtPYVrFvW0GssXYkOUGiQ@mail.gmail.com>
<14416.1307461823@sss.pgh.pa.us>
<BANLkTi=2ewL63njHx7mth1tV6_NYimAR9A@mail.gmail.com>
<BANLkTikMWGdLgRAL+fCBKGaNs85eQo2K+w@mail.gmail.com>
<19171.1307476439@sss.pgh.pa.us>
<BANLkTinqGQ0MQ-WhSdnoUj1FzbS0nDk=Zw@mail.gmail.com>
<20427.1307480706@sss.pgh.pa.us>
On Tue, Jun 7, 2011 at 5:05 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Tue, Jun 7, 2011 at 3:53 PM, Tom Lane <tgl@sss.pgh.pa.us> 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.
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.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: robertmhaas@gmail.com, tgl@sss.pgh.pa.us, alvherre@commandprompt.com, euler@timbira.com, postgres.arg@gmail.com
Subject: Re: BUG #6041: Unlogged table was created bad in slave node
In-Reply-To: <BANLkTikt5E74LBSL6h_PoiOY1F3dpqOBqw@mail.gmail.com>
References: <201105261137.p4QBbTlt077425@wwwmaster.postgresql.org> <4DDE7905.6050406@timbira.com> <1306427067-sup-7622@alvh.no-ip.org> <25332.1306427674@sss.pgh.pa.us> <BANLkTim433vF5HWjbJ0FSWm_-xA8DDaGNg@mail.gmail.com> <BANLkTi=e7+0aXyoLoZENsNeBWX7n9Q+4Pw@mail.gmail.com> <1307120363-sup-3085@alvh.no-ip.org> <BANLkTinuA4fFnGtPYVrFvW0GssXYkOUGiQ@mail.gmail.com> <14416.1307461823@sss.pgh.pa.us> <BANLkTi=2ewL63njHx7mth1tV6_NYimAR9A@mail.gmail.com> <BANLkTikMWGdLgRAL+fCBKGaNs85eQo2K+w@mail.gmail.com> <19171.1307476439@sss.pgh.pa.us> <BANLkTinqGQ0MQ-WhSdnoUj1FzbS0nDk=Zw@mail.gmail.com> <20427.1307480706@sss.pgh.pa.us> <BANLkTikt5E74LBSL6h_PoiOY1F3dpqOBqw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox