Re: trigger question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: trigger question
Дата
Msg-id 9642.962116390@sss.pgh.pa.us
обсуждение исходный текст
Ответ на trigger question  (mikeo <mikeo@spectrumtelecorp.com>)
Ответы Re: trigger question
Список pgsql-general
mikeo <mikeo@spectrumtelecorp.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Hernan Gonzalez
Дата:
Сообщение: puzzled by the docs
Следующее
От: Herbert Liechti
Дата:
Сообщение: Re: How to dump from Postgre