Re: Casting to varchar

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Casting to varchar
Дата
Msg-id 7546E019-BAE0-4023-BCF3-04E99633CB1C@seespotcode.net
обсуждение исходный текст
Ответ на Casting to varchar  (Scott Ribe <scott_ribe@killerbytes.com>)
Ответы Re: Casting to varchar  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Casting to varchar  (Scott Ribe <scott_ribe@killerbytes.com>)
Список pgsql-general
On May 4, 2007, at 15:34 , Scott Ribe wrote:

> Are there any other standard types that can't be cast
> to varchar?

You already got an answer to the first part of your question, but I
thought you might be interested in the second as well. Here's what I
did:

SELECT DISTINCT cast_from
FROM pg_cast c
NATURAL JOIN (
     SELECT oid as castsource, typname as cast_from
     FROM pg_type
     ) s
WHERE NOT EXISTS (
     SELECT 1
     FROM pg_cast i
     NATURAL JOIN (
         SELECT oid as casttarget, typname as cast_target
         FROM pg_type
         ) t
     WHERE cast_target = 'text'
         AND i.castsource = c.castsource
     )
ORDER BY cast_from;

   cast_from
--------------
abstime
bit
bool
box
circle
lseg
path
polygon
regclass
regoper
regoperator
regproc
regprocedure
regtype
reltime
text
varbit
(17 rows)

I don't know which of those you'd consider standard, but I believe
that's a complete list from HEAD of a few minutes ago.

Michael Glaesemann
grzm seespotcode net



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

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: R: Postgres 8.3-dev
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: varchar as primary key