Brian
unread,Sep 30, 2011, 1:43:50 AM9/30/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlal...@googlegroups.com
I have a postgres database local and stores data about our active students. The remote database for our SIS (Student Information System) is using Microsoft SQL.
I'm using psycopg2 and pymssql libraries respectively.
The date object types I'm getting back from these databases are different, so when I do a session.merge() from the remote to the local databases, is_modified() gets set and the history for that date attribute shows that a change is pending, even when the date is exactly the same in both instances.
smalldatetime in MSSQL ends up as a datetime.datetime object, and date in postgresql ends up as a datetime.date.
Is there an easy way I can force the MSSQL attribute to return a datetime.date object, or do I just need to do a type lookup on the object to make a change before I merge each time?
Thanks in advance.