[SQL] Find rows with "timestamp out of range" - Mailing list pgsql-sql

From Saiful Muhajir
Subject [SQL] Find rows with "timestamp out of range"
Date
Msg-id CAA0dH_v08fBFWp+4TsRz8wESSp8zgKCL_Sdc-OVdA3vQd_XjUg@mail.gmail.com
Whole thread Raw
Responses Re: [SQL] Find rows with "timestamp out of range"  (vinny <vinny@xs4all.nl>)
Re: [SQL] Find rows with "timestamp out of range"  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: [SQL] Find rows with "timestamp out of range"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Hi,

I have a table with around 133 million rows with two timestamp columns. While trying to copy some columns for a new database, using \COPY , the error occurred with: timestamp out of range

​While trying to​ figure out the rows containing the out of range value, I am using this with no result:


select comment_id, create_time from comments where create_time > '1 Jan 9999';
 comment_id │ talk_id │ create_time
────────────┼─────────┼─────────────
(0 rows)


The error occurred when I query with:


select comment_id, create_time from comments where create_time < '1 Jan 1800';
ERROR:  22008: timestamp out of range
LOCATION:  timestamp_out, timestamp.c:226


So, how do I figure out the rows with problems?


Thank you.

--
Regards,

Saiful

pgsql-sql by date:

Previous
From: Saiful Muhajir
Date:
Subject: [SQL] Find rows with "timestamp out of range"
Next
From: vinny
Date:
Subject: Re: [SQL] Find rows with "timestamp out of range"