Re: [NOVICE] column and table names

From: John DeSoi <desoi(at)pgedit(dot)com>
To: stephen <mail(at)xesoftware(dot)com(dot)au>
Cc: "pgsql-general postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [NOVICE] column and table names
Date: 2007-04-27 00:27:24
Message-ID: 34F26920-0C34-4059-837A-25CC4AB4EE14@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Try this:

select column_name from information_schema.columns where table_name =
'tablename' order by ordinal_position;

On Apr 26, 2007, at 6:11 PM, stephen wrote:

> Thanks, that worked ;-( but is there any way of ordering the column
> names by their natural order in the table - same as the order in the
> view?

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2007-04-27 00:34:43 Re: Processing a work queue
Previous Message Tom Lane 2007-04-26 23:51:48 Re: NFS vs. PostgreSQL on Solaris