PostgreSQL: Select where timestamp is empty

Postgresql

Postgresql Problem Overview


I have a query that looks like the following:

SELECT * FROM table WHERE timestamp = NULL;

The timestamp column is a timestamp with time zone data type (second type in this table). This is in PostgreSQL 8.4.

What I'm trying to accomplish is to only select rows that have not had a timestamp inserted. When I look at the data in pgAdmin the field is empty and shows no value. I've tried where timestamp = NULL, 'EPOCH' (which you would think would be the default value), a valid timestamp of zeros (0000-00-00 00:00:00-00, which results in a out of range error), the lowest date possible according to the docs (January 1, 4713 BC) and a blank string ('', which just gets a data type mismatch error). There also appears to be no is_timestamp() function that I can use to check if the result is not a valid timestamp.

So, the question is, what value is in that empty field that I can check for?

Thanks.

EDIT: The field does not have a default value.

Postgresql Solutions


Solution 1 - Postgresql

Try timestamp is null as i use this syntax in MySQL

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionReK_View Question on Stackoverflow
Solution 1 - PostgresqlXMenView Answer on Stackoverflow