# Scripting support for arrays in Postgres Queries

**URL:** <https://forum.inductiveautomation.com/t/scripting-support-for-arrays-in-postgres-queries/16687>\
**Category:** Ignition\
**Tags:** ignition79, database, scripting\
**Created:** [January 23, 2018, 3:55am UTC](https://forum.inductiveautomation.com/t/scripting-support-for-arrays-in-postgres-queries/16687 "2018-01-23T03:55:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![huon.kendall](https://avatars.discourse-cdn.com/v4/letter/h/7ba0ec/32.png) [@huon.kendall](https://forum.inductiveautomation.com/u/huon.kendall)\
**Post date:** [January 23, 2018, 3:55am UTC](https://forum.inductiveautomation.com/t/scripting-support-for-arrays-in-postgres-queries/16687/1 "2018-01-23T03:55:39Z")

</div>

I am encountering errors for a simple Query of a Postgres table containing arrays. I suspect either arrays are not supported, or I am doing something wrong?

Any advise greatly appreciated - thanks in advance.

#Sample Code where voltage and current columns are arrays

query = “”"  
SELECT  
test\_id,  
voltage,  
current  
FROM ivcurves  
WHERE ivcurves.test\_id = 861;  
“”"

data = system.db.runQuery(query,database = ‘ds\_flashtester01’)

## post submit edit

I just found reference to the Postgres UNNEST function within the Query, so I now have a working query!  
SELECT  
test\_id,  
UNNEST(ARRAY[voltage]),  
UNNEST(ARRAY[current])  
FROM ivcurves  
WHERE ivcurves.test\_id = 861;

Any other advice would still be appreciated
