Re: Assertions in PL/PgSQL

From: Jaime Casanova <jaime(at)2ndquadrant(dot)com>
To: Marko Tiikkaja <marko(at)joh(dot)to>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assertions in PL/PgSQL
Date: 2013-09-14 20:29:33
Message-ID: CAJKUy5g-VCMF65JDuCnxdSYWLr5SJEROqvtuGd_+eiE+2dDnbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

El 14/09/2013 15:18, "Marko Tiikkaja" <marko(at)joh(dot)to> escribió:
>
> On 2013-09-14 21:55, Jaime Casanova wrote:
>>
>> On Sat, Sep 14, 2013 at 1:52 PM, Marko Tiikkaja <marko(at)joh(dot)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?
>
>

That's exactly what i wanted. thanks

--
Jaime Casanova
2ndQuadrant: Your PostgreSQL partner

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2013-09-14 20:40:35 Re: Assertions in PL/PgSQL
Previous Message Pavel Stehule 2013-09-14 20:24:35 Re: Assertions in PL/PgSQL