... | ... | @@ -197,7 +197,7 @@ With cursors the desired query is submitted to the DB once, and the results are |
|
|
**Postgresql**
|
|
|
|
|
|
```
|
|
|
Cursors are identified by name in Posgresql, names need only be unique
|
|
|
Cursors are identified by name in PostgreSQL, names need only be unique
|
|
|
within a session. The cursor must first be created for the given SQL
|
|
|
statement, and then used in iterative fetch invocations to retrieve
|
|
|
the query results by fetching the NEXT n records:
|
... | ... | @@ -219,7 +219,7 @@ https://www.postgresql.org/docs/current/plpgsql-cursors.html |
|
|
|
|
|
```
|
|
|
To use cursors with a prepared statement we need to set requisite statement attributes
|
|
|
with mysq_stmt_attr_set(). Note, that one of those parameters, STMT_ATTR_PREFETCH_ROWS,
|
|
|
with mysql_stmt_attr_set(). Note, that one of those parameters, STMT_ATTR_PREFETCH_ROWS,
|
|
|
determines the number of rows returned on each fetch:
|
|
|
|
|
|
https://dev.mysql.com/doc/c-api/5.6/en/mysql-stmt-attr-set.html
|
... | ... | @@ -246,7 +246,7 @@ WHERE |
|
|
AND
|
|
|
user-context.remote-id = $2
|
|
|
ORDER by ip-addr
|
|
|
LIMIT $3
|
|
|
LIMIT $3
|
|
|
```
|
|
|
|
|
|
Or per this page https://www.postgresql.org/docs/12/queries-limit.html, you can use skip the first n rows by using OFFSET and LIMIT together with ORDER BY:
|
... | ... | @@ -667,7 +667,7 @@ The work breaks down into two parallel tracks: Query fulfillment and LeaseQueryL |
|
|
b. V6 Cross-reference table and triggers (schema + SQL queries)
|
|
|
c. Implement new query functions
|
|
|
|
|
|
1.5 PostgresSQL Lease Mgr
|
|
|
1.5 PostgreSQL Lease Mgr
|
|
|
a. Change lease4/6 user_context column from TEXT to JSONB, update existing SQL
|
|
|
as needed
|
|
|
b. V4 JSONB/GIN (schema + SQL queries)
|
... | ... | @@ -693,4 +693,4 @@ The work breaks down into two parallel tracks: Query fulfillment and LeaseQueryL |
|
|
3.1 Add callouts as needed
|
|
|
3.2 Extend configuration parsing
|
|
|
3.4 Instantiate LeaseQueryListener (when enabled)
|
|
|
``` |
|
|
\ No newline at end of file |
|
|
``` |