Re: Transactional behaviour with trigger

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Transactional behaviour with trigger
Дата
Msg-id 20060917143646.GA96792@winnie.fuhr.org
обсуждение исходный текст
Ответ на Transactional behaviour with trigger  (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>)
Ответы Re: Transactional behaviour with trigger
Список pgsql-sql
On Sun, Sep 17, 2006 at 02:32:10PM +0200, Joost Kraaijeveld wrote:
> For the contactaddress I also have a trigger(function) that should
> update the record in the third table with the additional info of the
> contactaddress:
> 
> ....
> SELECT INTO customer_record objectid FROM prototype.customers WHERE contactaddress = NEW.objectid;
> IF customer_record.objectid IS NOT NULL THEN
> UPDATE customeraddress set zipcode = NEW.zipcode, city = NEW.city, housenumber = NEW.housenumber , address =
NEW.objectid
 
> WHERE customer = customer_record.objectid;
> 
> This last trigger is executed but customer_record.objectid seems to be
> always NULL as if the the customer record is not visible. Is that
> correct or is there something wrong with the SQl above?

Where does prototype.customers fit in?  Are you sure it has a row
that matches the WHERE clause?  Where would that row have come from?

Is there a reason you're maintaining customeraddress as a materialized
view rather than as a "real" view?

-- 
Michael Fuhr


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

Предыдущее
От: Joost Kraaijeveld
Дата:
Сообщение: Transactional behaviour with trigger
Следующее
От: Joost Kraaijeveld
Дата:
Сообщение: Re: Transactional behaviour with trigger