From: Andres Freund <andres@anarazel.de>
To: p.buongiovanni@net-international.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13513: Turning a table into a view
Date: Wed, 22 Jul 2015 10:59:06 +0200
Message-ID: <20150722085906.GE5053@awork2.anarazel.de> (raw)
In-Reply-To: <20150722082538.9705.21746@wrigleys.postgresql.org>
References: <20150722082538.9705.21746@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 2015-07-22 08:25:38 +0000, p.buongiovanni@net-international.com wrote:
> I create the table MyTable with a foreign key. In a second time I drop that
> foreign key (using ALTER TABLE command) in order to turn the table MyTable
> into a view, using the command: CREATE RULE "_RETURN" AS ON SELECT TO
> MyTable DO INSTEAD...
> The server doesn't allow me to esecute this command as it tells me that
> there is a foreign key or a trigger on the table MyTable.
> The problem does not occur if I create the table MyTable without foreign
> keys at the beginnning.
Why are you converting tables to views like that? That's really only
supported to break dependency cycles when restoring dumps...
The "problem" is that we don't reset relhastriggers (and some other
fields) when dropping them, which normally is fine.
Regards,
Andres
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: andres@anarazel.de, p.buongiovanni@net-international.com
Subject: Re: BUG #13513: Turning a table into a view
In-Reply-To: <20150722085906.GE5053@awork2.anarazel.de>
References: <20150722082538.9705.21746@wrigleys.postgresql.org> <20150722085906.GE5053@awork2.anarazel.de>
* 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