How do I only truncate a table in PSQL if only that table exist?

278 views Asked by At

I want to replace drop & create with truncate. So the first step i wand to add is check if the table already exists and truncate it. How do I only truncate a table in PSQL if only that table exist? I want something like TRUNCATE TABLE IF EXISTS (table_name);

TRUNCATE TABLE IF EXISTS (table_name);

0

There are 0 answers