Re: Select all fields except one

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: "Matt Doughty" <matt(dot)doughty(at)geograma(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Select all fields except one
Date: 2007-11-28 17:28:43
Message-ID: D7FF158337303A419CF4A183F48302D60364638A@hdsmsx411.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

There's probably some way to pull all the field names from the metadata
tables and build a query on-the-fly that selects all but the offensive
one.

________________________________

From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Matt Doughty
Sent: Wednesday, November 28, 2007 11:07 AM
To: pgsql-general(at)postgresql(dot)org
Subject: [GENERAL] Select all fields except one

Hi,

Is there a way of selecting all fields except for one in particular? I'd
like to create a query that says something like:

select * except fieldx

What I'm hoping to achieve is a query that can be valid for a number of
different tables, although the field I don't want to select is always
called the same (field_not_wanted, for example). I've been told that an
array could work in this case but I'm not reallly sure about how to go
about this.


Cheers,

Matt

Matt Doughty

GEOGRAMA S.L.

Tel.: +34 945 13 13 72 652 77 14 15

Fax: +34 945 23 03 40

www.geograma.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2007-11-28 17:32:34 Re: Streaming LIBPQ? Sliding Window in LIBPQ?
Previous Message Ron Johnson 2007-11-28 17:26:50 Re: Select all fields except one