Reworking handling of Prepared Queries in PostgreSQL