Recent changes to pghistory's context tracking ensures %s is used when rendering SQL to inject variables.
This, however, causes issues for SQL with % that doesn't have any arguments. For example, pghistory's context tracking function:
CREATE OR REPLACE FUNCTION _pgh_attach_context()
RETURNS {cls._meta.db_table}.id%TYPE AS $$
DECLARE
...
It's likely best we solve this by using mogrify to render the SQL instead of passing down arguments as %s to Psycopg. This would likely simplify codepaths that have to account for positional/kwarg variable syntax.
Recent changes to pghistory's context tracking ensures
%sis used when rendering SQL to inject variables.This, however, causes issues for SQL with
%that doesn't have any arguments. For example, pghistory's context tracking function:It's likely best we solve this by using
mogrifyto render the SQL instead of passing down arguments as%sto Psycopg. This would likely simplify codepaths that have to account for positional/kwarg variable syntax.