sql: schema-qualify regclass/regproc/regtype text output
commit 5808838 ↗ · cockroachdb/cockroach · · committed May 26, 2026 · +346−97 · base 0d9e197dbf72
Agent prompt
what a new run launched now would send
Casting an OID to regclass (or regproc / regprocedure / a user-defined regtype) and then to text currently emits only the bare relation/function/type name. Postgres emits a schema-qualified `schema.name` whenever the bare name would not resolve back to the same OID through the current search_path. That mismatch breaks SQLAlchemy column reflection, which uses `pg_get_serial_sequence(CAST(CAST(c.oid AS regclass) AS text), ...)` and cannot resolve relations outside schemas early on the path (e.g. not in `public`).
Make CockroachDB match Postgres for this output and the related visibility rules:
1. For regclass, regproc, regprocedure, and user-defined regtypes, OID→reg*→text must emit a schema-qualified name when the bare name is not the search_path-visible binding for that OID; otherwise emit the bare name. Each identifier component should be quoted only when necessary (Postgres `quote_qualified_identifier` style).
2. Built-in regtypes must keep their SQL-standard names (e.g. `integer`, not `int4`).
3. Casting and name-parsing paths that produce the same OID must agree on the resolved display name, so round-trips like `'schema.x'::reg*::oid::reg*::text` are stable.
4. Pgwire text format for these values should emit the resolved identifier form verbatim (not SQL-string-literal escaping).
5. `pg_table_is_visible`, `pg_function_is_visible`, and `pg_type_is_visible` must treat an object as visible iff its schema is the first search_path schema that contains any entity of that name (shadowing), not merely “schema appears somewhere on the path”—including overloaded builtins that share a name across multiple OIDs.
Out of scope: broader `format_type`-style builtin naming differences beyond the above, and formatting argument types in `regprocedure` text output.
Work only inside this repository checkout. Make the code change the task
describes, keeping the diff focused — no drive-by refactors.
When you are done, leave your changes committed or in the working tree;
they are collected automatically.
Stay on this snapshot checkout (`task/ycb_cockroach_c580883822515`). Never checkout, pull, or rebase onto `main`. That branch is a README-only orphan.
Stay on this HEAD. Do not fetch another default branch. Push only on the Cursor-created `crazy-cursor/…` side branch from this HEAD.
Some past runs of this task were launched with a different prompt (the prompt template changed since, or those runs predate this benchmark's stored prompt). Each run persists the exact prompt it sent at launch — that per-launch record is the audit trail; this page shows only the current one.
Reference diff
The task commit's diff against its first parent — the judge's comparison target.