On Tue, Jun 30, 2009 at 03:16:09PM -0700, David Wheeler wrote:
> On Jun 30, 2009, at 3:05 PM, David Fetter wrote:
>>>> Would this be the first C piece? If not, it might be worth
>>> I don't understand the question.
>> I was thinking of this as part of PgTAP.
> Oh. There is a piece of C, but it's just an implementation of
> pg_typeof() so that pgTAP can use it in versions of PostgreSQL <
> 8.4. In 8.4 and later, no C code is built. Have been trying to
> keep it that way for now.
OK, so the can is already open, but you're trying to discourage the
worms from escaping. :)
>>> But yes, I think it'd be worth doing. I'd like to have functions
>>> pg_record_attrs(RECORD) RETURNS SETOF regtype
>>> And maybe another function to return attribute names. If it could
>>> returns both names and types, that'd be cool, but I'm not sure what
>>> of data type that would be.
>> It's possible to have it return SETOF RECORD with OUT parameters, I
> Out parameters?
CREATE OR REPLACE FUNCTION pg_record_info(
IN r RECORD,
OUT "regtype" RETYPE,
OUT "name" NAME,
) RETURNS SETOF RECORD
AS 'filename', 'pg_record_info';
> I was thinking of SETOF RECORD with two attributes in each record:
> name and type. Are there other attributes of RECORD attributes that
> might be of interest?
>>> Does this sound interesting to other folks?
>> Sure. Maybe that should go in pg_catalog in 8.5...
> Right, that was my thought. I could then throw it in pgTAP when
> building on < 8.5.
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
In response to
pgsql-hackers by date
|Next:||From: Stephen Frost||Date: 2009-07-01 01:05:55|
|Subject: Re: 8.5 development schedule|
|Previous:||From: David E. Wheeler||Date: 2009-06-30 22:16:09|
|Subject: Re: Inconsistent Errors on Row Comparisons|