1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-12 21:01:52 +03:00

Add validator to PL/Python

Jan Urbański, reviewed by Hitoshi Harada
This commit is contained in:
Peter Eisentraut
2011-02-01 22:53:40 +02:00
parent 6c6e6f7fd3
commit 15f55cc38a
10 changed files with 259 additions and 7 deletions

View File

@ -2,6 +2,29 @@
-- the trigger handler once. the errors and subsequent core dump were
-- interesting.
/* Flat out Python syntax error
*/
CREATE FUNCTION python_syntax_error() RETURNS text
AS
'.syntaxerror'
LANGUAGE plpythonu;
/* With check_function_bodies = false the function should get defined
* and the error reported when called
*/
SET check_function_bodies = false;
CREATE FUNCTION python_syntax_error() RETURNS text
AS
'.syntaxerror'
LANGUAGE plpythonu;
SELECT python_syntax_error();
/* Run the function twice to check if the hashtable entry gets cleaned up */
SELECT python_syntax_error();
RESET check_function_bodies;
/* Flat out syntax error
*/
CREATE FUNCTION sql_syntax_error() RETURNS text