| From: | Aislan Luiz Wendling <aislanluiz(at)hotmail(dot)com> |
|---|---|
| To: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
| Subject: | Array value from table as parameter |
| Date: | 2016-07-20 17:17:01 |
| Message-ID: | BAY174-W24742328EA824159F28978DD080@phx.gbl |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Hi,
I need to pass an array as a parameter in a function, but it is a part of a trigger that get a "new" value.
I've tested it like
select function_x(10000,555555,array[['xxxxx'],['yyyyy']]) orselect function_x(10000,555555,array[['xxxxx','yyyyy']])
and it worked.
But if I use
select function_x(10000,555555,new.situations)
it doesn't work, as the value comes like this: {"xxxxx","yyyyy"}
I couldn't find a function that converts {} values back to [] without treat it as a string and use replace, what I think that is not the ideal solution because it may can't satisfy more complex arrays.
Regards,
Aislan Luiz Wendling
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Pavel Suderevsky | 2016-07-20 17:30:14 | 9.5: pg_stat_statement and pgbench execution time discrepancies |
| Previous Message | Alex Ignatov | 2016-07-20 17:16:25 | pg_dump without any SET command in header of output plain text sql file |