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

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Ken Johanson" <pg-user(at)kensystem(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query to get column-names in table via PG tables?
Date: 2008-01-10 13:56:11
Message-ID: b42b73150801100556h7b86a335ve633e9ea43a2834b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jan 10, 2008 1:37 AM, Ken Johanson <pg-user(at)kensystem(dot)com> wrote:
> 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

Do what psql does...launch it with psql -E, and it will echo any
internal queries it makes back to you. Do \d on a couple of tables
and you should see what is going on.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sim Zacks 2008-01-10 14:40:04 8.2.4 serious slowdown
Previous Message Alvaro Herrera 2008-01-10 13:49:17 Re: count(*) and bad design was: Experiences with extensibility