Discussion:
onupdate not working with postgresql
Kartik Lakhotia
2011-07-01 22:15:23 UTC
Permalink
I have specified a column in my table as
--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to sqlalchemy+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Kartik Lakhotia
2011-07-01 22:21:59 UTC
Permalink
Sorry, i left a half finished message by mistake.
I have described a column as :

updated = Column(DateTime, onupdate = datetime.datetime.now())

But it leaves the field value null when any row is updated. I have also
tried using func.current_Timestamp but that doesnt work either.
--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to sqlalchemy+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Moodi
2011-07-01 23:36:37 UTC
Permalink
I too faced a similar problem. Spent a lot of time just to figure out that -

*These update functions do not work when you try to update the table
directly from database. *And actually they should not, as postgres does not
provide such feature in its database

When I tried updating from sqlalchemy session - things worked for me.
SQLalchemy has already implemented the required triggers for auto updation.
May be its the same problem for you.


*
*
--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/LKHHqIgqTdQJ.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to sqlalchemy+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Kartik Lakhotia
2011-07-02 11:58:17 UTC
Permalink
It was exactly da same problem i was facing..
Thaks a lot moodi. I got dis now
--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to sqlalchemy+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Loading...