Re: Auto convert for type? - Mailing list pgsql-general

From Tom Lane
Subject Re: Auto convert for type?
Date
Msg-id 6030.1143584013@sss.pgh.pa.us
Whole thread Raw
In response to Re: Auto convert for type?  (karly@kipshouse.org)
List 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 by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: best practice in upgrading db structure
Next
From: SunWuKung
Date:
Subject: Re: best practice in upgrading db structure