Re: [GENERAL] date comparisons

2007-02-03 Thread Bruce Momjian
OK, so we have a bug. Thanks. --- Chad Wagner wrote: > On 2/3/07, Bruce Momjian <[EMAIL PROTECTED]> wrote: > > > > > > Would someone please confirm that our behavior in the three queries > > below matches Oracle's behavior?

Re: [GENERAL] date comparisons

2007-02-03 Thread Chad Wagner
On 2/3/07, Bruce Momjian <[EMAIL PROTECTED]> wrote: Would someone please confirm that our behavior in the three queries below matches Oracle's behavior? Here is output from Oracle: Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production With the Partitioning, OL

Re: [GENERAL] date comparisons

2007-02-03 Thread Bruce Momjian
Would someone please confirm that our behavior in the three queries below matches Oracle's behavior? --- Tom Lane wrote: > "Belinda M. Giardine" <[EMAIL PROTECTED]> writes: > > Should it be this way? > > Well, to_timestamp(

Re: [GENERAL] date comparisons

2006-12-12 Thread Tom Lane
Richard Huxton writes: > The padding is on *input* too? Is this an Oracle compatibility "feature"? I assume so. If Oracle does not work like that, then it'd be a bug ... but the whole purpose of that function is to be Oracle-compatible, so we're sort of stuck doing what Oracle does.

Re: [GENERAL] date comparisons

2006-12-12 Thread Richard Huxton
Tom Lane wrote: "Belinda M. Giardine" <[EMAIL PROTECTED]> writes: Should it be this way? Well, to_timestamp() is apparently designed not to complain when the input doesn't match the format, which is not my idea of good behavior ... but your example is in fact wrong. 'Month' means a 9-characte

Re: [GENERAL] date comparisons

2006-12-12 Thread Belinda M. Giardine
On Tue, 12 Dec 2006, Tom Lane wrote: > "Belinda M. Giardine" <[EMAIL PROTECTED]> writes: > > Should it be this way? > > Well, to_timestamp() is apparently designed not to complain when the > input doesn't match the format, which is not my idea of good behavior > ... but your example is in fact w

Re: [GENERAL] date comparisons

2006-12-12 Thread Tom Lane
"Belinda M. Giardine" <[EMAIL PROTECTED]> writes: > Should it be this way? Well, to_timestamp() is apparently designed not to complain when the input doesn't match the format, which is not my idea of good behavior ... but your example is in fact wrong. 'Month' means a 9-character field, so you ar

Re: [GENERAL] date comparisons

2006-12-12 Thread Richard Huxton
Belinda M. Giardine wrote: Thanks that works. But I am trying to understand why the others did not, especially my first attempt. Further testing shows that select id, date_entered from main_table where date_entered >= to_timestamp('2006 January', ' Month'); works, but select id, date_ent

Re: [GENERAL] date comparisons

2006-12-12 Thread Belinda M. Giardine
On Tue, 12 Dec 2006, Erik Jones wrote: > Belinda M. Giardine wrote: > > This should be simple but I am missing something. I am trying to extract > > all records entered after a given date. The table has a field > > date_entered which is a timestamp. In this particular case I am not > > worrie

Re: [GENERAL] date comparisons

2006-12-12 Thread Erik Jones
Belinda M. Giardine wrote: This should be simple but I am missing something. I am trying to extract all records entered after a given date. The table has a field date_entered which is a timestamp. In this particular case I am not worried about time. I have tried: select id from main_table whe

[GENERAL] date comparisons

2006-12-12 Thread Belinda M. Giardine
This should be simple but I am missing something. I am trying to extract all records entered after a given date. The table has a field date_entered which is a timestamp. In this particular case I am not worried about time. I have tried: select id from main_table where date_entered > to_timestam