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: reduced_pl_checker_2012-03-08_3.patch.gz
Description: application/gzip

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to