Re: Odd rule behavior?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jon Lapham <lapham(at)extracta(dot)com(dot)br>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Odd rule behavior?
Date: 2001-08-30 13:26:30
Message-ID: Pine.LNX.4.30.0108301523380.679-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jon Lapham writes:

> I'm receiving the following error message:
> ERROR: Relation "log" with OID 3694127 no longer exists

As a general rule, this won't work in PostgreSQL:

CREATE TABLE foo (...);
CREATE RULE bar ... ON foo ...; # view, trigger, etc.
DROP TABLE foo (...);
CREATE TABLE foo (...);

The rule (view, trigger) references the table by oid, not by name. (This
is a good thing. Consider what happens when the newly created table has a
totally different structure.) The correct fix would be to prevent the
DROP TABLE or drop the rule with it, but it hasn't been done yet.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-08-30 13:28:10 Re: getting the oid for a new tuple in a BEFORE trigger
Previous Message Florian Weimer 2001-08-30 13:21:16 Re: Escaping strings for inclusion into SQL queries