Re: Select all fields except one - Mailing list pgsql-general

From David Fetter
Subject Re: Select all fields except one
Date
Msg-id 20071128181452.GE24146@fetter.org
Whole thread Raw
In response to Re: Select all fields except one  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: Select all fields except one  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Select all fields except one  ("Gauthier, Dave" <dave.gauthier@intel.com>)
List pgsql-general
On Wed, Nov 28, 2007 at 09:47:19AM -0800, Joshua D. Drake wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wed, 28 Nov 2007 09:37:43 -0800
> David Fetter <david@fetter.org> wrote:
>
> > On Wed, Nov 28, 2007 at 05:06:45PM +0100, Matt Doughty wrote:
> > > 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).
> >
> > This sounds like self-modifying code.  I'd submit that you're
> > trying to do the wrong thing in the first place, and that you
> > should look over your design for flaws like this and re-do that
> > design.
>
> Or to actually try to be helpful, you could consider using a server
> side function instead:
>
> select * from global_query({},TEXT);

Helping somebody shoot themselves in the foot isn't helping them.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Linux v.s. Mac OS-X Performance
Next
From: "Josh Harrison"
Date:
Subject: Recheck condition