Thread: [SQL-CVS] r932 - trunk/SQLObject/sqlobject/postgres
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2005-08-22 05:47:52
|
Author: phd Date: 2005-08-22 05:47:48 +0000 (Mon, 22 Aug 2005) New Revision: 932 Modified: trunk/SQLObject/sqlobject/postgres/pgconnection.py Log: Fixed a problem: varchar without length in Postgres means any length. Modified: trunk/SQLObject/sqlobject/postgres/pgconnection.py =================================================================== --- trunk/SQLObject/sqlobject/postgres/pgconnection.py 2005-08-21 00:10:12 UTC (rev 931) +++ trunk/SQLObject/sqlobject/postgres/pgconnection.py 2005-08-22 05:47:48 UTC (rev 932) @@ -221,7 +221,10 @@ if t.count('int'): return col.IntCol, {} elif t.count('varying'): - return col.StringCol, {'length': int(t[t.index('(')+1:-1])} + if '(' in t: + return col.StringCol, {'length': int(t[t.index('(')+1:-1])} + else: # varchar without length in Postgres means any length + return col.StringCol, {} elif t.startswith('character('): return col.StringCol, {'length': int(t[t.index('(')+1:-1]), 'varchar': False} |