Rework existing PR https://github.com/postgrespro/pg_query_state/pull/16 and migrate current python tests to testgres Postgres testing framework.