角かっこを使用する() 。コンパイラがdetails->('email' IS NOT NULL)のように表示しようとしているようです 。したがって、次のように修正できます:
select *
from users
where (details->'email') is not null
sqlフィドルデモ
実際、 details ["email"]がnullであるか、メールキーが存在しないレコードを取得するには 、次のクエリを使用できます:
select *
from users
where (details->>'email') is null
この回答で説明されているように。