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

From Ron Johnson
Subject Re: Select all fields except one
Date
Msg-id 474DA4DA.6090100@cox.net
Whole thread Raw
In response to Re: Select all fields except one  (Vivek Khera <khera@kcilink.com>)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/28/07 11:18, Vivek Khera wrote:
>
> On Nov 28, 2007, at 11:06 AM, Matt Doughty wrote:
>
>> 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
>>
>>
>
> For best practices, you should never use select * in your queries.  You
> will inevitably end up with code that cannot deal with a schema change,
> and for any live system, you will have a schema change at some point...

Remember back in the late-80s when Data Dictionaries were the rage?
 (Some legacy still have these.)  3GL structs/copybooks can be
auto-generated from the CDD, so any added columns are auto-added to
your record structure.

Of course, you still have to rebuild your apps.

> It is best to explicitly list the field names your code is expecting.
> Besides, I don't think you can do what you want to do with just SQL.

- --
Ron Johnson, Jr.
Jefferson LA  USA

%SYSTEM-F-FISH, my hovercraft is full of eels
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHTaTaS9HxQb37XmcRAiaWAJ9/BiarNsC9UUNyreg8LiIq9+mUKwCeNS/L
1y4DkS4vJbJd15ZbPuwalac=
=QZG7
-----END PGP SIGNATURE-----

pgsql-general by date:

Previous
From: Erik Jones
Date:
Subject: Re: Config settings for large restore
Next
From: mgainty@hotmail.com
Date:
Subject: Re: PostgresSQL vs. Informix