Hello

Andy Colson found a bug in GUC implementation.

When we have a custom SUSET variable, like plpgsql.variable_conflikt,
then setting this variable before plpgsql initalisation raises a
exception, but it raise a exception when some plpgsql function is
created. Try to execute a attached script - a set statement is ok, but
CREATE FUNCTION fails.

repeated setting this GUC raise a strange message

postgres=# \i script.sql
SET
before create function
psql:script.sql:13: ERROR:  42501: permission denied to set parameter
"plpgsql.variable_conflict"
LOCATION:  set_config_option, guc.c:5208
after function
postgres=# \i script.sql
SET
before create function
psql:script.sql:13: ERROR:  XX000: attempt to redefine parameter
"plpgsql.variable_conflict"
LOCATION:  define_custom_variable, guc.c:6333
after function

Regards

Pavel Stehule
--load 'plpgsql';

\set VERBOSITY verbose

set plpgsql.variable_conflict = use_variable;

\echo before create function

create or replace function test1(a integer) returns integer as $$
begin
return a+1;
end;
$$ language plpgsql;

\echo after function
-- 
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