-
Notifications
You must be signed in to change notification settings - Fork 180
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
PG::TextDecoder::Array decodeы incorrectly arrays with nonstandard lower bound index #272
Comments
Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis). Thanks for the report! I wonder how |
Original comment by hbda NA (Bitbucket: hbda, GitHub: hbda). I thought a little more. Decoder shouldn't just ignore the bounds. This leads to the loss of some information. For example we use this syntax to compress arrays with leading nils.
But this is a special case. |
Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis). This is fixed per https://bitbucket.org/ged/ruby-pg/commits/0567662910977452ad8b9b5a6eb67bd5dd8e67ec . |
Original report by hbda NA (Bitbucket: hbda, GitHub: hbda).
By default, in Postgresql the lower bound index value of an array's dimensions is set to one. To represent arrays with other lower bounds, the array subscript ranges can be specified explicitly before writing the array contents. This decoration consists of square brackets ([]) around each array dimension's lower and upper bounds, with a colon (:) delimiter character in between. The array dimension decoration is followed by an equal sign (=). This is described in documentation.
For example:
This is one-dimensional array. But if try decode it by PG::TextDecoder::Array
it returns two-dimensional array
Decoder parse arrays without bounds description correctly.
The problem is reproduced in versions 0.18.4 and 1.0.0.
The text was updated successfully, but these errors were encountered: