From: | novnov <novnovice(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Reordering columns, will this ever be simple? |
Date: | 2007-08-07 23:25:28 |
Message-ID: | 12044467.post@talk.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Right, rel theory is fine, but I work with databases all day long and in the
various lists that shows the fields in a table, placing them in some kind of
order, other than chron by creation time, is very useful and efficient. It
may not matter to the database engine but it matters to the human engine, in
this case. Views don't help solve the basic issue. It's not a fatal issue,
just one that would help streamline postgres, IMO.
Josh Trutwin wrote:
>
> On Tue, 7 Aug 2007 11:07:39 -0700 (PDT)
> novnov <novnovice(at)gmail(dot)com> wrote:
>
> <snip>
>
>> Is there any plan to add such a capability to postgres? Is there
>> deep seated reason why reordering columns can't be handled without
>> doing a root canal on the database?
>
> Probably because the theory behind the relational model (at least as
> far as I understand it) is that column and row ordering is irrelevant.
>
> From http://en.wikipedia.org/wiki/Relational_model :
>
> "The relational model requires there to be no significance to any
> ordering of the attributes of a relation."
>
> Just like if you do a SELECT * that the order of the rows returned
> could change at any time unless you specify an ORDER BY clause.
>
> That said, most people I imagine like being able to "re-order" the
> columns that a SELECT * produces.
>
>> If there already is some simple way to reorder columns, please let
>> me know.
>
> CREATE VIEW my_favorite_order AS
> SELECT col2, col1, col5, col4, etc
> FROM base_table;
>
> SELECT * FROM my_favorite_order;
>
> Only drawback is that you have to re-build the view if the column
> names in the base table change.
>
> Josh
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>
>
--
View this message in context: http://www.nabble.com/Reordering-columns%2C-will-this-ever-be-simple--tf4231761.html#a12044467
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
From | Date | Subject | |
---|---|---|---|
Next Message | Gregory Williamson | 2007-08-07 23:59:18 | Re: List tables in load order |
Previous Message | Ben | 2007-08-07 23:06:42 | Re: Take your postgresSql on the road, and live to tell of it. |