Search Postgresql Archives

Re: multiple statement 'instead of' rule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Merlin Moncure" <mmoncure@xxxxxxxxx> writes:
> create or replace rule insert_fsv as on insert to frequency_service_view
>   do instead
>   (
>     insert into frequency_operation
>       select new.table_name, new.frequency, old.code where new.set =
> true and old.set = false;
>     delete from frequency_operation
>       where table_name = old.table_name and frequency_operation.code =
> old.code and
>         frequency_operation.frequency = new.frequency and new.set = false;
>     update operation
>       set code = new.code where code = old.code and old.code != new.code;
>   );

What is frequency_service_view?  Is it by any chance dependent on
frequency_operation?  If so, your changes to frequency_operation will
affect the behavior of OLD references.

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux