Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgadmin-hackerspgadmin-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

pgadmin-hackers by date

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

pgadmin-support by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group