SVN Commit by dpage: r4461 - trunk/pgadmin3/src/dlg

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4461 - trunk/pgadmin3/src/dlg
Date: 2005-09-23 12:50:47
Message-ID: 200509231250.j8NColiY006914@developer.pgadmin.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Author: dpage
Date: 2005-09-23 13:50:47 +0100 (Fri, 23 Sep 2005)
New Revision: 4461

Modified:
trunk/pgadmin3/src/dlg/dlgProperty.cpp
trunk/pgadmin3/src/dlg/dlgTable.cpp
Log:
Further fixes to table modification SQL

Modified: trunk/pgadmin3/src/dlg/dlgProperty.cpp
===================================================================
--- trunk/pgadmin3/src/dlg/dlgProperty.cpp 2005-09-23 12:38:25 UTC (rev 4460)
+++ trunk/pgadmin3/src/dlg/dlgProperty.cpp 2005-09-23 12:50:47 UTC (rev 4461)
@@ -310,7 +310,7 @@
+ wxT(" RENAME TO ") + qtIdent(GetName())
+ wxT(";\n");
} else {
- sql += wxT("ALTER ") + GetObject()->GetTypeName()
+ sql += wxT("ALTER ") + GetObject()->GetTypeName().MakeUpper()
+ wxT(" ") + GetObject()->GetQuotedFullIdentifier()
+ wxT(" RENAME TO ") + qtIdent(GetName())
+ wxT(";\n");

Modified: trunk/pgadmin3/src/dlg/dlgTable.cpp
===================================================================
--- trunk/pgadmin3/src/dlg/dlgTable.cpp 2005-09-23 12:38:25 UTC (rev 4460)
+++ trunk/pgadmin3/src/dlg/dlgTable.cpp 2005-09-23 12:50:47 UTC (rev 4461)
@@ -312,9 +312,6 @@

wxString definition;

- AppendNameChange(sql);
- AppendOwnerChange(sql, wxT("TABLE ") + tabname);
-
wxArrayString tmpDef=previousColumns;
wxString tmpsql;

@@ -327,7 +324,7 @@
definition=qtIdent(lstColumns->GetText(pos)) + wxT(" ") + lstColumns->GetText(pos, 1);
index=tmpDef.Index(definition);
if (index < 0)
- tmpsql += wxT("ALTER TABLE ") + tabname
+ tmpsql += wxT("ALTER TABLE ") + table->GetQuotedFullIdentifier()
+ wxT(" ADD COLUMN ") + definition + wxT(";\n");
}
else
@@ -353,12 +350,15 @@
definition = definition.Mid(1).BeforeFirst('"');
else
definition = definition.BeforeFirst(' ');
- sql += wxT("ALTER TABLE ") + tabname
+ sql += wxT("ALTER TABLE ") + table->GetQuotedFullIdentifier()
+ wxT(" DROP COLUMN ") + qtIdent(definition) + wxT(";\n");
}
// Add the ADD COLUMNs...
sql += tmpsql;

+ AppendNameChange(sql);
+ AppendOwnerChange(sql, wxT("TABLE ") + tabname);
+
tmpDef=previousConstraints;
tmpsql.Empty();

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2005-09-23 12:51:22 Re: altering table properties
Previous Message Dave Page 2005-09-23 12:39:00 Re: altering table properties