How to express an empty relation (or table) in PostgreSQL? Is there a way to express an empty relation in SQL without actually creating an empty table?

For testing purposes, I want to find a way to test something like:

SELECT count(*) FROM (...) my_empty_table;


where ... generates an empty table in-line. (I expect to get 0 as answer)

Is this possible?

I tried unsuccessfully:

SELECT count(*) FROM (VALUES) t;
SELECT count(*) FROM () t;


, which give syntax errors.

and

=&gt; SELECT count(*) FROM (SELECT) t;
 count 
-------
     1
(1 row)


(I'm primarily using SQL, but I'm also curious if there is standard-compliant way of writing this).
Your last attempt can be changed to: 

select count(*) from ( select where false ) t


Which however is not standard SQL.

The only way I can think of in standard SQL is to use another subselect based on a VALUES clause that returns nothing:

select count(*) 
from ( 
  select * 
  from (values (null) ) x
  where false 
) t


Or use an intersection that is empty:

select count(*) 
from ( 
  select 1 
  intersect
  select 2 
) t


That's partially standard SQL, because a FROM clause is required by the standard.