From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, Oliver Elphick <olly(at)lfix(dot)co(dot)uk>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: |
Date: | 2002-09-16 01:22:36 |
Message-ID: | 200209160122.g8G1MaW05048@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Can someone remind me why date_part() returns a double rather than an
int4? It is just for partial seconds?
---------------------------------------------------------------------------
Peter Eisentraut wrote:
> Tom Lane writes:
>
> > Shall we abandon all that work and go back to "any available cast can be
> > applied implicitly"?
> >
> > My vote is "tough, time to fix your SQL code".
>
> That would be a OK if the current behavior conformed to the SQL standard,
> which it doesn't. The standard says that all numerical types are mutually
> assignable, which in my mind translates directly as implicitly castable.
> Additionally, your stance breaks the following SQL compatible and probably
> quite common code:
>
> create table test ( a int extract(year from current_date) );
>
> We aren't abandoning "all that work". Plenty of casts should not be
> implicit because they are structurally guaranteed to lose information. But
> for casts between numerical types it depends on the content at run time.
> Therefore the SQL standard says that the check needs to be at run time.
> We do that already, so I don't see a reason to be more strict here.
>
> --
> Peter Eisentraut peter_e(at)gmx(dot)net
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From | Date | Subject | |
---|---|---|---|
Next Message | Christopher Kings-Lynne | 2002-09-16 02:10:05 | Re: Proposal for resolving casting issues |
Previous Message | Bruce Momjian | 2002-09-16 01:03:58 | Re: |