Don't work this statement:
IF NOT EXISTS (select TRUE from information_schema.constraint_column_usage where constraint_name='projects_pkey')
THEN
ALTER TABLE projects ADD CONSTRAINT projects_pkey PRIMARY KEY(id);
END IF;
__________________
Best regards,
Elyor.