Why do I always get the following error from Postgres?
syntax error at or near "IF"
I read PostgreSQL: Documentation: 8.3: Control Structures. First I tried to execute a difficult query (with subquery), but then I tried to execute a simple one like this:
IF 2 <> 0 THEN select * from users; END IF;
The error is still the same. What am I doing wrong?