Re: BUG #5419: Default parameters in PLPGSQL functions skipping every other value in pgAdmin view

Lists: pgsql-bugs
From: "Cris Pond" <cpondwork(at)yahoo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5419: Default parameters in PLPGSQL functions skipping every other value in pgAdmin view
Date: 2010-04-13 22:08:43
Message-ID: 201004132208.o3DM8h4j083531@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5419
Logged by: Cris Pond
Email address: cpondwork(at)yahoo(dot)com
PostgreSQL version: 8.4.2
Operating system: Ubuntu 9.10 kernel linux 2.6.31-20-generic
Description: Default parameters in PLPGSQL functions skipping every
other value in pgAdmin view
Details:

I define a function as such:

create or replace function _users (
_mode varchar (1) default null,
_id int4 default null,
_username varchar default null,
_encryptedpassword varchar default null,
_accountenabled bool default null,
_administrationenabled bool default null,
...

It compiles and functions correctly.

When I go to the pgAdmin interface to view the function, it skips the
default value for every other parameter! Like so:

CREATE OR REPLACE FUNCTION _users(
_mode character varying DEFAULT NULL::character varying,
_id integer,
_username character varying DEFAULT NULL::integer,
_password character varying,
_accountenabled boolean DEFAULT NULL::character varying,
_administrationenabled boolean,

...

You can see the types are mismatched, and the function won't compile.

Oddly enough, this error does not occur in the M$ version of Postgres.

Am I doing something wrong, or is this really a bug?


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Cris Pond" <cpondwork(at)yahoo(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5419: Default parameters in PLPGSQL functions skipping every other value in pgAdmin view
Date: 2010-04-14 04:00:54
Message-ID: 15961.1271217654@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"Cris Pond" <cpondwork(at)yahoo(dot)com> writes:
> ... When I go to the pgAdmin interface to view the function, it skips the
> default value for every other parameter!

Sounds like a pgAdmin bug ... but you didn't say which pgAdmin version
you're using.

regards, tom lane


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Cris Pond <cpondwork(at)yahoo(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5419: Default parameters in PLPGSQL functions skipping every other value in pgAdmin view
Date: 2010-04-14 06:36:25
Message-ID: v2i162867791004132336s8e361a49ua33bebeb868aa082@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

2010/4/14 Cris Pond <cpondwork(at)yahoo(dot)com>:
>
> The following bug has been logged online:
>
> Bug reference:      5419
> Logged by:          Cris Pond
> Email address:      cpondwork(at)yahoo(dot)com
> PostgreSQL version: 8.4.2
> Operating system:   Ubuntu 9.10 kernel linux 2.6.31-20-generic
> Description:        Default parameters in PLPGSQL functions skipping every
> other value in pgAdmin view
> Details:
>
> I define a function as such:
>
> create or replace function _users (
>        _mode varchar (1) default null,
>        _id int4 default null,
>        _username varchar default null,
>        _encryptedpassword varchar default null,
>        _accountenabled bool default null,
>        _administrationenabled bool default null,
> ...
>
> It compiles and functions correctly.
>
> When I go to the pgAdmin interface to view the function, it skips the
> default value for every other parameter!  Like so:
>
> CREATE OR REPLACE FUNCTION _users(
>        _mode character varying DEFAULT NULL::character varying,
>        _id integer,
>        _username character varying DEFAULT NULL::integer,
>        _password character varying,
>        _accountenabled boolean DEFAULT NULL::character varying,
>        _administrationenabled boolean,
>
> ...
>
> You can see the types are mismatched, and the function won't compile.
>
> Oddly enough, this error does not occur in the M$ version of Postgres.
>
> Am I doing something wrong, or is this really a bug?

probably you use old pgAdmin without support DEFAULT values :(.
Please, try to actualise your pgAdmin.

Regards
Pavel Stehule

>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
>