Re: determining a type oid from the name

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Re: determining a type oid from the name
Дата
Msg-id CAA-aLv4hzyXNUmXfaSrtPyepPMhHec4_KRYG0N8m3=50OxymWw@mail.gmail.com
обсуждение исходный текст
Ответ на determining a type oid from the name  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: determining a type oid from the name  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
On 22 February 2012 18:00, Andrew Dunstan <andrew@dunslane.net> wrote:
> Say I'm writing an extension X, and I want to process data values from
> another extension that creates type Y (e.g. an hstore), what's the best way
> to determine the Oid of type Y in my module X code? SPI code that runs
> "select 'something'::Y" and then examines the oid in SPI_tuptable? Or do we
> have a utility function I have missed that, given a type name and the
> current search path will give me back the type Oid?

Does this help?

test=# SELECT pg_typeof('4834.34'::numeric)::oid;pg_typeof
-----------     1700
(1 row)

-- 
Thom


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: determining a type oid from the name
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: determining a type oid from the name