Author: phd
Date: Sun May 13 09:52:34 2012
New Revision: 4525
Log:
Merged revision 4524 from branch 1.2: fixed a minor bug in PostgreSQL introspection.
Modified:
SQLObject/branches/1.3/docs/News.txt
SQLObject/branches/1.3/sqlobject/postgres/pgconnection.py
Modified: SQLObject/branches/1.3/docs/News.txt
==============================================================================
--- SQLObject/branches/1.3/docs/News.txt Sun May 13 09:48:41 2012 (r4524)
+++ SQLObject/branches/1.3/docs/News.txt Sun May 13 09:52:34 2012 (r4525)
@@ -7,6 +7,11 @@
.. _start:
+SQLObject 1.3.1
+===============
+
+* A bugfix was ported from `SQLObject 1.2.3`_.
+
SQLObject 1.3.0
===============
@@ -18,10 +23,16 @@
* PostgresConnection performs translation of exceptions to standard
SQLObject's hierarchy of exceptions.
-* Major update in FirebirdConnection: introspection was completely
+* Major update of FirebirdConnection: introspection was completely
rewritten and extended; ``charset`` was renamed to ``dbEncoding``;
a longstanding bug was fixed - pass port to connect().
+SQLObject 1.2.3
+===============
+
+* Fixed a minor bug in PostgreSQL introspection: VIEWs don't have
+ PRIMARY KEYs - use sqlmeta.idName as the key if there is no one.
+
SQLObject 1.2.2
===============
Modified: SQLObject/branches/1.3/sqlobject/postgres/pgconnection.py
==============================================================================
--- SQLObject/branches/1.3/sqlobject/postgres/pgconnection.py Sun May 13 09:48:41 2012 (r4524)
+++ SQLObject/branches/1.3/sqlobject/postgres/pgconnection.py Sun May 13 09:52:34 2012 (r4525)
@@ -289,6 +289,9 @@
assert match, "Unparseable contraint definition: %r" % indexDef
assert primaryKey is None, "Already found primary key (%r), then found: %r" % (primaryKey, indexDef)
primaryKey = match.group(1)
+ if primaryKey is None:
+ # VIEWs don't have PRIMARY KEYs - accept help from user
+ primaryKey = soClass.sqlmeta.idName
assert primaryKey, "No primary key found in table %r" % tableName
if primaryKey.startswith('"'):
assert primaryKey.endswith('"')
|