Get column list from Postgres Query

From: PANAGIOTIS GERMANIS <pgermanis(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Get column list from Postgres Query
Date: 2011-02-19 23:42:48
Message-ID: 595BC672-8542-4233-8BDA-17C6DC6F679F@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I want to get the names, the type and the length of all columns in a postgres query using c-api calls.
For example from:
SELECT customers.id, customers.name, transaction.date, transaction.amount FROM customers, transactions

I must get:

customers.id,
customers.name,
transaction.date,
transaction.amount

How can I achieve this??

Thanks in advance

___________________________________
Panos Germanis
Software Engineer
pgermanis(at)gmail(dot)com
mob: 6944339998

"Peace cannot be kept by force. It can only be achieved by understanding."
(Albert Einstein)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2011-02-19 23:59:29 Re: Get column list from Postgres Query
Previous Message Karsten Hilbert 2011-02-19 22:23:03 Re: problematic view definition