Re: Auto convert for type?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: karly(at)kipshouse(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Auto convert for type?
Date: 2006-03-28 22:13:33
Message-ID: 6030.1143584013@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

karly(at)kipshouse(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message SunWuKung 2006-03-28 22:24:04 Re: best practice in upgrading db structure
Previous Message Jim C. Nasby 2006-03-28 22:11:10 Re: best practice in upgrading db structure