Multiple return 'columns' from postgre pl/pgsql

From: Steve Tucknott <steve(at)retsol(dot)co(dot)uk>
To: PostGre <pgsql-novice(at)postgresql(dot)org>
Subject: Multiple return 'columns' from postgre pl/pgsql
Date: 2004-08-08 19:00:56
Message-ID: 1091991658.2257.9.camel@retsol1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Is there a way of doing:
RETURNS INTEGER, CHAR(5), VARCHAR(200),.....
IE return multiple values from a PL/PGSQL function?

(From what I can see so far, you only have 1 return field - although
that can be a rowtype or record)

I am converting Informix functions, and returning multiple columns was
allowed - I need to be able to do the same/similar in PostGre. What's
the best way?

(Typically the functions return an error code, error text (that are not
table based - ie are built in the function and not selected from a
table) and two or three columns from a table).

Regards,

Steve Tucknott

ReTSol Ltd

DDI: 01903 828769

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2004-08-08 20:26:10 Re: Multiple return 'columns' from postgre pl/pgsql
Previous Message Michael Glaesemann 2004-08-08 14:06:22 Re: Design question regarding arrays