-
Notifications
You must be signed in to change notification settings - Fork 458
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
Feedback: Paginate Results - cursor support #15616
Comments
Cursors are also listed as not supported on this page: |
Theodore Hyman (theodore-hyman) commented: |
shannonb (shannonbradshaw) commented: |
Theodore Hyman (theodore-hyman) commented: |
Dikshant Adhikari (dikshant) commented: What doesn’t work yet is WITH HOLD and a bunch of extra stuff captured in that ticket. It is perhaps worth coming up an example of CURSOR usage. Not sure why this was not documented, it appears this was added in 22.1. Thoughts Rafi Shamim Rima Deodhar ? A basic example I modified from the doc above: {noformat}CREATE TABLE Employee ( emp_id INT NOT NULL, emp_name character(10) NOT NULL, emp_address character(20) NOT NULL, emp_phone character(14), PRIMARY KEY (emp_name)); Creator cursor: {noformat}DECLARE test_cur CURSOR FOR SELECT * FROM Employee ORDER BY emp_id;{noformat} Fetch from cursor: {noformat}FETCH 1 FROM test_cur; Close cursor: {noformat}CLOSE test_cur;{noformat} WITH HOLD is valid syntax but it is only allowed so long as the cursor is closed within the transaction it is created in.: {noformat}BEGIN; The reason WITH HOLD exists is to make the cursor live outside of a transaction but we don’t support that. {noformat}BEGIN; Hope this example helps. |
Dikshant Adhikari (dikshant) commented: |
Rafi Shamim (rafiss) commented: |
Rafi Shamim (rafiss) commented: |
Richard Loveland (rmloveland) commented: here’s what I have so far, should be a PR soon: 1c779e8 I will update it with the information from Dikshant’s comment above as well |
Richard Loveland (rmloveland) commented: I was gonna ask Jordan but I think his response time might be pretty delayed due to just switching to CC (even tho he wrote cockroachdb/cockroach#74006 ). But let me know if you still think he’s the best person to ask |
Steven Hand (hand-crdb) commented:
Page: https://cockroachlabs.com/docs/v22.1/pagination.html
What is the reason for your feedback?
[ ] Missing the information I need
[ ] Too complicated
[X] Out of date
[ ] Something is broken
[ ] Other
Additional details
This page says "CockroachDB does not have cursors." But initial cursor support is in 22.1 based on this GitHub issue comment from Feb. 27:
cockroachdb/cockroach#41412 (comment)
That initial work is described more in this GitHub issue:
cockroachdb/cockroach#74006
Here's a summary of remaining work on cursors (from GitHub issue #41412):
sql: support BINARY cursor #77099
Open
sql: support MOVE on cursors #77100
Closed
sql: support DECLARE cursor WITH HOLD #77101
Open
sql: support DECLARE SCROLL and reverse FETCH on cursors #77102
Open
sql: support FOR UPDATE on cursors #77103
Open
sql: respect SAVEPOINT for cursors #77104
Open
Jira Issue: DOC-6185
The text was updated successfully, but these errors were encountered: