that should be fine, what does your log output say ? On Jan 14, 2009, at 12:38 AM, atomburner wrote:
> > Mr. Bayer, you know entirely too much about all kinds of databases. > > A follow-up question to your erudite comment (and let me first say > that I love sqlalchemy and have spent a good amount of time immersed > in its documentation before posting): > > I tried running an update query of the form > > conn.execute(tbl.update().where(tbl.c.name=='test').values > (title='updated_title')) > > FWIW the column was setup as follows (in PostgreSQL 8.2): > > Column('updated', DateTime, onupdate=func.now()) > > After running above code and requerying the db, the 'updated' column > is still null. > > I also tried using func.current_timestamp() with no luck. > > Any tips you are able to provide are greatly appreciated. > > Best regards, > Atom > > > > On Dec 6 2008, 6:48 am, Michael Bayer <mike...@zzzcomputing.com> > wrote: >> that is the correct syntax. It will take effect any time an update() >> construct is used or when the ORM updates a row. Becauseonupdateis >> not a DDL-side construct, it will not take effect if you use a plain >> text UPDATE statement or if the update is otherwise not emitted by >> the >> SQLAlchemy application. The PassiveDefault, since it does represent >> DDL, will work in this manner, but only if the table was created >> using >> this table construct. >> >> On Dec 6, 2008, at 4:50 AM, jo wrote: >> >> >> >>> Hi all, >> >>> I created a table with the following column: >> >>> Column('last_updated', DateTime, >>> PassiveDefault(func.current_timestamp >>> ()),onupdate=func.current_timestamp()) >> >>> Maybe I don't understand howonupdateworks. >>> I would like to have this column to be changed every time the row is >>> updated, >>> but it doesn't work. >> >>> thank you for any help >> >>> j >> >> > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---