Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 57A949FA1E8 for ; Tue, 31 Jul 2007 04:54:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 18575-03 for ; Tue, 31 Jul 2007 04:54:18 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.188]) by postgresql.org (Postfix) with ESMTP id 46B9E9FA17C for ; Tue, 31 Jul 2007 04:54:18 -0300 (ADT) Received: by mu-out-0910.google.com with SMTP id i10so2619044mue for ; Tue, 31 Jul 2007 00:54:16 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:subject:cc:in-reply-to:mime-version:content-type:references; b=tPo3fwoxNe17yWup72E5nhqrQeK9yuvixwvsAXX1aFJGlJWYayc6FC+AeeRWokQAhX222jztQZYARiqmBc/z0hQreb/wfcNenR+I2oFO658t5rQtl+Qelud8svk9xGJnqtsuq5KpyHiDsVOkuhvbRDUENp8G0ziW1Zw9GkKojpM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:subject:cc:in-reply-to:mime-version:content-type:references; b=QMAf5KX+1K0/Qgg+As8husaU++XjYOxcOXbsxmWAiteFaCpFPWZ+8A6inP3fE/fn/GeJRnKHgGFOxRhIe1JdAmZcqOjU9x4SlryX9lxR6UB2FxxihAGLjTm24UWlY9O90GEjAeZWMvdISOVaciiEES+aTGRiZQz85c8nYgdifBY= Received: by 10.78.131.8 with SMTP id e8mr1719625hud.1185868456052; Tue, 31 Jul 2007 00:54:16 -0700 (PDT) Received: by 10.78.150.17 with HTTP; Tue, 31 Jul 2007 00:54:15 -0700 (PDT) Message-ID: Date: Tue, 31 Jul 2007 08:54:15 +0100 From: "Peter Childs" Subject: Re: [NOVICE] alter table table add column Cc: pgsql-general@postgresql.org In-Reply-To: <1185863848.28634.19.camel@localhost> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_24868_25222977.1185868455902" References: <1185855587.28634.6.camel@localhost> <7F69A56D-27E8-43EE-BD1C-AB52C042B533@seespotcode.net> <1185859391.28634.17.camel@localhost> <3345E320-08CF-465E-93AC-DAFBD59AA35C@seespotcode.net> <1185863848.28634.19.camel@localhost> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/1196 X-Sequence-Number: 117797 ------=_Part_24868_25222977.1185868455902 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 31/07/07, Ronald Rojas wrote: > > Oh yes you have a good point. But then I will still have to test insert > and update on views. > > Thanks a lot michael! > > On Tue, 2007-07-31 at 00:56 -0500, Michael Glaesemann wrote: > > On Jul 31, 2007, at 0:23 , Ronald Rojas wrote: > > Yes I know that procedure but I would like to insert in between > because I have at third party software that will call the said > schema and one of its dependencies with the mapping is it should > have the correct order with what the receiving end will be use for > the mapping. And in this case, I can't modify the receiving > structure (third-party) and the tables that I will be using is in > on production state. So would only mean that I have to schedule a > very fast maintenance, probably 5 to 10 secs just to re-initialize > the tables. > Another option would be to use views to change the column order, which would work for selects. I believe you could create rules for insert and update as well, if necessary. Perhaps this would be a solution to your problem. > Michael Glaesemanngrzm seespotcode net > > But really you should not be using select * from ... anyway, Always list your column names, That way you will aways get the columns in the order you want rather than in the order they are stored. This really belongs in a FAQ Peter. ------=_Part_24868_25222977.1185868455902 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On 31/07/07, Ronald Rojas <ronald.rojas@gmail.com> wrote:
Oh yes you have a good point. But then I will still have to test insert and update on views.

Thanks a lot michael!

On Tue, 2007-07-31 at 00:56 -0500, Michael Glaesemann wrote:
On Jul 31, 2007, at 0:23 , Ronald Rojas wrote:

> Yes I know that procedure but I would like to insert in between  
> because I have at third party software that will call the said  
> schema and one of its dependencies with the mapping is it should  
> have the correct order with what the receiving end will be use for  
> the mapping. And in this case, I can't modify the receiving  
> structure (third-party) and the tables that I will be using is in  
> on production state. So would only mean that I have to schedule a  
> very fast maintenance, probably 5 to 10 secs just to re-initialize  
> the tables.

Another option would be to use views to change the column order,  
which would work for selects. I believe you could create rules for  
insert and update as well, if necessary. Perhaps this would be a  
solution to your problem.

Michael Glaesemann
grzm seespotcode net


But really you should not be using select * from ... anyway,
Always list your column names, That way you will aways get the columns in the order you want rather than in the order they are stored.

This really belongs in a FAQ

Peter.
------=_Part_24868_25222977.1185868455902--