Deleting a rule?

Started by Benjamin Smithalmost 21 years ago4 messagesgeneral
Jump to latest
#1Benjamin Smith
lists@benjamindsmith.com

I wrote a rule a while back that, due to the software being extended, now
needs to be deleted.

How do I drop a rule?

DELETE FROM pg_rules WHERE rulename='foo';

doesn't seem to cut it...

-Ben
--
"The best way to predict the future is to invent it."
- XEROX PARC slogan, circa 1978

#2Michael Fuhr
mike@fuhr.org
In reply to: Benjamin Smith (#1)
Re: Deleting a rule?

On Fri, Jun 17, 2005 at 03:27:30PM -0700, Benjamin Smith wrote:

How do I drop a rule?

With DROP RULE. Here's a link to the documentation for the latest
release:

http://www.postgresql.org/docs/8.0/static/sql-droprule.html

If that doesn't work then please provide more info.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

#3Michael Glaesemann
grzm@seespotcode.net
In reply to: Benjamin Smith (#1)
Re: Deleting a rule?

On Jun 18, 2005, at 7:27 AM, Benjamin Smith wrote:

I wrote a rule a while back that, due to the software being
extended, now
needs to be deleted.

How do I drop a rule?

http://www.postgresql.org/docs/8.0/interactive/sql-droprule.html

DELETE FROM pg_rules WHERE rulename='foo';

doesn't seem to cut it...

In general, you don't probably want to be mucking around in the
system catalog (the pg_* tables) unless you know what you're doing.
Most of the things that need to be done have specific commands so you
don't have to work with the system tables directly.

You'll also probably find the SQL Command Reference page helpful.

http://www.postgresql.org/docs/8.0/interactive/sql-commands.html

Hope this helps.

Michael Glaesemann
grzm myrealbox com

#4Bruno Wolff III
bruno@wolff.to
In reply to: Benjamin Smith (#1)
Re: Deleting a rule?

On Fri, Jun 17, 2005 at 15:27:30 -0700,
Benjamin Smith <lists@benjamindsmith.com> wrote:

I wrote a rule a while back that, due to the software being extended, now
needs to be deleted.

How do I drop a rule?

DELETE FROM pg_rules WHERE rulename='foo';

doesn't seem to cut it...

DROP RULE name ON relation [ CASCADE | RESTRICT ]