Skip to content

README "Design notes" says connection and result share one external pointer #670

Not planned

Description

@krlmlr

The "Design notes" section of README.md ends with: "and both the connection and result objects point to the same external pointer" (README.md#L84-L87). That is no longer true: a PqResult has its own ptr slot, created by result_create(conn@ptr, ...) in R/dbSendQuery_PqConnection.R, and the C++ connection only remembers its current result (pCurrentResult_ in src/DbConnection.cpp); starting a new query cleans up that result and cancels it if it is incomplete.

Reproducer (needs a running PostgreSQL server):

library(RPostgres)
con <- dbConnect(Postgres())
res <- dbSendQuery(con, "SELECT 1")
identical(con@ptr, res@ptr)
#> [1] FALSE
# expected by the README: TRUE
dbClearResult(res)
dbDisconnect(con)

Severity: low (documentation only).

Found during the clean review of #607.


Generated by Claude Code

Activity

  1. added
    status: open
    on Nov 29, 2026
  2. krlmlr commented on Nov 29, 2026

    @krlmlr
    MemberAuthor

    Closed to keep the issue tracker for issues reported by others; the work here is still open and tracked with the status: open label.


    Generated by Claude Code

  3. added a commit that references this issue on Nov 29, 2026
    3824adf
  4. removed
    status: open
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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