Re: [REVIEW] prepare plans of embedded sql on function start

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andy Colson <andy(at)squeakycode(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [REVIEW] prepare plans of embedded sql on function start
Date: 2011-10-05 12:33:29
Message-ID: CAFj8pRAWwO6K1XTao+qbXUc7RXuB8gAGksmYmyxQMvCcJx1adA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

this is initial version of CHECK FUNCTION | CHECK TRIGGER statement

usage is simple

postgres=# CHECK FUNCTION f();
CHECK FUNCTION
Time: 3,411 ms
postgres=# CHECK TRIGGER foo ON omega ;
NOTICE: checking function "trg()"
CHECK TRIGGER
Time: 73,139 ms
postgres=# select plpgsql_checker('f()'::regprocedure, 0);
plpgsql_checker
─────────────────

(1 row)

Time: 0,861 ms

second parameter of plpgsql_checker function is relation oid that is
used for trigger checking. A possibility batch checking is reason why
I used new PL function.

when function has a bug, then CHECK FUNCTION show it

postgres=# CHECK FUNCTION fx();
ERROR: column "z" does not exist
LINE 1: SELECT exists(select * from omega where z = 1)
^
QUERY: SELECT exists(select * from omega where z = 1)
CONTEXT: PL/pgSQL function "fx" line 4 at IF
postgres=#

autocomplete in psql is supported

Regards

Pavel Stehule

Attachment Content-Type Size
check_function.diff text/x-patch 71.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2011-10-05 12:59:47 Re: Double sorting split patch
Previous Message Alvaro Herrera 2011-10-05 11:43:54 Re: Displaying accumulated autovacuum cost