Re: column order - Mailing list pgsql-general

From
Subject Re: column order
Date
Msg-id Pine.LNX.4.10.10010061225050.5809-100000@chapelperilous.net
Whole thread Raw
In response to column order  (Robert Kernell <kernell@sundog.larc.nasa.gov>)
List pgsql-general
On Fri, 6 Oct 2000, Robert Kernell wrote:

> I know how to add a new column to a table. But it always puts it as
> the last column. How can I add a new column and make it, say, the
> second column? Is this possible?

I don't believe so.  But in general, it doesn't make any difference what
order the fields are in internally.  You can specify the order they get
displayed or inserted into in your SQL.  If your fields are in this order:

f3 f1 f2

You can still do :

INSERT INTO table(f1,f2,f3) VALUES ('value1','value2','value3');

or

SELECT f1,f2,f3 FROM table;

You could always create a view to rearrange the fields into the order you
desire also.

Brett W. McCoy
                                              http://www.chapelperilous.net
---------------------------------------------------------------------------
Calm down, it's *____only* ones and zeroes.


pgsql-general by date:

Previous
From: Robert Kernell
Date:
Subject: column order
Next
From: Frank Joerdens
Date:
Subject: How does TOAST compare to other databases' mechanisms?