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

Add default decoder for anonymous record types to BasicTypeRegistry #579

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

larskanis
Copy link
Collaborator

The PostgreSQL server just sends the generic OID 2249 for generic record/composite types in query results like:

  SELECT row(123, 'str', true, null)

Since we don't get the OIDs of the record items, we can not properly decode them. Nevertheless it's helpful to decode at least with the default type map and decode all items to an array of strings like so:

c.exec("SELECT 6, row(123, 'str', true, null), 7").values
 => [[6, ["123", "str", "t", nil], 7]]

instead of:

 => [[6, "(123,str,t,)", 7]] 

Related to #578

The PostgreSQL server just sends the generic OID 2249 for generic record/composite types in query results like:
  SELECT row(123, 'str', true, null)

Since we don't get the OIDs of the record items, we can not properly decode them.
Nevertheless it's helpful to decode at least with the default type map and decode all items to an array of strings like so:

c.exec("SELECT 6, row(123, 'str', true, null), 7").values
 => [[6, ["123", "str", "t", nil], 7]]

instead of:
 => [[6, "(123,str,t,)", 7]]

Related to ged#578
@larskanis larskanis merged commit beafa09 into ged:master Aug 12, 2024
13 of 17 checks passed
@larskanis larskanis deleted the add-record-to-btm branch August 12, 2024 09:28
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

Successfully merging this pull request may close these issues.

2 participants