Skip to content

cursor.description raises "psycopg.OperationalError", other members do not. #172

@rojalator

Description

@rojalator

If I call rowcount, statusmessage, rownumber (and even _query) on a cursor where the cursor is "psycopg.Cursor [TUPLES_OK] [BAD]" (that is, closed) I have no problem, however, if I try to call 'description' I get an OperationalError and cannot get the value (looks like _ensure_pgconn raises the exception).
This seems counter-intuitive: if I can get the other values and I have the results in set of tuples, why can I not get the description? Is it the use of a row factory that is the issue?

If so, or the description is not available when the other values are, could you update 'Information about the data' to indicate that?

psycopg 3.0.4, python 3.9.0, linux

Regards,
RJL

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