PostgreSQL: Select where timestamp is empty

null in SQL means ‘unknown’.

This means that the result of using any comparison operator, like =, with a null is also ‘unknown’.

To check if a column is NULL (or not NULL), use the special syntax of IS NULL (or IS NOT NULL) instead of using =.

Applying that to your statement,

SELECT * FROM table WHERE timestamp IS NULL;

should work.

Leave a Comment