Skip to content

c/driver/postgresql: implement StatementGetParameterSchema #2880

@lidavidm

Description

@lidavidm

We need to implement this. This should be possible via PQdescribePrepared: https://www.postgresql.org/docs/current/libpq-exec.html#LIBPQ-PQDESCRIBEPREPARED

The context is that I'm making a SQLAlchemy Dialect for PostgreSQL/ADBC

Awesome!

How can I get ADBC to assume that it's just an INT?

I think in this case it's coming from pyarrow, which picks int64 as its default inference of an arbitrary Python integer:

It's a great point that the default conversion to BIGINT is likely to cause some problems. I forget from when I was working on this whether libpq gives us the opportunity to query the parameter types that it thinks we should be using from an arbitrary query (it looks like it isn't implemented from our side, anyway):

AdbcStatusCode PostgresStatement::GetParameterSchema(struct ArrowSchema* schema,
struct AdbcError* error) {
return ADBC_STATUS_NOT_IMPLEMENTED;
}

Originally posted by @paleolimbot in #2865 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions