Re: 7.1 bug fix question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Wampler <swampler(at)noao(dot)edu>
Cc: postgres-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: 7.1 bug fix question
Date: 2001-04-19 17:11:03
Message-ID: 21681.987700263@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Steve Wampler <swampler(at)noao(dot)edu> writes:
> Well, it looks like I got bit by this after all. Can someone show
> me a rule to attach to a view ("attributes") to invoke a trigger function
> (insert_or_update)?

> The trigger function maps the update into either an insert or an update
> on the underlying table ("attributes_table") depending on whether the row
> already exists or not.

> This was working under 7.0.3 (naturally, since insert/update/delete were
> allowed on views without explicit rules).

You had a trigger on update attached to a view? It should never have
fired, unless you were allowing tuples to be inserted into the view's
hidden table, which seems pretty wasteful.

But if that's what you want to do, you could emulate this pre-7.1
behavior by using a rule to redirect inserts/updates on the view to some
dummy table that you put triggers on. The dummy table would take the
place of the view's hidden table, which no longer exists in 7.1.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-04-19 17:28:14 Re: Telling if options were set correctly in 7.1?
Previous Message Lamar Owen 2001-04-19 17:09:33 Re: locale & glibc 2.2.2