Re:
От | Bruce Momjian |
---|---|
Тема | Re: |
Дата | |
Msg-id | 200209160122.g8G1MaW05048@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Re: (Peter Eisentraut <peter_e@gmx.net>) |
Список | 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@gmx.net > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001+ If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania19073
В списке pgsql-hackers по дате отправления: