Re: Auto convert for type?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Auto convert for type?
Дата
Msg-id 6030.1143584013@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Auto convert for type?  (karly@kipshouse.org)
Список pgsql-general
karly@kipshouse.org writes:
> Yes, that's what I'm looking for.  How can I create an IMPLICIT
> cast from date to my custom type?  IOW, if I assing a date to a
> varible of my type, it will be converted to the format I specify.

Make a function that does the conversion the way you want, and then
create a cast that uses the function (see CREATE CAST).

            regards, tom lane

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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: best practice in upgrading db structure
Следующее
От: SunWuKung
Дата:
Сообщение: Re: best practice in upgrading db structure