Unable to SET session_replication_role = 'replica';

I’m just trying to truncate some tables which have foreign keys…but I get the error:

ERROR: permission denied to set parameter “session_replication_role” (SQLSTATE 42501)

I’m running this directly in the Neon SQL Editor as the account holder - Is it just not possible ?

Script is below:

– Disable foreign key constraints
SET session_replication_role = ‘replica’;

TRUNCATE TABLE “xxxxxxx”;
TRUNCATE TABLE “xxxxxxx”;
TRUNCATE TABLE “xxxxxxx”;

– Enable foreign key constraints
SET session_replication_role = ‘origin’;

This is indeed not possible because Neon roles cannot access replication methods. Only superusers can set this parameter, and as a managed Postgres service, we do not grant superuser to any role.

Thank you for your considered response - it is indeed understandable that such restrictions are in place