Re: selecting all columns but one

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: selecting all columns but one
Date: 2009-07-28 13:25:02
Message-ID: h4mu7d$as2$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

blackwater dev, 28.07.2009 15:12:
> I have a table with a lot of columns. One of the columns I want to
> alias so have a query of:
>
> select *, column as newname from mytable.
>
> The problem is I now have column and newname in the results. I don't
> want to select column by column. How can I do a select * but omit one?

You need to list all columns that you want explicitely.

Using SELECT * in a production application is considered bad practice anyway

Thomas

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2009-07-28 13:25:28 Re: Upgrading from 8.3 to 8.4 and Integer datatimes?
Previous Message Merlin Moncure 2009-07-28 13:24:52 Re: selecting all columns but one