Re: Re-order columns?

From: Olivier Gautherot <ogautherot(at)gautherot(dot)net>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Holger Jakobs <holger(at)jakobs(dot)com>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>, Wells Oliver <wells(dot)oliver(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Re-order columns?
Date: 2020-07-29 21:18:10
Message-ID: CAJ7S9TUzW8duibb+WMxsu1nSJ-YW9Z1pRsMrQ1_=vU8Jsn=eiw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

David,

On Wed, Jul 29, 2020 at 11:11 PM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Wednesday, July 29, 2020, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
> wrote:
>
>> On Wednesday, July 29, 2020, Holger Jakobs <holger(at)jakobs(dot)com> wrote:
>>
>>>
>>> That columns appear to have some kind of order and show in tools with a
>>> stable order has technical reasons and is not rooted in relational theory.
>>>
>>
>> Technical reasons are real reasons. The order of columns is very real,
>> guaranteed (beware of inherits), thing in PostgreSQL whereas there is no
>> guarantee regarding row order outside of a select query order by. That
>> said I do agree that fulfilling “ocd” drives isn’t a strong use case to
>> work on the feature.
>>
>
> As for the theory, a tuple is an ordered list so the ordering of columns
> is a precise application of that definition and a relation is just a set
> (i.e., unordered) of tuples. So the claim this isn’t rooted in relational
> theory just seems wrong.
>

The issue here is to ensure that a given column always shows up at the end,
even after you added other columns. In other words, it is a kind of "ALTER
TABLE ... INSERT COLUMN AT ..." instead of "... ADD COLUMN ...". It is more
about data modeling than relational theory...

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Stephen Frost 2020-07-29 21:20:39 Re: Re-order columns?
Previous Message David G. Johnston 2020-07-29 21:11:25 Re: Re-order columns?