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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Select all fields except one




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...

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.




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group