Re: Update rule on a view - what am I doing wrong

From: Leif Jensen <leif(at)crysberg(dot)dk>
To: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Update rule on a view - what am I doing wrong
Date: 2013-01-22 13:34:43
Message-ID: 26331355.18665.1358861683212.JavaMail.root@quick
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Jasen.

Thank you for your response (also thank you to Tom).

I have now tried your suggestion, but I'm not sure how you have implemented the plpgsql function. When I create the function: CREATE update_rule_func( old record, new record ) AS ... I am told, that I cannot use record for the parameter type. Could you please expand a little on your example ?

Leif

----- "Jasen Betts" <jasen(at)xnet(dot)co(dot)nz> wrote:

> On 2013-01-18, Leif Jensen <leif(at)crysberg(dot)dk> wrote:
>
> > I have been fighting a problem with an update rule on a view. I
> > have a view that combines two tables where the 'sub' table (scont)
> can
> > have several rows per row in the 'top' table (icont). The view
> > combines these to show only one record per row in the top table. To
> be
> > able to update on this view I have created a rule 'on update'. The
> > rule needs to have both UPDATE, DELETE, and INSERT commands. Is
> this
> > not possible or am I doing something else wrong ?
>
> when I hit that issue in 8.4 i used a plpgsql function
>
> ... do instead select update_rule_func(old,new);
>
> --
> ⚂⚃ 100% natural
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc Schablewski 2013-01-22 13:57:26 Re: Update rule on a view - what am I doing wrong
Previous Message Cliff de Carteret 2013-01-22 11:12:54 Pg_xlog increase due to postgres crash (disk full)