Re: [GENERAL] '1 year' = '360 days' ????

2004-10-28 Thread Gaetano Mendola
Guy Fraser wrote: Trivia: In approximately 620 million years a day will be twice as long as it is today. Do you think then that Postgres628M.0 will fix it ? :-) Regards Gaetano Mendola ---(end of broadcast)--- TIP 8: explain analyze is your

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-28 Thread Guy Fraser
Gaetano Mendola wrote: Guy Fraser wrote: Trivia: In approximately 620 million years a day will be twice as long as it is today. Do you think then that Postgres628M.0 will fix it ? :-) Regards Gaetano Mendola I just hope, I don't have to work an equivalent fraction of the day for the same pay,

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-28 Thread Bruno Wolff III
On Wed, Oct 27, 2004 at 16:26:13 -0600, Guy Fraser [EMAIL PROTECTED] wrote: When calculating any usage based on time, it is a good idea to store usage in days:hours:minutes:seconds because they are static and stable, if you discount the deceleration of the earth and corrections in leap

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-27 Thread Guy Fraser
Tom Lane wrote: Doug McNaught [EMAIL PROTECTED] writes: template1=# select '1 year'::interval = '360 days'::interval; ?column? -- t (1 row) Yeah, if you look at interval_cmp_internal() it's fairly obvious why. I think that this definition is probably bogus, and that only intervals

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-27 Thread Guy Fraser
Tom Lane wrote: Bruno Wolff III [EMAIL PROTECTED] writes: Wikipedia gives 365.242189670 days (86400 seconds) as the length of the mean solar year in 2000. To give you some idea of how constant that values is, Wikipedia claims that 2000 years ago the mean solar year was about 10 seconds longer.

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-24 Thread Pierre-Frdric Caillaud
problem is that '1 months':: interval does not have the same value if you add it to a date or another : = SELECT '2004-02-01'::timestamp+'1 month'::interval, '2004-03-01'::timestamp+'1 month'::interval; ?column? | ?column? -+-

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-24 Thread Michael Glaesemann
On Oct 24, 2004, at 4:13 PM, Pierre-Frédéric Caillaud wrote: How can we sort intervals meaningfully in these conditions ? Can we ? In fact the value of an interval depends on the application, and intervals with months are in another 'world' than intervals with only seconds... same thing for

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-24 Thread Tom Lane
Michael Glaesemann [EMAIL PROTECTED] writes: Added to this, I've been wondering whether '1 day'::interval is also problematic wrt daylight savings time or changing time zones. This is exactly the point I alluded to earlier: intervals need to have three components (months, days, seconds) not

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-24 Thread Bruno Wolff III
On Sun, Oct 24, 2004 at 11:29:13 -0400, Tom Lane [EMAIL PROTECTED] wrote: Question to think about: should we allow fractional months or days in the stored representation? There are some places where the existing restriction that the months field is an integer requires awkward compromises.

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-24 Thread Tom Lane
Bruno Wolff III [EMAIL PROTECTED] writes: Wikipedia gives 365.242189670 days (86400 seconds) as the length of the mean solar year in 2000. To give you some idea of how constant that values is, Wikipedia claims that 2000 years ago the mean solar year was about 10 seconds longer. Using the

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-24 Thread Ricardo Perez Lopez
From: Tom Lane [EMAIL PROTECTED] To: Ricardo Perez Lopez [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [GENERAL] '1 year' = '360 days' Date: Sat, 23 Oct 2004 19:52:50 -0400 Ricardo Perez Lopez [EMAIL PROTECTED] writes: I have observed that, for PostgreSQL, one year is actually 360

[GENERAL] '1 year' = '360 days' ????

2004-10-23 Thread Ricardo Perez Lopez
Hello everyone: I'm a PostgreSQL newbie, working now with dates, times, timestamps and intervals. I have three questions about the above: FIRST: I have observed that, for PostgreSQL, one year is actually 360 days: SELECT '1 year'::timestamp = '360 days'::timestamp; ?column?

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-23 Thread Tom Lane
Ricardo Perez Lopez [EMAIL PROTECTED] writes: I have observed that, for PostgreSQL, one year is actually 360 days: SELECT '1 year'::timestamp = '360 days'::timestamp; ?column? - t Nonsense. regression=# SELECT '1 year'::timestamp = '360 days'::timestamp; ERROR: invalid

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-23 Thread Doug McNaught
Tom Lane [EMAIL PROTECTED] writes: Ricardo Perez Lopez [EMAIL PROTECTED] writes: I have observed that, for PostgreSQL, one year is actually 360 days: SELECT '1 year'::timestamp = '360 days'::timestamp; ?column? - t Nonsense. regression=# SELECT '1 year'::timestamp =

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-23 Thread Tom Lane
Doug McNaught [EMAIL PROTECTED] writes: template1=# select '1 year'::interval = '360 days'::interval; ?column? -- t (1 row) Yeah, if you look at interval_cmp_internal() it's fairly obvious why. I think that this definition is probably bogus, and that only intervals that match

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-23 Thread Bruno Wolff III
On Sat, Oct 23, 2004 at 21:38:15 -0400, Tom Lane [EMAIL PROTECTED] wrote: Doug McNaught [EMAIL PROTECTED] writes: template1=# select '1 year'::interval = '360 days'::interval; ?column? -- t (1 row) Yeah, if you look at interval_cmp_internal() it's fairly obvious why. I

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-23 Thread Tom Lane
Bruno Wolff III [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] wrote: Anybody have any thoughts about a better way to map the multicomponent reality into a one-dimensional sorting order? You could return NULL for cases where the number of months in the first interval is less than the

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-23 Thread Bruno Wolff III
On Sat, Oct 23, 2004 at 23:36:05 -0400, Tom Lane [EMAIL PROTECTED] wrote: We don't have to have this particular sorting decision, we just have to have *some* unique sorting order. In particular, if we want to say that two interval values are not equal, we have to be able to say which one

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-23 Thread Bruno Wolff III
On Sat, Oct 23, 2004 at 23:15:57 -0500, Bruno Wolff III [EMAIL PROTECTED] wrote: by comparing say m1 and m2. This will work as long as f(m,s1) = f(m,s2) implies s1 = s2. It will probably be desirable to use a subset of these mappings where f(m,s) = g(m) + h(s). In fact the current system uses

Re: [GENERAL] '1 year' = '360 days' ????

2004-10-23 Thread Bruno Wolff III
On Sat, Oct 23, 2004 at 23:51:20 -0500, Bruno Wolff III [EMAIL PROTECTED] wrote: One value I found for a solar year is 365 days, 5 hours, 48 minutes, 45.51 seconds. Wikipedia gives 365.242189670 days (86400 seconds) as the length of the mean solar year in 2000. To give you some idea of how