Re: column order

From: <bmccoy(at)chapelperilous(dot)net>
To: Robert Kernell <kernell(at)sundog(dot)larc(dot)nasa(dot)gov>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: column order
Date: 2000-10-06 16:29:40
Message-ID: Pine.LNX.4.10.10010061225050.5809-100000@chapelperilous.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2000-10-06 16:37:08 Re: VIEW problem
Previous Message Robert Kernell 2000-10-06 16:07:35 column order