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

From: "Joshua D(dot) Drake" <jd(at)commandprompt(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 06:44:01
Message-ID: 4785BEB1.40006@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ken Johanson 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
>
> I need this to lookup the column names and their ordinal position for a
> given table (implementing a driver call).

Just curious... but why is ordinal position important here?

Joshua D. Drake

>
> Thanks in advance,
> Ken
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gábor Farkas 2008-01-10 06:46:50 Re: vacuum, dead rows, usual solutions didn't help
Previous Message Joshua D. Drake 2008-01-10 06:41:06 Re: vacuum, dead rows, usual solutions didn't help