I have this query select array_agg(id) as idtag FROM POdelivery_a where ....
It gives me id in array: {26053,26021,26055} I use it later in other queries...
for the question assume I use it like this:
select * from a where id in {26053,26021,26055}
it gives me an error:
ERROR: syntax error at or near "{"
it will accept the query as:
select * from a where d in (26053,26021,26055)
So why array_agg(id) returns me an array that I can not work with? I always need to do conversions...
is there a way that array_agg(id) will return the result as (26053,26021,26055) not as {26053,26021,26055}?
Why does PostgreSQL works with many kinds of arrays?
(26053,26021,26055)is not an array. And{26053,26021,26055}is just the text representation of an array (explained in the manual: postgresql.org/docs/current/static/arrays.html#ARRAYS-IO)(26053,26021,26055)? What i'm doing now is take the{26053,26021,26055}and replace the Brackets... its not very stylish...where id in (select id from ...)select array_agg(id) as idtag FROM POdelivery_a where ....isn't my real query... it's was used to explain my situation. The real query is over 20 lines. I care about the result:{26053,26021,26055}and the result will be used in many other places... i won't run the query every time.. I need to save the results....