Search Postgresql Archives

Timestamp comparison with string in some special cases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have just found out that when comparing timestamp with time value where time value is represented in 24h format + AM/PM sign doesn't work always.
for instance, the following query works in this format:

select * from table where timestamp_column < '11/19/2007 3:46:09 PM'

and also in this format

select * from table where timestamp_column < '11/19/2007 15:46:09'

BUT: if time is presented in this format, postgres returns an error

ERROR: date/time field value out of range

select * from table where timestamp_column < '11/19/2007 15:46:09 PM'

Now, I know that 24 time format + AM/PM is redundant, but this is how windows clock format is set up in few of our customers, and this is what is sent to postgres. We will alter this presentation through our client program, but is there a way to make postgres accept values like these? Postgres is version 8.2.3 on fedora 7 (64-bit).

Dragan Matic

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux