Re: Strange order of execution with rule

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: han(dot)holl(at)informationslogik(dot)nl
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Strange order of execution with rule
Date: 2005-10-21 14:23:50
Message-ID: 21258.1129904630@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

han(dot)holl(at)informationslogik(dot)nl writes:
> On Thursday 20 October 2005 23:48, Tom Lane wrote:
>> Give us a test case to demonstrate this assertion. It works as expected
>> AFAICT.

> Ok, it has to do with C functions:

> create or replace function plg_cfie() returns void as '/tmp/plg_cfie.so'
> language c immutable;

You should not declare a function "immutable" if it has side effects
(such as emitting a message). That entitles the planner to pre-evaluate
the function at plan time, which is evidently what's happening here.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2005-10-21 14:29:43 Re: [GENERAL] Oracle buys Innobase
Previous Message Tino Wildenhain 2005-10-21 14:21:16 Re: PSQL suggested enhancement