Re: [GENERAL] strange TIME behaviour

2007-09-17 Thread Raymond O'Donnell
On 15/09/2007 14:53, rihad wrote: I'm still unsure if the timezone issue is at all important when comparing timestamps (greater/less/etc), or when adding intervals to preset dates? Do you have situations where the interval you're dealing with spans a change between winter summer time?

[GENERAL] strange TIME behaviour

2007-09-15 Thread rihad
Can someone please explain to me why these two give different results? The idea is to get the number of seconds past 00:00:00, so the second one is obviously correct. foo= select extract(epoch from current_time); date_part -- 42023.026348 (1 row) foo= select extract(epoch from

Re: [GENERAL] strange TIME behaviour

2007-09-15 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/15/07 06:45, rihad wrote: Can someone please explain to me why these two give different results? The idea is to get the number of seconds past 00:00:00, so the second one is obviously correct. How about: select extract(hour from

Re: [GENERAL] strange TIME behaviour

2007-09-15 Thread Michael Fuhr
On Sat, Sep 15, 2007 at 04:45:02PM +0500, rihad wrote: Can someone please explain to me why these two give different results? The idea is to get the number of seconds past 00:00:00, so the second one is obviously correct. They're both correct. foo= select extract(epoch from current_time);

Re: [GENERAL] strange TIME behaviour

2007-09-15 Thread rihad
Michael Fuhr wrote: On Sat, Sep 15, 2007 at 04:45:02PM +0500, rihad wrote: Can someone please explain to me why these two give different results? The idea is to get the number of seconds past 00:00:00, so the second one is obviously correct. They're both correct. foo= select extract(epoch

Re: [GENERAL] strange TIME behaviour

2007-09-15 Thread Martijn van Oosterhout
On Sat, Sep 15, 2007 at 06:40:38PM +0500, rihad wrote: PostgreSQL seems to default to time without time zone when declaring columns in the table schema. Since all my times and timestamps are in local time zone, and I'm *only* dealing with local times, should I be using time with time zone

Re: [GENERAL] strange TIME behaviour

2007-09-15 Thread rihad
Michael Fuhr wrote: On Sat, Sep 15, 2007 at 04:45:02PM +0500, rihad wrote: Can someone please explain to me why these two give different results? The idea is to get the number of seconds past 00:00:00, so the second one is obviously correct. They're both correct. foo= select extract(epoch

Re: [GENERAL] strange TIME behaviour

2007-09-15 Thread Tom Lane
Martijn van Oosterhout [EMAIL PROTECTED] writes: Historical I beleive. Postgres has four types: timestamp, timestamptz, time and timetz. Then SQL decreed that TIMESTAMP means WITH TIME ZONE, ie timestamptz. So now you get the odd situation where: timestamp == timestamp with time zone ==