Thread: Bug: Default parameters in functions not being maintained in pgAdmin definition

Bug: Default parameters in functions not being maintained in pgAdmin definition

From
"Paragon Corporation"
Date:
I'm using 1.16 beta 4 on Windows (the version that comes with EDB PostgreSQL
9.2RC1)

When I do this:

CREATE OR REPLACE FUNCTION test_defaults(param_int integer, param_def text
DEFAULT NULL::text) RETURNS text AS
$$
SELECT $2;
$$
language sql; 


Then right click or look in code paid to see the function created, it shows
this:

CREATE OR REPLACE FUNCTION public.test_defaults(param_int integer, param_def
text) RETURNS text AS
$BODY$
SELECT $2;
$BODY$ LANGUAGE sql VOLATILE COST 100;


As a result I can' reuse  it becauseit says default parameters can't be
changed.

Thanks,
Regina





Re: Bug: Default parameters in functions not being maintained in pgAdmin definition

From
Guillaume Lelarge
Date:
On Fri, 2012-09-07 at 11:02 -0400, Paragon Corporation wrote:
> I'm using 1.16 beta 4 on Windows (the version that comes with EDB PostgreSQL
> 9.2RC1)
> 
> When I do this:
> 
> CREATE OR REPLACE FUNCTION test_defaults(param_int integer, param_def text
> DEFAULT NULL::text) 
>  RETURNS text AS
> $$
> SELECT $2;
> $$
> language sql; 
> 
> 
> Then right click or look in code paid to see the function created, it shows
> this:
> 
> CREATE OR REPLACE FUNCTION public.test_defaults(param_int integer, param_def
> text)
>   RETURNS text AS
> $BODY$
> SELECT $2;
> $BODY$
>   LANGUAGE sql VOLATILE
>   COST 100;
> 
> 
> As a result I can' reuse  it becauseit says default parameters can't be
> changed.
> 

Works for me on 1.16.0. Can you try on the final release, please?


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com