Re: altering table properties

From: Miha Radej <miha(dot)radej(at)siix(dot)com>
To: PgAdmin Hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: altering table properties
Date: 2005-09-23 12:27:17
Message-ID: 4333F4A5.9080909@siix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgadmin-support

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

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message svn 2005-09-23 12:38:26 SVN Commit by dpage: r4460 - trunk/pgadmin3/src/dlg
Previous Message Miha Radej 2005-09-23 12:14:06 altering table properties

Browse pgadmin-support by date

  From Date Subject
Next Message Diego Gil 2005-09-23 14:54:43 Re: wrong order of drop ... create ... sentences
Previous Message Miha Radej 2005-09-23 12:14:06 altering table properties