commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r7381 - trunk/gnue-common/src/datasources/drivers/postgresql/Sche


From: jamest
Subject: [gnue] r7381 - trunk/gnue-common/src/datasources/drivers/postgresql/Schema/Discovery
Date: Fri, 15 Apr 2005 14:26:11 -0500 (CDT)

Author: jamest
Date: 2005-04-15 14:26:10 -0500 (Fri, 15 Apr 2005)
New Revision: 7381

Modified:
   
trunk/gnue-common/src/datasources/drivers/postgresql/Schema/Discovery/Introspection.py
Log:
skip over functional indexes in postgres as they don't reference fields
example: create index foo on customer(lower(name));


Modified: 
trunk/gnue-common/src/datasources/drivers/postgresql/Schema/Discovery/Introspection.py
===================================================================
--- 
trunk/gnue-common/src/datasources/drivers/postgresql/Schema/Discovery/Introspection.py
      2005-04-15 18:04:43 UTC (rev 7380)
+++ 
trunk/gnue-common/src/datasources/drivers/postgresql/Schema/Discovery/Introspection.py
      2005-04-15 19:26:10 UTC (rev 7381)
@@ -198,11 +198,19 @@
               "FROM pg_index i, pg_class c " \
               "WHERE i.indrelid = %s AND c.oid = i.indexrelid" % relid
 
+    print "CMD: ", cmd
     cursor = self._connection.makecursor (cmd)
 
     try:
       for rs in cursor.fetchall ():
         order = rs [3].split ()
+        
+        # Skip functional indexes. A functional index is an 
+        # index that is built upon a fuction manipulating a field
+        # upper(userid) vs userid.  
+        if not order: 
+          continue
+                
         result [rs [0]] = {'unique' : rs [1],
                            'primary': rs [2],
                            'fields' : []}
@@ -211,6 +219,7 @@
                "WHERE attrelid = %s AND attnum in (%s)" \
               % (relid, string.join (order, ","))
 
+        print "OUTPUT: ",cmd
         fcursor = self._connection.makecursor (cmd)
 
         try:





reply via email to

[Prev in Thread] Current Thread [Next in Thread]