Friday, June 27, 2014

plpgsql_check is available for PostgreSQL 9.2

Short note: I did backport of plpgsql_check to PostgreSQL 9.2.

What is plpgsql_check? It is plpgsql validator without necessity to run checked function and all paths inside.
postgres=# select oid::regprocedure, plpgsql_check_function(oid::regprocedure) from pg_proc where prolang = 12599 and prorettype <> 2279;
      oid      │                         plpgsql_check_function                          
───────────────┼─────────────────────────────────────────────────────────────────────────
 bubu(integer) │ error:42702:3:RETURN:column reference "a" is ambiguous
 bubu(integer) │ Query: SELECT (select * from t where t.a = a)
 bubu(integer) │ --                                         ^
 bubu(integer) │ Detail: It could refer to either a PL/pgSQL variable or a table column.
(4 rows)

Time: 4.857 ms

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home