To fix CVE-2025-8714, PG introduce \restrict , but if we use python ( like psycopg2), it does not support slash command.