Re: find column OID types with information schema?

Поиск
Список
Период
Сортировка
От Whit Armstrong
Тема Re: find column OID types with information schema?
Дата
Msg-id 8ec76080904270922w4ee37c7cq9b50bc930bf06b86@mail.gmail.com
обсуждение исходный текст
Ответ на find column OID types with information schema?  (Whit Armstrong <armstrong.whit@gmail.com>)
Ответы Re: find column OID types with information schema?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
(I had accidentally replied to Tom only on my reply)

the OID's can be found as follows:

SELECT * FROM pg_attribute
  WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = 'mytable');

from this page:
http://www.postgresql.org/docs/8.3/interactive/datatype-oid.html

However, there is no example that uses a schema + tablename.

-Whit

On Mon, Apr 27, 2009 at 11:53 AM, Whit Armstrong
<armstrong.whit@gmail.com> wrote:
> Thanks, Tom.
>
> So, it's more like this:
>
> select attname, atttypid from pg_attribute where attrelid = <attrelid
> of my table>;
>
> hmm, so how do I find the attrelid of my table?  I don't see it in pg_tables.
>
> -Whit
>
>
>
> On Mon, Apr 27, 2009 at 11:38 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Whit Armstrong <armstrong.whit@gmail.com> writes:
>>> Is it possible to find out the OID types of the columns of a table
>>> using the information schema?
>>
>> No.  Type OIDs are a Postgres-ism so they are not reflected in the
>> standards-mandated contents of the information_schema.  If you want
>> OIDs you'll need to look at the underlying catalogs (pg_attribute
>> in particular).
>>
>>                        regards, tom lane
>>
>

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Cannot reattach to shared memory / Windows
Следующее
От: Tom Lane
Дата:
Сообщение: Re: how do you get there from here?