Re: Bug 1500
От | Josh Berkus |
---|---|
Тема | Re: Bug 1500 |
Дата | |
Msg-id | 200503271143.53865.josh@agliodbs.com обсуждение исходный текст |
Ответ на | Re: Bug 1500 (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Bug 1500
|
Список | pgsql-hackers |
Tom, Karel, > Hmm, if we want to support conversion like: > '43 hours 20 minutes' --> 'MI min' > how we should work with calendar INTERVAL units? For example 'month'? > '1 month 1 day' --> 'D days' > I think answer should be error message: "missing calendar unit 'month' > in output format" Actually, there's a pretty well-defined boundary within interval types: year.month | day.hour.minute.second.millesecond This subtype boundary of intervals is even defined in the SQL spec. > Surely not. to_char for timestamps doesn't require that you output > every field of the value, and it shouldn't require that for intervals > either. That's an invalid comparison. There is no logical way to "roll up" timestamps into larger/smaller subtypes. There is with intervals. If you're arguing that this kink in the *useful* behavior of interval-->text conversion is confusingly inconsistent with what to_char does with other data types, and we should call the function something else, then I could potentially buy that (assuming that others agree). However, our proprietary functions are about being *useful*, not adhering to some unwritten de-facto standard. And I am, as someone who uses intervals heavily in applications, trying to define what the useful behaviour will be from a user's perspective. -- Josh Berkus Aglio Database Solutions San Francisco
В списке pgsql-hackers по дате отправления: