Skip to content

Conversation

@alexander-beedie
Copy link
Contributor

@alexander-beedie alexander-beedie commented Jul 22, 2025

Minor addition of support for the oid PostgreSQL identifier type, so it's a little easier to interact with system tables; oid is a u32 type, and can be directly read as such.

Ref: PostgreSQL OID type details.

Example

Loading some data from the pg_class system table:

import connectorx as cx

cx.read_sql(
    conn="postgresql://<user>:<pass>@<host>:<port>/<db>",
    query="""
        SELECT oid, relname 
        FROM pg_class
        WHERE relkind = 't'
    """,
    return_type="polars",
)

Before:

# PanicException: not implemented: oid

After:

# shape: (88, 2)
# ┌───────────┬────────────────────┐
# │ oid       ┆ relname            │
# │ ---       ┆ ---                │
# │ u32       ┆ str                │
# ╞═══════════╪════════════════════╡
# │ 75665     ┆ pg_toast_75661     │
# │ 75676     ┆ pg_toast_75672     │
# │ 337455076 ┆ pg_toast_337455072 │
# │ …         ┆ …                  │
# │ 3772379   ┆ pg_toast_3772376   │
# │ 3772397   ┆ pg_toast_3772393   │
# │ 4066652   ┆ pg_toast_4066648   │
# └───────────┴────────────────────┘

@wangxiaoying
Copy link
Contributor

Thanks @alexander-beedie !

@wangxiaoying wangxiaoying merged commit 0f0b835 into sfu-db:main Jul 22, 2025
2 checks passed
Amar1729 pushed a commit to Amar1729/connector-x that referenced this pull request Nov 11, 2025
- support for OID was added in sfu-db#830
  - closes sfu-db#637
- support for BOOL[] was added in sfu-db#453
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.

2 participants