Re: [sqlalchemy] postgresql tuple as function argument

2017-04-12 Thread mike bayer
On 04/12/2017 09:19 AM, Антонио Антуан wrote: your imports can't provide ARRAY class, I've added: from sqlalchemy.dialects.postgresql import ARRAY. My version is 1.0.14. for ARRAY + array_agg, explicit support for these things has improved in the 1.1 series, and if you're doing this kind of

Re: [sqlalchemy] postgresql tuple as function argument

2017-04-12 Thread Антонио Антуан
Ok, I'l try it, thank you. вторник, 11 апреля 2017 г., 17:26:18 UTC+3 пользователь Mike Bayer написал: > > I will say that the psycopg2 driver is not supporting this, however, it > isn't parsing out the tuple. Using postgresql.ARRAY we get an answer > like: > > ['{', '"', '(', 'x', ',',

Re: [sqlalchemy] postgresql tuple as function argument

2017-04-12 Thread Антонио Антуан
your imports can't provide ARRAY class, I've added: from sqlalchemy.dialects.postgresql import ARRAY. My version is 1.0.14. Output: /home/anton/Projects/.venv/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.py:185: SAWarning: Unicode type received non-unicode bind param value 'y'. (this

Re: [sqlalchemy] postgresql tuple as function argument

2017-04-11 Thread mike bayer
I will say that the psycopg2 driver is not supporting this, however, it isn't parsing out the tuple. Using postgresql.ARRAY we get an answer like: ['{', '"', '(', 'x', ',', 'y', ')', '"', ',', '"', '(', 'x', ',', 'y', ')', '"', '}'] that is, the string coming back is being interpreted

Re: [sqlalchemy] postgresql tuple as function argument

2017-04-11 Thread mike bayer
can't reproduce (though the ARRAY(unicode) type is not what psycopg2 returns, and there seems to be a difference in behavior between sqlalchemy.ARRAY and sqlalchemy.dialects.postgresql.ARRAY). please provide a complete example based on the below test script and stack traces also my PG

[sqlalchemy] postgresql tuple as function argument

2017-04-11 Thread Антонио Антуан
Hi I want to build such query with sqlalchemy: SELECT array_agg((column1, column2)) from table Using psql it works perfectly and returns such result: {"(col1_row1_value, col2_row1_value)", "(col1_row2_value, col2_row2_value)" ...} I tried several forms of SQLA-query: >> from