Re: altering table properties
От | Miha Radej |
---|---|
Тема | Re: altering table properties |
Дата | |
Msg-id | 4333F4A5.9080909@siix.com обсуждение исходный текст |
Ответ на | altering table properties (Miha Radej <miha.radej@siix.com>) |
Список | pgadmin-hackers |
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
В списке pgadmin-hackers по дате отправления: