Postgres arrays are retrieved as objects
See original GitHub issueI have a table (in Postgres) with a field of type TEXT[]
but when I use knex (simple select query) I get that field as an object instead of an array.
I read this issue but it doesn’t give an answer for that.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Documentation: 15: 8.15. Arrays - PostgreSQL
First, we show how to access a single element of an array. This query retrieves the names of the employees whose pay changed...
Read more >Postgresql array retrieved via array_to_json needs conversion ...
I am saving an array of objects in postgresql. In postgresql the field of type text[] looks like the following:
Read more >How to Query Arrays in PostgreSQL - PopSQL
You can retrieve the contents of an array by specifying it in the select clause like any other column: select first_name,
Read more >PostgreSQL Array: Functions, Type, Example - Guru99
The elements of the array can be retrieved using the SELECT statement. The values of the array column can be enclosed within square...
Read more >Turning PostgreSQL rows into arrays - Reuven Lerner
So far in this series, I have described how you can create arrays and retrieve information from them — both the actual data...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok so I confirmed the error, but this is actually a problem with the underlying postgres driver that Knex uses, pg. You will have to bring it up there and then Knex can upgrade when the bug gets fixed.
Heres the reproduced example using just
pg
driverI suppose there is nothing to do in knex side to fix this, closing.