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



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to