<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Matt Doughty wrote:
<blockquote
 cite="mid8A38B86D9187B34FA18766E261AB3AEA0D205C@sageograma.GEO-I.local"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
  <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EstiloCorreo17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
        {page:Section1;}
-->
  </style>
  <div class="Section1">
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Hi,<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Is there a
way of selecting all fields except one in
particular? I’d like to create a query that says something like: select
*
except field01.  The thing is the query needs to be valid for a number
of
different tables, each with a different set of fields apart from one
(gid),
which I don’t want to select.</span></font></p>
  </div>
</blockquote>
Well, you could do the following:<br>
<br>
begin transaction;<br>
alter table table_name drop column field01;<br>
select * from table_name;<br>
rollback;<br>
<br>
I think that should work.  Keep in mind that you wouldn't want to
commit the transaction, or you would lose the column data.<br>
<br>
Don't try this in other databases, PostgreSQL's DDL is transaction
safe...so you can do such things.<br>
<br>
Hope that helps<br>
<br>
<pre class="moz-signature" cols="72">-- 
Chander Ganesan
The Open Technology Group
One Copley Parkway, Suite 210
Morrisville, NC  27560
Phone: 877-258-8987/919-463-0999
<a class="moz-txt-link-freetext" href="http://www.otg-nc.com">http://www.otg-nc.com</a>
Export PostgreSQL Training
</pre>
<br>
</body>
</html>