Thread: Conditional statements

Conditional statements

From
"Mark Alliban"
Date:
Hi,

I was wondering if it is possible to have conditional statements in
postgres?

For example:
IF NOT EXISTS(SELECT * FROM testtable WHERE id=3)
    INSERT INTO testtable (id) VALUES (3)

TIA,
Mark.