Merge lp:~stefanor/ibid/pg-tz-417184 into lp:~ibid-core/ibid/old-trunk-pack-0.92

Proposed by Stefano Rivera
Status: Merged
Approved by: Jonathan Hitchcock
Approved revision: 739
Merged at revision: 742
Proposed branch: lp:~stefanor/ibid/pg-tz-417184
Merge into: lp:~ibid-core/ibid/old-trunk-pack-0.92
Diff against target: None lines
To merge this branch: bzr merge lp:~stefanor/ibid/pg-tz-417184
Reviewer Review Type Date Requested Status
Jonathan Hitchcock Approve
Michael Gorven Approve
Review via email: mp+10880@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Gorven (mgorven) wrote :

Wow, databases suck.
 review approve

review: Approve
Revision history for this message
Jonathan Hitchcock (vhata) wrote :

What he said.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/core.py'
2--- ibid/core.py 2009-07-15 22:28:01 +0000
3+++ ibid/core.py 2009-08-29 21:22:27 +0000
4@@ -305,11 +305,19 @@
5 c.execute("SET storage_engine=%s;" % mysql_engine)
6 c.execute("SET time_zone='+0:00';")
7 c.close()
8-
9 engine.pool.add_listener(MySQLModeListener())
10
11 engine.dialect.use_ansiquotes = True
12
13+ elif uri.startswith('postgres://'):
14+ class PGSQLModeListener(object):
15+ def connect(self, dbapi_con, con_record):
16+ c = dbapi_con.cursor()
17+ c.execute("SET TIME ZONE UTC")
18+ c.close()
19+
20+ engine.pool.add_listener(PGSQLModeListener())
21+
22 self[name] = scoped_session(sessionmaker(bind=engine))
23
24 self.log.info(u"Loaded %s database", name)

Subscribers

People subscribed via source and target branches