Skip to content

feat: add rule to support ::regclass::oid cast#288

Open
sunng87 wants to merge 3 commits intomasterfrom
fix/regclass-oid-cast
Open

feat: add rule to support ::regclass::oid cast#288
sunng87 wants to merge 3 commits intomasterfrom
fix/regclass-oid-cast

Conversation

@sunng87
Copy link
Member

@sunng87 sunng87 commented Feb 15, 2026

this isn't a simple cast to data type, it translate a table name to oid. So we rewrite this cast to a subquery to find oid from pg_catalog.pg_class

@sunng87
Copy link
Member Author

sunng87 commented Feb 16, 2026

limitation:

  1. postgres allows syntax like schema.table::regclass::oid convert schema.table to its oid directly. our current implementation only has table/pg_class support
  2. in extended query, the client will send "table" quoted with double-quote as an identifier. we will need to unquote when parsing the text input. this has to be done in pgwire for a usable unquote function.
  3. we can use parse_ident function on schema.table or table to unquote and parse the schema.table syntax. but there is another issue that datafusion doesn't support parameter type inference for scalarfunction, so parsing the parameter may fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments