Re: Datatyp of a column

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ishaya Bhatt <ishayabhatt(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Datatyp of a column
Date: 2013-11-11 14:28:54
Message-ID: 16935.1384180134@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ishaya Bhatt <ishayabhatt(at)gmail(dot)com> writes:
> In the sorting code, I need to determine the datatype of my sort keys
> and call some code conditionally based on the datatype. Is there any way to
> determine the datatype of a column from the *backend* PostGreSQL code. is
> the datatype of the column available in the query plan? Any help on this
> would be very much appreciated.

You really need to be more specific about where you need this information.
The "sorting code" certainly knows what datatypes it's working with ---
for example, in tuplesort.c there's a TupleDesc for the tuples passing
through the sort, and the column types are available from the per-column
atttypid fields of that. But it's not clear if that's what you're talking
about.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Colin 't Hart 2013-11-11 14:31:40 Re: Execute query with EXCEPT, INTERSECT as anti-join, join?
Previous Message Andrew Dunstan 2013-11-11 14:28:51 Re: pg_dump and pg_dumpall in real life