From: | Ernest E Vogelsinger <ernest(at)vogelsinger(dot)at> |
---|---|
To: | "Bruno BAGUETTE" <pgsql-ml(at)baguette(dot)net> |
Cc: | "'Nigel J(dot) Andrews'" <nandrews(at)investsystems(dot)co(dot)uk>, "'Sven Köhler'" <skoehler(at)upb(dot)de>, <pgsql-general(at)postgresql(dot)org> |
Subject: | RE : full featured alter table? |
Date: | 2003-06-15 22:13:45 |
Message-ID: | 5.1.1.6.2.20030616000519.02deaa78@mail.vogelsinger.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
At 23:30 15.06.2003, Bruno BAGUETTE said:
--------------------[snip]--------------------
>> If some frontende decides to display the columns in a
>> particular order, ok, but it should store this order
>> somewhere else, either in its own private tables, a
>> configuration or ini file, or elsewhere. It simply doesn't
>> belong to the database layout, or pg_attribute.
>
>I disagree, I don't like when frontends and other GUI are creating new
>tables in the database. Plus, if I use a frontend (pgAdmin, for example)
>to set the columns order, I want to get that presentation order when I
>do a SELECT * using the PostgreSQL API or using the psql frontend...
>
>So, storing the columns order in the pg_attributes table is, I think, a
>good solution. :-)
--------------------[snip]--------------------
This may come in handy of you're the only one using the database.
What if:
a) multiple users/developers are "maintaining" their own "private" column
ordering?
b) what happens to those (poorly written but existing) applications that
use columnless INSERTs? Will they break or what?
I don't think changing the column order in pg_attributes would be a good
thing - too much to break loose. Maybe there could be something non-SQL
conforming
CREATE COLUMNORDER "order_name" ON TABLE "table_name" ("column", ...)
and you could use this with a SELECT extension:
SELECT * FROM "table_name" COLUMNORDER "order_name"
but that can be easily done using views:
CREATE VIEW "viewname" AS SELECT (col3, col5, col2) FROM "table_name"
Well, views are read-only unless you're using an appropriate rule.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2003-06-15 22:30:08 | Re: Optimizer failure on update w/integer column |
Previous Message | nolan | 2003-06-15 22:08:50 | Why can't you define a table alias on an update? |