Re: DROP COLUMN - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: DROP COLUMN
Date
Msg-id 1026881041.2200.24.camel@rh72.home.ee
Whole thread Raw
In response to Re: DROP COLUMN  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List 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




pgsql-hackers by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: Re: DROP COLUMN
Next
From: Hiroshi Inoue
Date:
Subject: Re: DROP COLUMN