Skip site navigation (1) Skip section navigation (2)

Re: Column Headings using Comment?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: tully <none(at)noemail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Column Headings using Comment?
Date: 2004-03-02 19:00:29
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
tully wrote:
> Is there an option for psql to use the entry in Comments for "pretty"
> column headings in a report?  For example, instead of printing the
> column name of "last" in the heading, the option would print "Last
> Name" that is contained in the Comments field.   
> The only two alternatives I've found so far is to use "SELECT AS" or
> to mangle the "\d+" output from psql with awk, which are both
> cumbersome solutions, especially when a "select *" is possible.  
> Can anyone help?     

Ideally, you could do something like:

	SELECT 1 AS (SELECT description FROM pg_description WHERE ...);

but we don't support subqueries in AS clauses.

  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to


pgsql-novice by date

Next:From: JoeDate: 2004-03-03 05:35:38
Subject: Re: Initializing tables from flat files
Previous:From: Bruce MomjianDate: 2004-03-02 16:34:57
Subject: Re: current_query in pg_stat_activity

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group