Query to get column-names in table via PG tables?

From: Ken Johanson <pg-user(at)kensystem(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Query to get column-names in table via PG tables?
Date: 2008-01-10 06:37:50
Message-ID: 4785BD3E.2010805@kensystem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I am looking for expertise on how to program the equivalent to this
query, but using the pg_catalog tables, which I understand have fewer
security restrictions than information_schema in some cases:

SELECT column_name
FROM information_schema.columns
WHERE table_catalog=? AND table_schema=? AND table_name=?
ORDER BY ordinal_position

I need this to lookup the column names and their ordinal position for a
given table (implementing a driver call).

Thanks in advance,
Ken

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2008-01-10 06:41:06 Re: vacuum, dead rows, usual solutions didn't help
Previous Message Tom Lane 2008-01-10 06:26:24 Re: vacuum, dead rows, usual solutions didn't help