Q:

How can use the cascade in Postgresql query while deleting record from parent table

How can we use the cascade in PostgreSQL while deleting the one record from the parent table that is being referred in other child tables. Currently it is giving the syntax error.
ERROR:  syntax error at or near "cascade"
LINE 1: DELETE FROM fs_item where itemid = 700001803 cascade;

A:

You have to add ON DELETE CASCADE constraint in following way:
ALTER TABLE table1 ADD CONSTRAINT "tbl1_tbl2_fkey" FOREIGN KEY(reference_key) REFERENCES table2 ON DELETE CASCADE;

Then, you can simply execute the DELETE query
 DELETE FROM fs_item where itemid = 700001803

