pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: vlsi (@vlsi) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] PR #3244: refactor: use oid=?::regtype when fetching pg_type by name instead of joining pg_namespace
Date: Sun, 05 Oct 2025 20:15:17 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

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;`


view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] PR #3244: refactor: use oid=?::regtype when fetching pg_type by name instead of joining pg_namespace
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox