Re: DROP COLUMN

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Rod Taylor <rbt(at)zort(dot)ca>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DROP COLUMN
Date: 2002-07-17 04:44:01
Message-ID: 1026881041.2200.24.camel@rh72.home.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2002-07-17 at 11:29, Christopher Kings-Lynne wrote:
> > > But those (few) apps that still need intimate knowledge about postrges'
> > > internals will always have to query the original system _tables_.
> > >
> > > Also, as we have nothing like Oracles ROWNR, I think it will be quite
> > > hard to have colnums without gaps in the system views,
> >
> > Agreed. However do we have to give up all views which omit
> > dropped columns ?
>
> What's Oracle's ROWNR?

A pseudocolumn that is always the number of row as it is retrieved.

so if we had it, we could do something like

select
ROWNUM as attlognum,
attname
from (
select attname
from pg_attribute
where attrelid = XXX
and attisdropped
order by attnum
) att
order by attlognum;

and have nice consecutive colnums

the internal select is needed because ROWNUM is generated in the
executor as the tuple is output, so sorting it later would mess it up

-------------
Hannu

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-07-17 04:46:03 Re: DROP COLUMN
Previous Message Hiroshi Inoue 2002-07-17 04:41:08 Re: DROP COLUMN