How do I in "Navicat for PostgreSQL" run a simple PL/pgSQL script like I would in MS SQL Server Management Studio?
DO $$
BEGIN
    INSERT INTO t1 (id) VALUES (6);
EXCEPTION WHEN unique_violation THEN
    -- Ignore duplicate inserts.


END$$;


You can not use IF outside procedure code, but Your construction possible run like this