Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pgsrv: Respect max rows paramter when executing a statement #132

Closed
Tracked by #101
justinrubek opened this issue Sep 28, 2022 · 3 comments
Closed
Tracked by #101

pgsrv: Respect max rows paramter when executing a statement #132

justinrubek opened this issue Sep 28, 2022 · 3 comments
Labels
feat New feature or request

Comments

@justinrubek
Copy link
Contributor

justinrubek commented Sep 28, 2022

A prepared statement that is used with Bind creates a portal which can be executed. The current implementation will execute the plan but does not respect the max rows parameter and also never sends a PortalSuspended message

postgres docs

Once a portal exists, it can be executed using an Execute message. The Execute message specifies the portal name (empty string denotes the unnamed portal) and a maximum result-row count (zero meaning “fetch all rows”). The result-row count is only meaningful for portals containing commands that return row sets; in other cases the command is always executed to completion, and the row count is ignored. The possible responses to Execute are the same as those described above for queries issued via simple query protocol, except that Execute doesn't cause ReadyForQuery or RowDescription to be issued.

If Execute terminates before completing the execution of a portal (due to reaching a nonzero result-row count), it will send a PortalSuspended message; the appearance of this message tells the frontend that another Execute should be issued against the same portal to complete the operation. The CommandComplete message indicating completion of the source SQL command is not sent until the portal's execution is completed. Therefore, an Execute phase is always terminated by the appearance of exactly one of these messages: CommandComplete, EmptyQueryResponse (if the portal was created from an empty query string), ErrorResponse, or PortalSuspended.

@justinrubek justinrubek changed the title Execute pgsrv: Execute prepared statement Sep 28, 2022
@scsmithr scsmithr added feat New feature or request and removed enhancement labels Nov 20, 2022
@scsmithr scsmithr self-assigned this Nov 28, 2022
@scsmithr scsmithr removed their assignment Dec 5, 2022
@greyscaled
Copy link
Contributor

See: #131 (comment)

@scsmithr scsmithr changed the title pgsrv: Execute prepared statement pgsrv: Respect max rows paramter when executing a statement Feb 17, 2023
@scsmithr
Copy link
Member

We support executing a statement, just not the max rows part. Updated title to reflect that.

@greyscaled
Copy link
Contributor

Stale - can reopen later

@greyscaled greyscaled closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants