Skip to content

CockroachDB doesn't (yet) support pg_catalog.regclass #23

@robins

Description

@robins

There is a lot of small ifs becoming mandatory to get OID from a relation name.

Apparently Cockroachdb doesn't (yet) support pg_catalog.regclass (when casting at least) although regclass works fine. It would ideally be best if CockroachDB could (eventually) support this, to avoid namespace clashes.

In Postgres

postgres2=> select 'a'::regclass::OID;
   oid
----------
 20041642
(1 row)
postgres2=> select 'a'::pg_catalog.regclass::OID;
   oid
----------
 20041642
(1 row)

In CockroachDB

bank=> \d a
                      Table "bank.a"
 Column |  Type  |     Collation     | Nullable | Default
--------+--------+-------------------+----------+---------
 b      | bigint | Not Supported Yet |          |
Indexes:
    "primary" PRIMARY KEY, (Not Supported Yet)
bank=> select 'a'::regclass::OID;
 'a'::REGCLASS::OID
--------------------
          818765073
(1 row)

bank=> select 'a'::pg_catalog.regclass::OID;
ERROR:  syntax error at or near "pg_catalog"
select 'a'::pg_catalog.regclass::OID;
            ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions