Re: poll: CHECK TRIGGER? - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: poll: CHECK TRIGGER?
Date
Msg-id 4F589846.70303@pjmodos.net
Whole thread Raw
In response to Re: poll: CHECK TRIGGER?  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On 03/08/2012 08:35 AM, Pavel Stehule wrote:
> Here is updated patch (with regress tests, with documentation).
>
> I removed a CHECK FUNCTION and CHECK TRIGGER statements and replaced
> it by pg_check_function and pg_check_trigger like Tom proposed.
>
> The core of this patch is same - plpgsql checker, only user interface
> was reduced.
>
> postgres=>  select pg_check_function('f2()');
>                         pg_check_function
> ---------------------------------------------------------------
>   error:42703:3:RETURN:column "missing_variable" does not exist
>   Query: SELECT 'Hello' || missing_variable
>   --                       ^
> (3 rows)
>
> postgres=>  select pg_check_trigger('t','t1');
>                      pg_check_trigger
> --------------------------------------------------------
>   error:42703:3:assignment:record "new" has no field "b"
>   Context: SQL statement "SELECT new.b + 1"
> (2 rows)
>

I did rereview and rechecked with few dozen of real-world functions, and
it still looks good from my point of view. I made bit of adjustment of
english in new comments and Pavel sent me privately fix for proper
handling of languages that don't have checker function. Updated patch
attached.

Regards
Petr Jelinek


Attachment

pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: pg_basebackup streaming issue from standby
Next
From: Alvaro Herrera
Date:
Subject: check function patch