pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
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, 07 Jun 2011 15:53:59 -0400
Message-ID: <19171.1307476439@sss.pgh.pa.us> (raw)
In-Reply-To: <BANLkTikMWGdLgRAL+fCBKGaNs85eQo2K+w@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>

Robert Haas <robertmhaas@gmail.com> writes:
> I found a few other holes in my previous patch as well.  I think this
> plugs them all, but it's hard to be sure there aren't any other calls
> to RelationGetNumberOfBlocks() that could bomb out.

[ squint... ]  Do we need those additional tests in plancat.c?  I
haven't paid attention to whether we support unlogged indexes on logged
tables, but if we do, protecting the RelationGetNumberOfBlocks() call is
the least of your worries.  You ought to be fixing things so the planner
won't consider the index valid at all (cf. the indisvalid test at line
165).  Similarly, the change in estimate_rel_size seems to be at an
awfully low level, akin to locking the barn door after the horses are
out.  What code path are you thinking will reach there on an unlogged
table?

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.

			regards, tom lane



view thread (23+ messages)  latest in thread

Message-ID: <19171.1307476439@sss.pgh.pa.us>
Permalink:  ../19171.1307476439@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19171.1307476439@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, 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: <19171.1307476439@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>

* 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