If you want to insert an array into the postgreSQL database through SQL, follow these steps:
INSERT INTO tablename VALUES ('{value1,value2,value3}');
ATTENTION: You need single quotes to surround braces! So, you pass the string / Varchar special grammar "array" to DB
If I inject my code into the python parser, I will get something like this:
'{'Name': 'Guest', 'Details': "['One', 'Two', 'Three']"}'
But PostgreSQL expects something like this:
'{"Name","Guest","Details",{"One","Two","Three"}}'
Check out the array guide: http://www.postgresql.org/docs/9.0/static/arrays.html
So, either you format the String according to PostgreSQL "array-grammar" by writing a helper function, or you use a library that does this for you.
source share