Hi all,

I'm experimenting a bit with postgresql arrays of uuid's.
Unfortunately I'm running into a bug or I'm not really understanding
it :-)

My schema definition is as follow:

    table = Table('example', metadata,
        Column('timestamp', DateTime(timezone=False), primary_key=True),
        Column('guids', ARRAY(GUID, dimensions=1)
    )

Where GUID is taken from
http://docs.sqlalchemy.org/en/rel_0_8/core/types.html#backend-agnostic-guid-type

Then I try to insert a row with the following code:

    stmt = table.insert().values(
        timestamp=datetime.datetime.utcnow(),
        num=2,
        guids=[uuid.uuid4()]
    )
    engine.execute(stmt)

This results in an ProgrammingError (column "guids" is of type uuid[]
but expression is of type text[] at character 97).
When using guids=array([uuid.uuid4()], type_=GUID) i receive the
following exception:
    TypeError: self_group() takes exactly 2 arguments (1 given)

The complete runnable code is located at https://gist.github.com/4433940

Am I missing something or do I need to register a custom type via psycopg2?

Thanks,
Michael

-- 
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.

Reply via email to