Hi, I need to temporarily change a Postgres client connection parameter at the start of a Python script, and revert to the default once the script has run. On local I can do this with
import subprocess
subprocess.run(["psql", "SET session_replication_role = 'replica';"])
# do stuff
subprocess.run(["psql", "SET session_replication_role = 'origin';"])
but psql
is only accessible via the Databases tab on PythonAnywhere, and not directly. Is there some other way to do this? Thanks.