Re: pg_casts view (was Re: date_trun() with timezones? (was Re: TIME column ...))

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bill Moran <wmoran(at)collaborativefusion(dot)com>, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_casts view (was Re: date_trun() with timezones? (was Re: TIME column ...))
Date: 2008-11-05 12:17:01
Message-ID: 49118EBD.6060902@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera wrote:
> Tom Lane escribió:
>
>> However, the interval version of the function can capture the time case
>> because there's an implicit cast from time to interval:
>>
>> regression=# select casttarget::regtype,castcontext,castfunc::regprocedure from pg_cast where castsource = 'time'::regtype;
>> casttarget | castcontext | castfunc
>> ------------------------+-------------+----------------------------------------
>> interval | i | "interval"(time without time zone)
>> time with time zone | i | timetz(time without time zone)
>> time without time zone | i | "time"(time without time zone,integer)
>> (3 rows)
>
> BTW it very much looks like we should have a pg_casts view that displays
> these things in a human-readable manner (like the above except with
> castcontext expanded)

Could we change the data types of the pg_cast table to regprocedure and
regtype instead?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2008-11-05 12:18:17 Re: pg_casts view (was Re: date_trun() with timezones? (was Re: TIME column ...))
Previous Message adam_pgsql 2008-11-05 11:53:51 Re: postgresql and Mac OS X