Re: trigger question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mikeo <mikeo(at)spectrumtelecorp(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: trigger question
Date: 2000-06-27 14:33:10
Message-ID: 9642.962116390@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

mikeo <mikeo(at)spectrumtelecorp(dot)com> writes:
> CREATE function rates_hist_function()
> returns opaque
> as 'BEGIN
> if ( old.rt_valid <> ''P'' or new.rt_valid not in (''Y'',''N''))
^^^^^^^^^^^^

> i get this error:
> ERROR: record old is unassigned yet

> since this trigger is for both insert or update, why does it expect
> the "OLD" value to already exist, as it would not for insert?

Because you referenced it in the function code. Am I missing something?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Hernan Gonzalez 2000-06-27 14:34:30 puzzled by the docs
Previous Message Martijn van Oosterhout 2000-06-27 14:17:14 Re: Limit for an transaction