Title: Support arrays with start index != 1 · Issue #23 · PyGreSQL/PyGreSQL · GitHub
Open Graph Title: Support arrays with start index != 1 · Issue #23 · PyGreSQL/PyGreSQL
X Title: Support arrays with start index != 1 · Issue #23 · PyGreSQL/PyGreSQL
Description: The current implementation of the cast_array function in the C module ignores the start index of PostgreSQL arrays. They are assumed to always be 1. As discussed on the mailing list in September 2016, this should be improved: The idea is...
Open Graph Description: The current implementation of the cast_array function in the C module ignores the start index of PostgreSQL arrays. They are assumed to always be 1. As discussed on the mailing list in September 20...
X Description: The current implementation of the cast_array function in the C module ignores the start index of PostgreSQL arrays. They are assumed to always be 1. As discussed on the mailing list in September 20...
Opengraph URL: https://github.com/PyGreSQL/PyGreSQL/issues/23
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support arrays with start index != 1","articleBody":"The current implementation of the `cast_array` function in the C module ignores the start index of PostgreSQL arrays. They are assumed to always be 1. As discussed on the mailing list in September 2016, this should be improved:\r\n\r\nThe idea is that the `cast_array` function should take an additonal, optional `cls` parameter which will then be used as the base class for the array. If that parameter is `None` or `list`, then the method works as before, returning a list or a list of lists for multidimensional arrays. If it is any other class, then this will be considered as a subclass of list that will be used instead of the builtin list for building the return values. In addition, the instances of this list subclass will have a `lower` attribute set to the start index of the corresponding PostgreSQL (sub)arrays by the `cast_array` function.\r\n\r\nIt should then be possible to change the default value for `cls` passed into the `cast_array` function to a custom list subclass. That subclass could consider the start index when getting items, and return `None` it the index points to outside the array. This would emulate the behavior of PostgreSQL arrays more closely.\r\n\r\nNote that when we support start indices when converting Pg to Py, we also need to support them when converting from Py to Pg. Currently this is done with the ARRAY constructor, which doesn't allow for start indices as far as I know, so this needs to be changed.\r\n\r\n(copied from Trac ticket 72, created 2016-09-21)","author":{"url":"https://github.com/Cito","@type":"Person","name":"Cito"},"datePublished":"2020-02-15T22:41:42Z","url":"https://github.com/PyGreSQL/PyGreSQL/issues/23"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0441073f-0fdb-8150-f6e2-7e4a443480da |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8548:362421:2FAA2:42A6A:6B046162 |
| html-safe-nonce | d8185b7a6e48130e853648945199ae25423c86de0e5672b369411e14b9e0e4d2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTQ4OjM2MjQyMToyRkFBMjo0MkE2QTo2QjA0NjE2MiIsInZpc2l0b3JfaWQiOiI2ODY5Mzk2MjQxNDgzMzI1Nzk0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e2fe07c2f326689efa17d41663e713725339d8555330bb10c78517b7ce804ebb |
| hovercard-subject-tag | issue:565819581 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PyGreSQL/PyGreSQL/23/issue_layout |
| twitter:image | https://opengraph.githubassets.com/683fe8eade9906dcd2f87214077d166e1ed44ff3075bff5bf300f8598ec8425f/PyGreSQL/PyGreSQL/issues/23 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/683fe8eade9906dcd2f87214077d166e1ed44ff3075bff5bf300f8598ec8425f/PyGreSQL/PyGreSQL/issues/23 |
| og:image:alt | The current implementation of the cast_array function in the C module ignores the start index of PostgreSQL arrays. They are assumed to always be 1. As discussed on the mailing list in September 20... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Cito |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6 |
| turbo-cache-control | no-preview |
| go-import | github.com/PyGreSQL/PyGreSQL git https://github.com/PyGreSQL/PyGreSQL.git |
| octolytics-dimension-user_id | 60857770 |
| octolytics-dimension-user_login | PyGreSQL |
| octolytics-dimension-repository_id | 51212044 |
| octolytics-dimension-repository_nwo | PyGreSQL/PyGreSQL |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 51212044 |
| octolytics-dimension-repository_network_root_nwo | PyGreSQL/PyGreSQL |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 03e114520787ad27289207f153520ef97461127c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width