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

It is not possible to extract an array of bytea. #36

Open
pinver opened this issue Jun 27, 2014 · 3 comments
Open

It is not possible to extract an array of bytea. #36

pinver opened this issue Jun 27, 2014 · 3 comments

Comments

@pinver
Copy link
Contributor

pinver commented Jun 27, 2014

Actually the PostgreSQL bytea type is handled by the D ubyte[] type, like the varchar, text is handled by the D string type.

The readArray method of 'Message' is using methods like 'arrayDimensions!T' or 'readDimension' that have specials check for handling strings, with the isSomeString template, but can't actually handle the case where the PostgreSQL column to read has a type bytea[], that must be read by a ubyte[][] array.

Suggestion? There's some workaround of this is an intended behaviours? Must I provide a pull request with the adaptations to 'readDimension', 'arrayDimensions', 'multiArrayElemType' to handle the case?

@pszturmaj
Copy link
Owner

isSomeString are neccessary because ddb treats strings as base types. Otherwise strings would be treated as arrays of chars. As for ubyte[][] problem, pull request is welcome.

@pinver
Copy link
Contributor Author

pinver commented Jun 27, 2014

Exactly, so the question is: should we also thread ubyte[] as a base type, for handling bytea? Or maybe immutable(ubyte)[], for symmetry with string?

@etcimon
Copy link
Contributor

etcimon commented Jun 27, 2014

Or maybe immutable(ubyte)[], for symmetry with string?

I've never seen a data type like that before, but if it's serialized or binary data (which it probably is) you'll need a ubyte[] to put it through some engines like MsgPackD, so I guess the immutable would be somewhat impractical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants