Обсуждение: Bug report - Version 1.20.0 REL-1_20_0

Поиск
Список
Период
Сортировка

Bug report - Version 1.20.0 REL-1_20_0

От
Dave Barter
Дата:
<div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px;
line-height:auto;">Pgadmin cannot cope with default function parameters that are text arrays:-</div><div
id="bloop_customfont"style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px;
line-height:auto;"><br /></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color:
rgba(0,0,0,1.0);margin: 0px; line-height: auto;"><br /></div><div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><div
id="bloop_customfont"style="margin: 0px;">CREATE OR REPLACE FUNCTION ng_research.test(</div><div id="bloop_customfont"
style="margin:0px;">    filter_param json, </div><div id="bloop_customfont" style="margin: 0px;"><span
class="Apple-tab-span"style="white-space:pre"> </span>prefix_param character varying DEFAULT 'attributes'::character
varying, </div><divid="bloop_customfont" style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">
</span>column_prefixescharacter varying[] DEFAULT ARRAY['FA'::text,'FT'::text, 'F'::text, 'FTA'::text, 'FH'::text,
'WI'::text,'WIT'::text, 'WIS'::text, 'WQ'::text, 'A'::text, 'FILTERS'::text]</div><div id="bloop_customfont"
style="margin:0px;"><span class="Apple-tab-span" style="white-space:pre"> </span>) RETURNS json as </div><div
id="bloop_customfont"style="margin: 0px;">$$</div><div id="bloop_customfont" style="margin: 0px;">BEGIN</div><div
id="bloop_customfont"style="margin: 0px;"><br /></div><div id="bloop_customfont" style="margin: 0px;">END;</div><div
id="bloop_customfont"style="margin: 0px;">$$</div><div id="bloop_customfont" style="margin: 0px;">LANGUAGE
PLPGSQL</div><divid="bloop_customfont" style="margin: 0px;"><br /></div><div id="bloop_customfont" style="margin:
0px;">Displaysas:-</div><div id="bloop_customfont" style="margin: 0px;"><br /></div><div id="bloop_customfont"
style="margin:0px;"><div id="bloop_customfont" style="margin: 0px;">CREATE OR REPLACE FUNCTION
ng_research.test(</div><divid="bloop_customfont" style="margin: 0px;">    filter_param json DEFAULT
'attributes'::charactervarying,</div><div id="bloop_customfont" style="margin: 0px;">    prefix_param character varying
DEFAULTARRAY['FA'::text,</div><div id="bloop_customfont" style="margin: 0px;">    column_prefixes character varying[]
DEFAULT'FT'::text)</div><div id="bloop_customfont" style="margin: 0px;">  RETURNS json AS</div><div
id="bloop_customfont"style="margin: 0px;">$BODY$</div><div id="bloop_customfont" style="margin: 0px;">BEGIN</div><div
id="bloop_customfont"style="margin: 0px;"><br /></div><div id="bloop_customfont" style="margin: 0px;">END;</div><div
id="bloop_customfont"style="margin: 0px;">$BODY$</div><div id="bloop_customfont" style="margin: 0px;">  LANGUAGE
plpgsql</div></div></div><br/><div class="bloop_sign" id="bloop_sign_1424868949432649984"><div
style="font-family:helvetica,arial;font-size:13px"><spanstyle="font-size: small; text-align: -webkit-auto; line-height:
normal;orphans: 2; widows: 2; font-family: arial;">-- </span><br style="font-size: small; text-align: -webkit-auto;
line-height:normal; orphans: 2; widows: 2; font-family: arial;" /><span style="font-size: small; text-align:
-webkit-auto;line-height: normal; orphans: 2; widows: 2; font-family: arial;">Dave Barter</span><br style="font-size:
small;text-align: -webkit-auto; line-height: normal; orphans: 2; widows: 2; font-family: arial;" /><br
style="font-size:small; text-align: -webkit-auto; line-height: normal; orphans: 2; widows: 2; font-family: arial;"
/><spanstyle="font-size: small; text-align: -webkit-auto; line-height: normal; orphans: 2; widows: 2; font-family:
arial;">Web: </span><ahref="http://www.phased.co.uk/" style="font-size: small; text-align: -webkit-auto; line-height:
normal;orphans: 2; widows: 2; font-family: arial;" target="_blank">http://www.phased.co.uk</a><br style="font-size:
small;text-align: -webkit-auto; line-height: normal; orphans: 2; widows: 2; font-family: arial;" /><a
href="mailto:Email%3Adave@phased.co.uk"style="font-size: small; text-align: -webkit-auto; line-height: normal; orphans:
2;widows: 2; font-family: arial;" target="_blank">Email:dave@phased.co.uk</a><br style="font-size: small; text-align:
-webkit-auto;line-height: normal; orphans: 2; widows: 2; font-family: arial;" /><span style="font-size: small;
text-align:-webkit-auto; line-height: normal; orphans: 2; widows: 2; font-family:
arial;">Twitter:@Citizenfishy</span></div></div>

Re: Bug report - Version 1.20.0 REL-1_20_0

От
Leonard Boyce
Дата:
Hi Dave,

Definitely looks like a bug. Using the '{}'::character varying[]
format for the array seems to work fine though.

Example;
CREATE OR REPLACE FUNCTION ng_research.test(   filter_param json,   prefix_param character varying DEFAULT
'attributes'::charactervarying,   column_prefixes character varying[] DEFAULT
 
'{FA,FT,F,FTA,FH,WI,WIT,WIS,WQ,A,FILTERS}'::character varying[]
) RETURNS json as
$$
BEGIN

END;
$$
LANGUAGE PLPGSQL

On Wed, Feb 25, 2015 at 7:58 AM, Dave Barter <dave@phased.co.uk> wrote:
> Pgadmin cannot cope with default function parameters that are text arrays:-
>
>
> CREATE OR REPLACE FUNCTION ng_research.test(
>     filter_param json,
> prefix_param character varying DEFAULT 'attributes'::character varying,
> column_prefixes character varying[] DEFAULT ARRAY['FA'::text,'FT'::text,
> 'F'::text, 'FTA'::text, 'FH'::text, 'WI'::text, 'WIT'::text, 'WIS'::text,
> 'WQ'::text, 'A'::text, 'FILTERS'::text]
> ) RETURNS json as
> $$
> BEGIN
>
> END;
> $$
> LANGUAGE PLPGSQL
>
> Displays as:-
>
> CREATE OR REPLACE FUNCTION ng_research.test(
>     filter_param json DEFAULT 'attributes'::character varying,
>     prefix_param character varying DEFAULT ARRAY['FA'::text,
>     column_prefixes character varying[] DEFAULT 'FT'::text)
>   RETURNS json AS
> $BODY$
> BEGIN
>
> END;
> $BODY$
>   LANGUAGE plpgsql
>
> --
> Dave Barter
>
> Web: http://www.phased.co.uk
> Email:dave@phased.co.uk
> Twitter:@Citizenfishy