| От | Yeb Havinga |
|---|---|
| Тема | Re: how do i query the type of an object? |
| Дата | |
| Msg-id | 4C63AD83.3060602@gmail.com обсуждение исходный текст |
| Ответ на | Re: how do i query the type of an object? (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-admin |
Tom Lane wrote: > Mark Rostron <mrostron@ql2.com> writes: > >> Is there some way to query the data-type of '<some value expression>'? >> > > There's a SQL-standard construct called IS OF, and a function called > pg_typeof, but it's not real clear whether either of those would help > you. > I failed finding IS OF in the pg documentation, however, http://farrago.sourceforge.net/design/UserDefinedTypesAndRoutines.html had a reference to it. postgres=# create table a(a) as select 1; SELECT 1 postgres=# select * from a where a IS OF (integer); a --- 1 (1 row) While learning this somehow triggers the 'cool I just learned some new obscure SQL trick' feeling, I am not sure if it is really useful without CREATE TYPE foo UNDER bar. regards, Yeb Havinga
В списке pgsql-admin по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера