Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: BUG #4141: Aliases in rules vanished, but they work


  • From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • To: "Mathias Seiler" <mathias(dot)seiler(at)gmail(dot)com>
  • Cc: pgsql-bugs(at)postgresql(dot)org
  • Subject: Re: BUG #4141: Aliases in rules vanished, but they work
  • Date: Sat, 03 May 2008 17:52:13 -0400
  • Message-id: <24870(dot)1209851533(at)sss(dot)pgh(dot)pa(dot)us>

"Mathias Seiler" <mathias(dot)seiler(at)gmail(dot)com> writes:
> postgres=# CREATE RULE foo_delete AS ON DELETE TO foo_view do instead
> postgres-# DELETE FROM foo f where f.id = old.id;
> CREATE RULE
> postgres=# \d foo_view 
>     View "public.foo_view"
>  Column |  Type   | Modifiers 
> --------+---------+-----------
>  id     | integer | 
>  bar    | text    | 
> View definition:
>  SELECT foo.id, foo.bar
>    FROM foo
>  LIMIT 10;
> Rules:
>  foo_delete AS
>     ON DELETE TO foo_view DO INSTEAD  DELETE FROM foo
>   WHERE f.id = old.id

Hmm, looks like ruleutils.c got overlooked in the patch that added
support for aliases on UPDATE/DELETE target relations.  Will fix.

			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group