Repro:
SELECT pg_catalog.pg_table_is_visible(1); -- ERROR
SELECT obj_description(1, 'pg_class'); -- ERROR
SELECT pg_get_indexdef(1); -- ERROR
SELECT pg_get_constraintdef(1); -- ERROR
SELECT to_regclass('public.foo'); -- ERROR
SELECT current_schema(); -- ERROR
SELECT current_database(); -- ERROR
SELECT version(); -- ERROR
SELECT pg_get_serial_sequence('t','id'); -- ERROR
Expected:
Standard PostgreSQL behavior for each function.
Observed:
All raise psycopg SyntaxError naming the function. The underlying
catalog tables (pg_class, pg_namespace, pg_attribute, pg_type) are
readable, so only the helper functions are missing.
Why it matters:
Django's introspection layer
(django/db/backends/postgresql/introspection.py) emits these from
get_table_list, get_relations, get_constraints, etc. Any ORM-level
test that runs migrate fails immediately. sqlalchemy, alembic, and
asyncpg's introspection helpers similarly depend on these.
Repro:
Expected:
Standard PostgreSQL behavior for each function.
Observed:
All raise psycopg SyntaxError naming the function. The underlying
catalog tables (pg_class, pg_namespace, pg_attribute, pg_type) are
readable, so only the helper functions are missing.
Why it matters:
Django's introspection layer
(django/db/backends/postgresql/introspection.py) emits these from
get_table_list, get_relations, get_constraints, etc. Any ORM-level
test that runs migrate fails immediately. sqlalchemy, alembic, and
asyncpg's introspection helpers similarly depend on these.