Re: Typecast a user-defined type? - Mailing list pgsql-sql

From Tom Lane
Subject Re: Typecast a user-defined type?
Date
Msg-id 3499.970675196@sss.pgh.pa.us
Whole thread Raw
In response to Typecast a user-defined type?  (Mark Volpe <volpe.mark@epamail.epa.gov>)
List pgsql-sql
Mark Volpe <volpe.mark@epamail.epa.gov> writes:
> someone give me a hint, or point me to the appropriate material on how to get
> "value::text" to work with my new type?

Write a function "text(yourtype) RETURNS text", and the parser will use
it for type coercions from yourtype to text.  In general any type
coercion can be provided this way --- a function of a single argument,
having the same name as its return type, represents a coercion path.
        regards, tom lane


pgsql-sql by date:

Previous
From: Mark Volpe
Date:
Subject: Typecast a user-defined type?
Next
From: Craig May
Date:
Subject: createuser