Function returning an array

From: Francesco Casadei <f_casadei(at)libero(dot)it>
To: pgsql-sql(at)postgresql(dot)org
Subject: Function returning an array
Date: 2001-08-23 14:58:30
Message-ID: 20010823165830.A2359@goku.kasby
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I want a function to return an array of two VARCHAR(255).

This works, but does not return VARCHAR(255):
CREATE FUNCTION ins_div(CHAR(8))
RETURNS _varchar
AS '...'
LANGUAGE 'plpgsql';

These don't work:
CREATE FUNCTION ins_div(CHAR(8))
RETURNS _varchar(255)
AS '...'
LANGUAGE 'plpgsql';

CREATE FUNCTION ins_div(CHAR(8))
RETURNS varchar(255)[2]
AS '...'
LANGUAGE 'plpgsql';

CREATE FUNCTION ins_div(CHAR(8))
RETURNS varchar[2](255)
AS '...'
LANGUAGE 'plpgsql';

CREATE FUNCTION ins_div(CHAR(8))
RETURNS setof varchar(255)
AS '..'
LANGUAGE 'plpgsql';

What's the correct syntax to return two VARCHAR(255)?

Francesco Casadei

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-08-23 15:44:37 Re: Function returning an array
Previous Message Gregory Wood 2001-08-23 14:48:19 Re: protected ON DELETE CASCADE