Get column list from Postgres Query

Started by PANAGIOTIS GERMANISabout 15 years ago2 messagesgeneral
Jump to latest
#1PANAGIOTIS GERMANIS
pgermanis@gmail.com

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@gmail.com
mob: 6944339998

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

Attachments:

smime.p7sapplication/pkcs7-signature; name=smime.p7sDownload
#2Scott Ribe
scott_ribe@elevated-dev.com
In reply to: PANAGIOTIS GERMANIS (#1)
Re: Get column list from Postgres Query

On Feb 19, 2011, at 4:42 PM, PANAGIOTIS GERMANIS wrote:

want to get the names, the type and the length of all columns in a postgres query using c-api calls.

This documented pretty clearly in the libpq docs:

<http://www.postgresql.org/docs/9.0/static/libpq.html&gt;

--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice