Re: Typecast a user-defined type?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Typecast a user-defined type?
Дата
Msg-id 3499.970675196@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Typecast a user-defined type?  (Mark Volpe <volpe.mark@epamail.epa.gov>)
Список 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 по дате отправления:

Предыдущее
От: Mark Volpe
Дата:
Сообщение: Typecast a user-defined type?
Следующее
От: Craig May
Дата:
Сообщение: createuser