I have a query that looks like this:
SELECT * FROM table WHERE timestamp = NULL;
The timestamp column is a timestamp with the time zone data type (the second type in this table ). This is in PostgreSQL 8.4.
What I'm trying to accomplish is to select only rows in which a timestamp has not been inserted. When I look at the data in pgAdmin, the field is empty and does not show the value. I tried where timestamp = NULL , 'EPOCH' (which, in your opinion, would be the default), a valid timestamp of zeros ( 0000-00-00 00:00:00-00 , which leads to an error outside the range ), the lowest date according to the docs ( January 1, 4713 BC ) and an empty string ( '' , which just gets a data type mismatch error). Also, there is no is_timestamp() function that I can use to check if the result is not an invalid timestamp.
So the question is, what value is in this empty field that I can check?
Thank.
EDIT: the field does not have a default value.
postgresql
ReK_ Dec 18 '10 at 1:51
source share