Skip site navigation (1) Skip section navigation (2)

Newbiee Pls help.....

From: woow <ruwanb(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Newbiee Pls help.....
Date: 2011-07-29 15:16:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
I have following function expectation is I want to return the items in array
so....I could call this from another function where I could traverse through
the each array element....

CREATE OR REPLACE FUNCTION get_role_id_list_for_type(INTEGER)
        RETURNS INTEGER[]  AS $$
      rolelist INTEGER [];
      SELECT INTO rolelist role_id FROM roles WHERE role_type = $1;
      RETURN rolelist;
$$ LANGUAGE 'plpgsql';

But when I call the function it gives following error......

ERROR:  array value must start with "{" or dimension information
CONTEXT:  PL/pgSQL function "get_role_id_list_for_type" line 4 at select
into variables

Could someone please help.....thanks so much in advance

View this message in context:
Sent from the PostgreSQL - general mailing list archive at


pgsql-general by date

Next:From: Kevin GrittnerDate: 2011-07-29 15:25:38
Subject: Re: [PERFORM] Queries related to checkpoints
Previous:From: Peter EisentrautDate: 2011-07-29 14:32:01
Subject: Re: query_to_xml nulls set to false

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group