Mage wrote: > create or replace function trigger_keywords_maintain() returns trigger as $$ > return 'MODIFY' > $$ language plpythonu; > > update table set id = id where id = 7; > > ERROR: invalid input syntax for type timestamp: "2005-05-03 > 14:07:33,279213" > > I see that Python's timestamp format is not accepted by postgresql.
First, you don't give enough context to see where your python code generates a timestamp, but in any case it's more of a limitation than a bug that plpython doesn't try to autoconvert certain datatypes. (Are you even returning a datetime class, or a string?) You could play around with strftime to try to get something postgresql will recognize, but it's probably easier to just return an epoch value which you can turn into a postgresql timestamp with the abstime function. -Jonathan -- http://mail.python.org/mailman/listinfo/python-list