dabo Commit
Revision 4500
Date: 2008-09-02 07:57:02 -0700 (Tue, 02 Sep 2008)
Author: Johnf
Trac: http://svn.dabodev.com/trac/dabo/changeset/4500

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

Log:
Added comments to assist users of 7.4 to simulate our use of the function
generate_series()

Diff:
Modified: trunk/dabo/db/dbPostgreSQL.py
===================================================================
--- trunk/dabo/db/dbPostgreSQL.py       2008-09-01 23:28:52 UTC (rev 4499)
+++ trunk/dabo/db/dbPostgreSQL.py       2008-09-02 14:57:02 UTC (rev 4500)
@@ -96,7 +96,17 @@
 where (b.schemaname || '.'|| c.relname)  = '%s' and a.attnum > 0 """ % 
tableName)
                rs = cursor.getDataSet()
 
-               ## get the PK the code should work well with 7.4 - 8.2 versions
+               #the code below may not work with 7.4 due to the use of the 
function generate_series()
+               #However a postgres function can be added to simulate 
generate_series()
+               #CREATE OR REPLACE FUNCTION generate_series(int, int) RETURNS 
setof int AS  
+               #'BEGIN
+               #FOR i IN $1..$2
+               #LOOP 
+               #RETURN NEXT i;
+               #END LOOP; 
+               #RETURN; 
+               #END; ' LANGUAGE plpgsql;
+               
                sqlstr = """SELECT n.nspname AS schema_name, c.relname AS 
table_name,
            c.oid AS table_oid, a.attname AS column_name, idx.n + 1 AS 
ordinal_position
       FROM pg_class c, pg_attribute a, pg_index i, pg_namespace n, 
generate_series(0, 31) idx(n)




_______________________________________________
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