On Jan 2, 2008, at 2:56 AM, Andreas Jung wrote:
> I have a PG table containing a row
>
> tools varchar(256)[][]
>
> that stores a list of tuples ('HI1234', 'somestring').
>
> Setting the tools property on Python level leads to bad SQL code:
>
> ProgrammingError) Fehler »syntax error« bei »,« at character 52
> 'UPDATE hierarchies SET tools=%(tools)s WHERE hierarchies.id = %
> (hierarchies_id)s' {'tools': [('HI641774', ''), ('HI508670', ''),
> ('HI788784', ''), ('HI952450', ''), ('HI884580', ''), ('HI642122',
> ''), ('HI1496415', '')], 'hierarchies_id': 7667}
>
> Is there a workaround in SA 0.3 for working with arrays? I assume
> the PGArray type in SA 0.4 would resolve this issue..however the
> code base is too big right for doing the switch to SA 0.4 now.
>
the PGArray type isnt doing much except processing the "inner" value
according to whatever processing rules should apply to them. I think
psycopg2 should be handling the "arrayness" of it - maybe try
converting your tuples to arrays.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---