Array_agg restriction in Postgresql 9.1

When using array_agg or array_string, the array is returned empty over a specific size.

SELECT array_agg(x.id) FROM (SELECT id FROM table LIMIT 500) x - this works and returns an array.

but this query: SELECT array_agg(x.id) FROM (SELECT id FROM table LIMIT 667) x Does not work. it returns an empty array.

I am sure that this does not reach the size limit of the array. Any ideas why this is happening?

+6
source share
1 answer

the problem here was not in Postgresql, but in the client that I used. pgAdmin III does not display the contents of an array of a certain size. about 4,5 thousand when using psql one problem does not arise.

in the pgAdmin user interface pgAdmin is possible to set "Maximum characters in a column" , and in my case it was 256, which makes little sense, but you copy and paste an array that looks empty in a notepad, you will find all the data.

+6
source

Source: https://habr.com/ru/post/925281/


All Articles