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

(SETOF) RECORD AS complex_type

From: David Fetter <david(at)fetter(dot)org>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: (SETOF) RECORD AS complex_type
Date: 2006-12-27 22:06:38
Message-ID: 20061227220638.GD22284@fetter.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Folks,

While using DBI-Link, I've noticed a little lacuna in how functions
returning (SETOF) RECORD work, namely, that you have to cast them to
explicit lists of columns, even when that list of columns corresponds
to an existing complex type.

What would be involved in fixing the casting operation so that the
following would work?

CREATE TYPE foo AS (
    a INT4,
    b INT8,
    c POINT,
    d TEXT
);

CREATE FUNCTION bar(output_type TEXT)
RETURNS SETOF RECORD
...

SELECT * FROM bar('foo') AS foo;

Cheers,
D
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2006-12-27 22:07:56
Subject: Re: Load distributed checkpoint
Previous:From: Bruce MomjianDate: 2006-12-27 22:04:34
Subject: Re: [BUGS] BUG #2846: inconsistent and confusing handling of

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