Web pgadmin.org
 Home 
 ·  ·  ·  ·  ·  ·  · 
CVS Commit by andreas: fix adding sequence columns

CVS Commit by andreas: fix adding sequence columns



Log Message:
-----------
fix adding sequence columns

Modified Files:
--------------
    pgadmin3/src/ui:
        dlgColumn.cpp (r1.38 -> r1.39)

Index: dlgColumn.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgColumn.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -Lsrc/ui/dlgColumn.cpp -Lsrc/ui/dlgColumn.cpp -u -w -r1.38 -r1.39
--- src/ui/dlgColumn.cpp
+++ src/ui/dlgColumn.cpp
@@ -293,14 +293,9 @@
                     + wxT(" ") + typname + wxT(";\n")
                     + wxT("ALTER TABLE ") + table->GetQuotedFullIdentifier()
                     + wxT("\n   ALTER COLUMN ") + qtIdent(name)
-                    + wxT(" SET NOT NULL;\n")
-                    + wxT("ALTER TABLE ") + table->GetQuotedFullIdentifier()
-                    + wxT("\n   ALTER COLUMN ") + qtIdent(name)
-                    + wxT(" SET DEFAULT nextval('") + sequence + wxT("'::text);\n");
+                    + wxT(" SET DEFAULT nextval('") + sequence + wxT("'::text);\n")
 
-                if (newSequence)
-                {
-                    sql += wxT("INSERT INTO pg_depend(classid, objid, objsubid, refclassid, refobjid, refobjsubid, deptype)\n")
+                      wxT("INSERT INTO pg_depend(classid, objid, objsubid, refclassid, refobjid, refobjsubid, deptype)\n")
                         wxT("SELECT cl.oid, seq.oid, 0, cl.oid, ") + table->GetOidStr() + wxT(", attnum, 'i'\n")
                         wxT("  FROM pg_class cl, pg_attribute, pg_class seq\n")
                         wxT("  JOIN pg_namespace sn ON sn.OID=seq.relnamespace\n")
@@ -309,7 +304,6 @@
                         wxT("  AND sn.nspname=") + qtString(table->GetSchema()->GetName()) + wxT("\n")
                         wxT("  AND attrelid=") + table->GetOidStr() + wxT(" AND attname=") + qtString(name) + wxT(";\n");
                 }
-            }
             else
             {
                 sql = wxT("ALTER TABLE ") + table->GetQuotedFullIdentifier()


Home | Main Index | Thread Index

top