Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Sun, 05 Oct 2025 20:15:17 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3244: refactor: use oid=?::regtype when fetching pg_type by name instead of joining pg_namespace In-Reply-To: References: List-Id: X-GitHub-Author-Login: vlsi X-GitHub-Comment-Id: 3369299119 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3244 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3244#issuecomment-3369299119 Content-Type: text/plain; charset=utf-8 It turns out `::regtype` is not reliable in PostgreSQL. For instance `select 'any'::regtype` fails with ``` ERROR: syntax error at or near "any" invalid type name "any" ``` `select 'cardinal_number'::regtype;` fails with ``` ERROR: type "cardinal_number" does not exist ``` However, if I create `create domain cardinal_number as int8`, then `'cardinal_number'::regtype` heals. Here's an SQL to query types that can't process with a cast to `regtype`: `select * from pg_type where typname <> 'any' and to_regtype(typname) is null;`