On 2013-09-14 21:55, Jaime Casanova wrote:
> On Sat, Sep 14, 2013 at 1:52 PM, Marko Tiikkaja <marko@joh.to> wrote:
>> And by "compile time" here, I mean at the time when the PL/PgSQL function
> is
>> compiled, not the postgres server binary.
>>
>
> and "compile time" means when the function is created or replaced? or the
> first time is used?
Uhh.. I have to admit, I'm not sure. I think this would be when you
CREATE the function for the backend that created the function, and on
the first call in other backends.
> if the second. Why not have a plpgsql.enable_assert variable?
> A directive you can use per function
>
> then i can keep the ASSERT and activate them by replacing the function
The patch supports a "compiler option" to override the global option and
enable it per function:
create function foof()
returns void
as $$
#enable_assertions
begin
-- failure
assert 1 > 2;
end
$$ language plpgsql;
Does this address your wishes?
Regards,
Marko Tiikkaja