Re: i have table - Mailing list pgsql-sql

From Aaron Bono
Subject Re: i have table
Date
Msg-id bf05e51c0610040754o101408c2y8a743697b9ceee4@mail.gmail.com
Whole thread Raw
In response to Re: i have table  (Erik Jones <erik@myemma.com>)
Responses Re: i have table  (Erik Jones <erik@myemma.com>)
List pgsql-sql
On 10/4/06, Erik Jones <erik@myemma.com> wrote:
There is one non-SQL related reason that I like to be able to order
columns, at least the way they are displayed whenever the table is
described:  human comprehension.  For example, I like to group all keys
in a table before data, that includes primary as well as foreign keys.
So, say I'm building on to an existing application and I need to do an
ALTER TABLE on an existing table to add a foreign key to an existing
table.  I'd like that key to be listed with the other keys, but
presently that's not possible in a simple way and, to be honest, I
usually just go without as the process you've described below is too
prone to user (human) error when dealing with live, sensitive data for
me to want to mess with it.

Ah, but it is possible... if you use views.

I recommend you build views and query off them.  Then you can control the order the columns will appear.

==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
   http://codeelixir.com
==================================================================

pgsql-sql by date:

Previous
From: Erik Jones
Date:
Subject: Re: i have table
Next
From: "Aaron Bono"
Date:
Subject: Re: How to overwrite a table [only data]?