Re: anonymous composite types - how to pass tupdesc to the function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: anonymous composite types - how to pass tupdesc to the function
Date: 2002-08-26 19:11:04
Message-ID: 1911.1030389064@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joe Conway <mail(at)joeconway(dot)com> writes:
> I'm trying to come up with the best method to pass the query string
> columndef, or better yet the tuple description, to the function. Any
> suggestions on an approach?

Can't it get it for itself from the results of the query, ie, look at
PQftype() and so on to build a tupledesc?

I guess there are some gotchas with inconsistent type OIDs between
remote and local databases, but that still seems much less of a risk
than manual errors in giving the columnset definition. You could at
least check that PQfsize matches the local type's typlen as a way of
detecting chance collisions of user-defined type OIDs.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Enbom 2002-08-26 19:50:27 Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?
Previous Message Tom Lane 2002-08-26 19:01:37 Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?