dabo Commit
Revision 4716
Date: 2008-11-25 20:11:18 -0800 (Tue, 25 Nov 2008)
Author: Johnf
Trac: http://svn.dabodev.com/trac/dabo/changeset/4716

Changed:
U   trunk/dabo/db/dbPostgreSQL.py

Log:
Larry notice I was not retrieving values for views.  Fixed Thanks to Larry Long

Diff:
Modified: trunk/dabo/db/dbPostgreSQL.py
===================================================================
--- trunk/dabo/db/dbPostgreSQL.py       2008-11-26 02:00:28 UTC (rev 4715)
+++ trunk/dabo/db/dbPostgreSQL.py       2008-11-26 04:11:18 UTC (rev 4716)
@@ -89,11 +89,16 @@
                tableNameBreak=tableName.split('.',1)
                localSchemaName = tableNameBreak[0]
                localTableName = tableNameBreak[1]
-               cursor.execute("""select c.oid,a.attname, t.typname, 
b.schemaname from pg_class c 
-inner join pg_attribute a on a.attrelid = c.oid 
-inner join pg_type t on a.atttypid = t.oid 
-inner join pg_tables b on b.tablename=c.relname
-where (b.schemaname || '.'|| c.relname)  = '%s' and a.attnum > 0 """ % 
tableName)
+               
+
+                       
+               cursor.execute("""SELECT a.attname, t.typname from pg_attribute 
a,pg_type t, pg_class c 
+               LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
+               where a.attrelid = c.oid 
+               and a.atttypid = t.oid 
+               AND n.nspname || '.'||c.relname = '%s'
+               order by c.relname,a.attname""" % tableName)
+
                rs = cursor.getDataSet()
 
                #the code below may not work with 7.4 due to the use of the 
function generate_series()
@@ -124,7 +129,7 @@
                else:
                        #thestr = rs2[0][3]
                        thePKFieldName = rs2[0]['column_name']
-               
+
                fields = []
                for r in rs:
                        name = r["attname"]




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to