Some map<X>Array not working
See original GitHub issueI try to use arrays, and get stuck with using numeric arrays and string arrays. Double arrays work as specified in the test, but numeric, or strings fails with the following error: org.postgresql.util.PSQLException: ERROR: wrong element type
Column definition is a simple:
create table my_table (
my_strings varchar[],
my_numeric numeric[]
);
Rings a bell and am I overseeing something, or is this a missing feature? 😃
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Array map function doesn't change elements - Stack Overflow
The map() method creates a new array with the results of calling a provided function on every element in this array.
Read more >How To Fix object.map is not a function Error in JavaScript
The cause of your error is actually quite simple: the .map() method is only applicable when working with arrays. More specifically, the method ......
Read more >Array.prototype.map() - JavaScript - MDN Web Docs
The map() method creates a new array populated with the results of calling a provided function on every element in the calling array....
Read more >Are you using Array.map correctly? - RedBit Development
Using 'Array.map' for anything other than mapping creates a few problems. First and foremost, it makes the code less clear.
Read more >JavaScript Array map() Method - W3Schools
map () creates a new array from calling a function for every array element. map() calls a function once for each element in...
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

👍
Have a look at my commit mentioned above here. or click here
I think this is a setup that can work. Just need to add more unit tests so more array types get some coverage.
If you’re happy with it I can make a pull request for it.
I also found some weird behaviour with inserting numeric arrays on my side, but haven’t looked into that yet. But it looked like all inserted BigDecimals were wrong.