Repository navigation
Support schema-qualified PL/pgSQL types without a catalog - #17
pyramation wants to merge 1 commit into
Conversation
The LookupExplicitNamespace mock raised "Not implemented" for any schema other than pg_catalog and public, so a PL/pgSQL variable typed as myschema.mytype made pg_query_parse_plpgsql() return an error instead of JSON. Resolve other schemas like public, which the GetSysCacheOid mock already maps to RECORDOID. Adds a sample covering qualified types, %ROWTYPE, %TYPE, pg_catalog and public.
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review complete. No issues found — approved ✅. The change makes the catalog-less parser mock accept any namespace name rather than erroring on unknown schemas, with the real upstream copy kept in sync and a new test exercising qualified schema types.
Reviewed commit: 493bd5b |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
Draft description for the upstream PR to pganalyze/libpg_query (written to be pasted as-is, no tool links): Title: Support schema-qualified PL/pgSQL types without a catalog This is the schema-qualified types part of pganalyze#355, split out as you suggested and rebased on current The The change is in Once this is in, I'll close pganalyze#355. |
Summary
Staging branch for the part of pganalyze#355 that Lukas said is good to go, rebuilt as one commit on current
pganalyze/libpg_query18-latest(fork18-latestwas fast-forwarded to it so this diff is just the change). Nothing is sent upstream until Dan signs off.The
LookupExplicitNamespacemockelog(ERROR)'d for any schema other thanpg_catalog/public, soDECLARE v myschema.mytype;madepg_query_parse_plpgsql()returnNot implemented (LookupExplicitNamespace ...)instead of JSON. Other schemas now resolve likepublic, which theGetSysCacheOidmock already maps toRECORDOID:Edited in both
scripts/mocks/LookupExplicitNamespace.cand the extractedsrc/postgres/src_backend_catalog_namespace.c, so it survives re-extraction. Adds aplpgsql_samples.sqlcase (qualified type,%ROWTYPE,%TYPE,pg_catalog.int4,public.mytype); the only golden change is that new line.Left out on purpose:
retvarno: the plainWRITE_INT_FIELDsplit Lukas asked for is already open upstream as Output retvarno for PL/pgSQL RETURN and RETURN NEXT pganalyze/libpg_query#402, so we don't send a duplicate.make testpasses locally; the expected JSON parses withjson.load.Implemented in session Rework upstream PL/pgSQL PR per Lukas's feedback
Review with Devin · Open in Devin Desktop