Version 5.0 (2016-03-20) Changes in the DB-API 2 module (pgdb): "SQL commands are always handled as if they include parameters, i.e. literal percent signs must always be doubled. This consistent behavior is necessary for using pgdb with wrappers like SQLAlchemy."
I'd hope not, as far as the driver is concerned the percent signs are text content. It's plpgsql that is interpreting them directly in the server.