Re: creating a view that shows relation name -> OID

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: creating a view that shows relation name -> OID
Дата
Msg-id 20388.984507219@sss.pgh.pa.us
обсуждение исходный текст
Ответ на creating a view that shows relation name -> OID  ("Kevin T. Manley" <kmanley@qwest.net>)
Список pgsql-general
"Kevin T. Manley" <kmanley@qwest.net> writes:
> CREATE VIEW VW_FOO AS select pg_class.oid, relname from pg_class where
> relowner=27;
> fails with:
> Attribute 'oid' has a name conflict
> Name matches an existing system attribute

If you tried to create a table with a user column named 'oid' (or xmin
or any of the other system attribute names), you'd get the same error.

Views don't really have an oid column, but the system attribute names
are reserved anyway.

I'd recommend changing the name of the view's column, eg

    SELECT pg_class.oid AS reloid, ...

            regards, tom lane

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

Предыдущее
От: Bill Huff
Дата:
Сообщение: Re: creating a view that shows relation name -> OID
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: Data type for storing images?