Postgres Use Variable In Sed Command In Python