Skip to content

does not handle array types #86

Closed
@SamGrisey

Description

@SamGrisey

It would seem that array types are not being recognized properly. If I create a simple table:

CREATE TABLE IF NOT EXISTS test (
    id serial NOT NULL PRIMARY KEY,
    tags TEXT[]
);

then add some rows and do a

res = await transaction.fetch("SELECT * FROM test;")
return res.result()

the return res.result() line causes a crash:

pyo3_runtime.PanicException: called `Option::unwrap()` on a `None` value

The rust code looks like its expecting a postgres type "TEXT ARRAY" but the type is really "text[]". Even if I declare the table column as having type "TEXT ARRAY" instead of "TEXT[]", \d still reports it as "text[]"

EDIT:
It actually works fine with the same simple table on a fresh database, there must be something different with the existing database... but the array column does indeed crash with that error with fetched on the old database, just no idea why now...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions