hi again!
Miha Radej wrote:
also, i wanted to remove a constraint (primary key) and add a new one
and pgadmin produced thie following code:
CONSTRAINT ALTER TABLE budget_type DROP CONSTRAINT pkey_budgettype;
ALTER TABLE budget_type ADDpkey_budget_type PRIMARY KEY (id);
there is an unneccesary CONSTRAINT in front of the first query and
in the second query there is no space between the ADD keyword and
constraint name.
i tried fiddling with the code (never touched c++ before so i was a bit
afraid i'd mess things up) and a small change fixed this specific issue,
here is the svn diff:
Index: src/dlg/dlgTable.cpp
===
--- src/dlg/dlgTable.cpp(revision 4459)
+++ src/dlg/dlgTable.cpp(working copy)
@@ -377,7 +377,7 @@
tmpsql += wxT(ALTER TABLE ) + tabname
+ wxT( ADD);
if (!conname.IsEmpty())
-sql += wxT( CONSTRAINT );
+tmpsql += wxT( CONSTRAINT );
tmpsql += definition + wxT(;\n);
}
cheers,
Miha
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org