Instaltiating an ARRAY within a function - Mailing list pgsql-general

From Abraham, Danny
Subject Instaltiating an ARRAY within a function
Date
Msg-id E9DE7963E5EA6546B42A979EC28B4D0136B28ED5@hou-ex-02.adprod.bmc.com
Whole thread Raw
Responses Re: Instaltiating an ARRAY within a function
Re: Instaltiating an ARRAY within a function
List pgsql-general
===========================================

CREATE OR REPLACE FUNCTION arr( inout x varchar[] )
AS
$Z$
DECLARE
  i integer;
BEGIN
select ARRAY['Danny','Eissam','Moshe'] into x;
end;
$Z$ LANGUAGE 'plpgsql' VOLATILE;

===========================================

CREATE OR REPLACE FUNCTION callarr()
returns integer
AS
$Z$
DECLARE
  x varchar[6];
BEGIN
perform arr(x);
RAISE NOTICE 'x[1]=%',x[1];
return 0;
end;
$Z$ LANGUAGE 'plpgsql' VOLATILE;

===========================================

select callarr();
NOTICE:  x[1]=<NULL>  ??? Should have been DANNY


Should it work?

Thanks

Danny

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Hijack!
Next
From: "Lawrence Oluyede"
Date:
Subject: Re: Possible bug in PostgreSQL 8.3beta4 (postgres process segfaults)