I have read the PostgreSQL control structure page and I decided to make a test:
IF 1 = 0 THEN
INSERT INTO my_table (num_a, num_b)
VALUES (1, 1);
END IF;
I have tested the insert statement alone and it works fine. But when I run the above code in psql I get:
ERROR: syntax error at or near "IF"
LINE 1: END IF;
^
What is wrong with it?
ifwithout a function (or at least aDOblock)