Skip to content

PgAttributeHandler does not implement COUNT(*) #100

Description

@erans

SELECT COUNT(*) FROM pg_attribute ... returns a 60-row, 0-column result instead of a single count.

PgAttributeHandler synthesizes rows for the projection it recognizes and has no case for an aggregate, so a count query falls through to the row-producing path and emits one empty row per attribute.

Pre-existing. It became reachable during #87 when the pg_class/pg_namespace interception branches were removed — before that, some count queries were absorbed elsewhere.

src/catalog/pg_roles.rs carries its own count_response helper and is the precedent for the shape a fix would take. An equivalent helper was deleted from src/catalog/pg_namespace handling along with that handler; it is in the #87 branch history if useful.

The broader fix is #95 — migrating pg_attribute to a SQLite view makes COUNT(*) work for free, since SQLite executes the aggregate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions