pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: tim.romano@yahoo.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7866: even after T's child-tables are deleted it cannot have select-rule
Date: Sun, 10 Feb 2013 10:17:37 -0500
Message-ID: <19761.1360509457@sss.pgh.pa.us> (raw)
In-Reply-To: <E1U4W0A-0008FF-Ve@wrigleys.postgresql.org>
References: <E1U4W0A-0008FF-Ve@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

tim.romano@yahoo.com writes:
> After a table has been inherited, a select-rule cannot be created on it
> *even if its child tables are deleted and a vacuum is performed afterwards*.

This isn't a bug, it's an intentional implementation restriction.
I quote from the source code:

         * Are we converting a relation to a view?
         *
         * If so, check that the relation is empty because the storage for the
         * relation is going to be deleted.  Also insist that the rel not have
         * any triggers, indexes, or child tables.  (Note: these tests are too
         * strict, because they will reject relations that once had such but
         * don't anymore.  But we don't really care, because this whole
         * business of converting relations to views is just a kluge to allow
         * loading ancient pg_dump files.)

There is not any expectation that creating a select rule would ever
happen to anything except a freshly created table.  We'd probably not
even support the CREATE RULE syntax for this, except that pg_dump
sometimes needs to do it like that to get around circular dependencies
involving a view's rowtype.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <19761.1360509457@sss.pgh.pa.us>
Permalink:  ../19761.1360509457@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19761.1360509457@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, tim.romano@yahoo.com
  Subject: Re: BUG #7866: even after T's child-tables are deleted it cannot have select-rule
  In-Reply-To: <19761.1360509457@sss.pgh.pa.us>
  References: <E1U4W0A-0008FF-Ve@wrigleys.postgresql.org> <19761.1360509457@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