Re: logical column position

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rod Taylor <pg(at)rbt(dot)ca>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Neil Conway <neilc(at)samurai(dot)com>, Jon Jensen <jon(at)endpoint(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: logical column position
Date: 2003-11-21 00:07:41
Message-ID: 7883.1069373261@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rod Taylor <pg(at)rbt(dot)ca> writes:
> On Mon, 2003-11-17 at 20:24, Christopher Kings-Lynne wrote:
>> BTW, one main consideration is that all the postgres admin apps will now
>> need to support ORDER BY attlognum for 7.5+.

> Yeah... how about maintaining attnum for the logical attribute number
> and create an attphysnum or something for the physical position instead?
> This is more intrusive into the source, but you don't need to teach new
> tricks to external entities.
> [ and similar remarks from other people elsewhere in the thread ]

It's completely fallacious to imagine that we could make this change be
transparent to external applications. To take two examples:

1. How many places do you think know that pg_attribute.attnum links to
pg_attrdef.adnum? pg_dump, psql, and the JDBC driver all appear to
know that, in a quick search of the CVS tree; I haven't even bothered to
look at pgadmin and the other apps that are likely to have such
dependencies.

2. How about linking pg_attribute.attnum to entries in pg_index.indkey?
Lots of apps know about that too.

Unless you are going to change the meanings of pg_index.indkey and
pg_attrdef.adnum, you can't simply redefine attnum as a logical column
position. And if you do make such a change you will break code
elsewhere.

If we add a *new* column attlogpos, without changing the semantics
of attnum, then I think we have a fighting chance of making this work
without an undue amount of effort. I see no prospect that we can
change the meaning of attnum without breaking things far and wide.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2003-11-21 00:10:24 Re: logical column position
Previous Message Matthew T. O'Connor 2003-11-20 23:18:27 Re: [HACKERS] More detail on settings for pgavd?