Re: pg_attribute.attnum - wrong column ordinal?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: pg_attribute.attnum - wrong column ordinal?
Дата
Msg-id 20091203134239.GB5059@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: pg_attribute.attnum - wrong column ordinal?  (Greg Stark <gsstark@mit.edu>)
Ответы Re: pg_attribute.attnum - wrong column ordinal?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Greg Stark escribió:
> On Wed, Nov 25, 2009 at 1:03 AM, Konstantin Izmailov <pgfizm@gmail.com> wrote:
>
> > My question: can pg_attribute.attnum be used to determine the sequential
> > ordinal positions of columns in a table? What is a right way to get the
> > ordinal numbers?
>
> You could use something like:
>
> row_number() over (partition by T.schemaname,T.viewname order by
> attnum) as "ORDINAL_POSITION"

Should we recast the attributes and columns views in information_schema?
I notice they still use attnum.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

В списке pgsql-general по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Catastrophic changes to PostgreSQL 8.4
Следующее
От: David Boreham
Дата:
Сообщение: Re: Unexpected EOF on client connection