[pgadmin-hackers] SVN Commit by dpage: r4756 - trunk/pgadmin3

2005-11-25 Thread svn
Author: dpage
Date: 2005-11-25 08:40:17 + (Fri, 25 Nov 2005)
New Revision: 4756

Modified:
   trunk/pgadmin3/CHANGELOG.txt
Log:
Here is a patch to copy pg_dump and pg_restore into
$bundledir/Contents/SharedSupport/helper/. pgAdmin3.app should
find it there, but I didn't test this yet (I just have
access to my build-machine over ssh ATM - I'll need my powerbook
to test this).
[Florian G. Pflug]

Modified: trunk/pgadmin3/CHANGELOG.txt
===
--- trunk/pgadmin3/CHANGELOG.txt2005-11-25 08:40:06 UTC (rev 4755)
+++ trunk/pgadmin3/CHANGELOG.txt2005-11-25 08:40:17 UTC (rev 4756)
@@ -7,6 +7,7 @@
 liAHP - Adam H. Pendleton
 liMP  - Marc Persuy
 liDAP - Darko Prenosil
+liFGP - Florian G. Pflug
 /ul
 bVersions and releases/bbr
 The following list contains all changes to pgAdmin3, as present in svn. 
@@ -17,6 +18,7 @@
 /ul
 br
 ul
+li2005-11-20 FGP 1.4.1  Include pg_dump/pg_restore in the Mac OSX bundle
 li2005-11-20 DP  1.4.1  Use a proper 'Save As' style dialogue for 
selecting backup files
 li2005-11-20 AP  1.4.1  Don't show pk hint when editing view
 li2005-11-20 AP  1.4.1  Add missing NO ACTION FK constraint


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


[pgadmin-hackers] SVN Commit by dpage: r4754 - in trunk/pgadmin3: pkg/mac src/base

2005-11-25 Thread svn
Author: dpage
Date: 2005-11-25 08:36:34 + (Fri, 25 Nov 2005)
New Revision: 4754

Modified:
   trunk/pgadmin3/pkg/mac/Makefile.am
   trunk/pgadmin3/pkg/mac/complete-bundle.sh
   trunk/pgadmin3/src/base/appbase.cpp
Log:
Here is a patch to copy pg_dump and pg_restore into
$bundledir/Contents/SharedSupport/helper/. pgAdmin3.app should
find it there, but I didn't test this yet (I just have
access to my build-machine over ssh ATM - I'll need my powerbook
to test this).
[Florian G. Pflug]

Modified: trunk/pgadmin3/pkg/mac/Makefile.am
===
--- trunk/pgadmin3/pkg/mac/Makefile.am  2005-11-24 09:33:31 UTC (rev 4753)
+++ trunk/pgadmin3/pkg/mac/Makefile.am  2005-11-25 08:36:34 UTC (rev 4754)
@@ -24,5 +24,7 @@
$(install_sh_DATA) sql.icns $(bundledir)/Contents/Resources/sql.icns
$$($(WX_CONFIG) --rezflags | sed 's/-t[[:space:]]*APPL//') \
 $(bundledir)/Contents/Resources/pgAdmin3.rsrc -useDF
+   $(install_sh_PROGRAM) $$($(PG_CONFIG) --bindir)/pg_dump 
$(bundledir)/Contents/SharedSupport/helper/pg_dump
+   $(install_sh_PROGRAM) $$($(PG_CONFIG) --bindir)/pg_restore 
$(bundledir)/Contents/SharedSupport/helper/pg_restore
./complete-bundle.sh $(bundledir)
 endif

Modified: trunk/pgadmin3/pkg/mac/complete-bundle.sh
===
--- trunk/pgadmin3/pkg/mac/complete-bundle.sh   2005-11-24 09:33:31 UTC (rev 
4753)
+++ trunk/pgadmin3/pkg/mac/complete-bundle.sh   2005-11-25 08:36:34 UTC (rev 
4754)
@@ -10,8 +10,7 @@
 
 echo Completing bundle: $bundle
 cd $bundle
-fw_basepath=$(dirname $(pwd))
-todo=$(find ./ | \
+todo=$(find ./ -perm +0111 ! -type d | \
 xargs --replace=line file 'line' | \
 sed -n 's/^\([^:][^:]*\):[[:space:]]*Mach-O executable ppc$/\1/p' | \
 xargs echo -n \
@@ -22,6 +21,13 @@
todo_old=$todo ;
todo= ;
for todo_obj in $todo_old; do
+   #Figure out the relative path from todo_obj to 
Contents/Frameworks
+   fw_relpath=$(echo $todo_obj |\
+   sed -n 
's|^\(\.//*\)\(\([^/][^/]*/\)*\)[^/][^/]*$|\2|gp' | \
+   sed -n 's|[^/][^/]*/|../|gp' \
+   )Contents/Frameworks
+
+   #Find all libraries $todo_obj depends on, but skip system 
libraries
for lib in $(
otool -L $todo_obj | \
sed -n 
's|^.*[[:space:]]\([^[:space:]]*\.dylib\).*$|\1|p' | \
@@ -30,22 +36,16 @@
lib_bn=$(basename $lib) ;
if ! test -f Contents/Frameworks/$lib_bn; then
echo Adding library: $lib_bn (because of: 
$todo_obj)
-   case $lib in
-   /*)
-   cp $lib 
Contents/Frameworks/$lib_bn
-   ;;
-   *)
-   cp $fw_basepath/$lib 
Contents/Frameworks/$lib_bn
-   ;;
-   esac
+   cp $lib Contents/Frameworks/$lib_bn
+   chmod 755 Contents/Frameworks/$lib_bn
install_name_tool \
-   -id 
@executable_path/../Frameworks/$lib_bn \
+   -id $lib_bn \
Contents/Frameworks/$lib_bn || exit 1
todo=$todo Contents/Frameworks/$lib_bn
fi
install_name_tool -change \
$lib \
-   @executable_path/../Frameworks/$lib_bn \
+   @executable_path/$fw_relpath/$lib_bn \
$todo_obj || exit 1
done
done

Modified: trunk/pgadmin3/src/base/appbase.cpp
===
--- trunk/pgadmin3/src/base/appbase.cpp 2005-11-24 09:33:31 UTC (rev 4753)
+++ trunk/pgadmin3/src/base/appbase.cpp 2005-11-25 08:36:34 UTC (rev 4754)
@@ -1,223 +1,220 @@
-//
-//
-// pgAdmin III - PostgreSQL Tools
-// RCS-ID:  $Id: misc.cpp 4054 2005-03-28 16:43:01Z andreas $
-// Copyright (C) 2002 - 2005, The pgAdmin Development Team
-// This software is released under the Artistic Licence
-//
-// base.cpp - Miscellaneous Basic Utilities
-//
-//
-
-#include pgAdmin3.h
-
-// wxWindows headers
-#include wx/wx.h
-#include wx/dir.h
-#include wx/file.h
-#include wx/socket.h
-#include wx/xrc/xmlres.h
-#include wx/stdpaths.h
-
-#include copyright.h
-#include base/base.h
-#include base/appbase.h
-#include 

[pgadmin-hackers] SVN Commit by dpage: r4757 - trunk/pgadmin3/src

2005-11-25 Thread svn
Author: dpage
Date: 2005-11-25 08:42:19 + (Fri, 25 Nov 2005)
New Revision: 4757

Modified:
   trunk/pgadmin3/src/Makefile.am
Log:
pg_debug_build seems to have gotten renamed to BUILD_DEBUG. Changed that in 
src/Makefile.am
[Florian G. Pflug]

Modified: trunk/pgadmin3/src/Makefile.am
===
--- trunk/pgadmin3/src/Makefile.am  2005-11-25 08:40:17 UTC (rev 4756)
+++ trunk/pgadmin3/src/Makefile.am  2005-11-25 08:42:19 UTC (rev 4757)
@@ -171,7 +171,7 @@
cd $(bindir) ;\
mv pgadmin3 tmp ;\
mv tmp pgAdmin3 ;\
-   if test $(pg_debug_build) = no; then \
+   if test $(BUILD_DEBUG) = no; then \
strip pgAdmin3 ;\
fi
 


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[pgadmin-hackers] SVN Commit by dpage: r4758 - in trunk/pgadmin3: . xtra xtra/pgagent

2005-11-25 Thread svn
Author: dpage
Date: 2005-11-25 08:44:44 + (Fri, 25 Nov 2005)
New Revision: 4758

Modified:
   trunk/pgadmin3/CHANGELOG.txt
   trunk/pgadmin3/xtra/Makefile.am
   trunk/pgadmin3/xtra/pgagent/Makefile.am
Log:
Don't include pgAgent in the Mac OSX bundle
[Florian G. Pflug]

Modified: trunk/pgadmin3/CHANGELOG.txt
===
--- trunk/pgadmin3/CHANGELOG.txt2005-11-25 08:42:19 UTC (rev 4757)
+++ trunk/pgadmin3/CHANGELOG.txt2005-11-25 08:44:44 UTC (rev 4758)
@@ -18,7 +18,8 @@
 /ul
 br
 ul
-li2005-11-20 FGP 1.4.1  Include pg_dump/pg_restore in the Mac OSX bundle
+li2005-11-25 FGP 1.4.1  Don't include pgAgent in the Mac OSX bundle
+li2005-11-25 FGP 1.4.1  Include pg_dump/pg_restore in the Mac OSX bundle
 li2005-11-20 DP  1.4.1  Use a proper 'Save As' style dialogue for 
selecting backup files
 li2005-11-20 AP  1.4.1  Don't show pk hint when editing view
 li2005-11-20 AP  1.4.1  Add missing NO ACTION FK constraint

Modified: trunk/pgadmin3/xtra/Makefile.am
===
--- trunk/pgadmin3/xtra/Makefile.am 2005-11-25 08:42:19 UTC (rev 4757)
+++ trunk/pgadmin3/xtra/Makefile.am 2005-11-25 08:44:44 UTC (rev 4758)
@@ -7,8 +7,12 @@
 # Makefile - Makefile for *nix systems
 ##
 
+if !APPBUNDLE
+
 SUBDIRS = pgagent
 
+endif
+
 # Note: We cannot add a Makefile to the admin directory as it already
 #   contains one to be used as part of the PostreSQL contrib build
 #  system. Instead, we'll add the files in that directory here.

Modified: trunk/pgadmin3/xtra/pgagent/Makefile.am
===
--- trunk/pgadmin3/xtra/pgagent/Makefile.am 2005-11-25 08:42:19 UTC (rev 
4757)
+++ trunk/pgadmin3/xtra/pgagent/Makefile.am 2005-11-25 08:44:44 UTC (rev 
4758)
@@ -37,24 +37,11 @@
 AM_CPPFLAGS = -DDATA_DIR=\$(pkgdatadir)/\ -Wall -Wno-non-virtual-dtor 
-I$(srcdir)/include
 AM_CFLAGS = -DDATA_DIR=\$(pkgdatadir)/\ -Wall -I$(srcdir)/include
 
-# Automake trys to execute install-exec-hook if it appears anywhere in the 
file, so we need a dummy
-# for non-APPBUNDLE cases.
-install-exec-hook:
+install-data-local:
+   $(install_sh) -c -m 644 pgagent.sql $(DESTDIR)/$(pkgdatadir)/pgagent.sql
 
 else
 
-AM_CXXFLAGS = -Wall -Wno-non-virtual-dtor -I$(srcdir)/include
-AM_CPPFLAGS = -Wall -Wno-non-virtual-dtor -I$(srcdir)/include
-AM_CFLAGS = -Wall -I$(srcdir)/include
-install-exec-hook:
-   cd $(bindir) ;\
-   mv pgagent tmp ;\
-   mv tmp pgagent ;\
-   if test $(pg_debug_build) = no; then \
-   strip pgagent ;\
-   fi
+install-data-local:
 
 endif
-
-install-data-local:
-   $(install_sh) -c -m 644 pgagent.sql $(DESTDIR)/$(pkgdatadir)/pgagent.sql


---(end of broadcast)---
TIP 6: explain analyze is your friend


[pgadmin-hackers] SVN Commit by dpage: r4759 - trunk/pgadmin3/pkg/mac

2005-11-25 Thread svn
Author: dpage
Date: 2005-11-25 08:45:59 + (Fri, 25 Nov 2005)
New Revision: 4759

Modified:
   trunk/pgadmin3/pkg/mac/Info.plist.in
Log:
Use PGADMIN_LONG_VERSION instead of PGADMIN3_SHORT_VERSION at some places in 
Info.plist
[Florian G. Pflug]

Modified: trunk/pgadmin3/pkg/mac/Info.plist.in
===
--- trunk/pgadmin3/pkg/mac/Info.plist.in2005-11-25 08:44:44 UTC (rev 
4758)
+++ trunk/pgadmin3/pkg/mac/Info.plist.in2005-11-25 08:45:59 UTC (rev 
4759)
@@ -26,7 +26,7 @@
keyCFBundleExecutable/key
stringpgAdmin3/string
keyCFBundleGetInfoString/key
-   stringpgAdmin3 PGADMIN_SHORT_VERSION/string
+   stringpgAdmin3 PGADMIN_LONG_VERSION/string
keyCFBundleIconFile/key
stringpgAdmin3.icns/string
keyCFBundleIdentifier/key
@@ -40,7 +40,7 @@
keyCFBundleSignature/key
string/string
keyCFBundleVersion/key
-   stringPGADMIN_SHORT_VERSION/string
+   stringPGADMIN_LONG_VERSION/string
keyCSResourcesFileMapped/key
true/
keyUTExportedTypeDeclarations/key


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [pgadmin-hackers] [PATCH] Add pg_dump/pg_restore to appbundle + some cleanups.

2005-11-25 Thread Dave Page
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Florian G. Pflug
 Sent: 24 November 2005 21:49
 To: pgadmin-hackers
 Subject: [pgadmin-hackers] [PATCH] Add pg_dump/pg_restore to 
 appbundle + some cleanups.
 
 Hi
 
 Here is a patch to copy pg_dump and pg_restore into
 $bundledir/Contents/SharedSupport/helper/. pgAdmin3.app should
 find it there, but I didn't test this yet (I just have
 access to my build-machine over ssh ATM - I'll need my powerbook
 to test this).
 
 The other patches are mostly cleanups
 pgadmin3.addhelper.patch: Mentions above.
 pgadmin3.debug.patch: pg_debug_build seems to have gotten
renamed to BUILD_DEBUG. Changed that in src/Makefile.am
 pgadmin3.nopgagent.patch: Don't install pgadmin into the
bundle - it's useless there, since it needs to be running
on the server, not on the client.
 pgadmin3.versions.patch: Use PGADMIN_LONG_VERSION instead
of PGADMIN3_SHORT_VERSION at some places in Info.plist

Thanks Florian - patches applied (the fixed version of course).

Regards, Dave

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


[pgadmin-hackers] SVN Commit by dpage: r4760 - in trunk/pgadmin3: . src/frm

2005-11-25 Thread svn
Author: dpage
Date: 2005-11-25 11:37:41 + (Fri, 25 Nov 2005)
New Revision: 4760

Modified:
   trunk/pgadmin3/CHANGELOG.txt
   trunk/pgadmin3/src/frm/frmStatus.cpp
Log:
Fix the server status SQL query

Modified: trunk/pgadmin3/CHANGELOG.txt
===
--- trunk/pgadmin3/CHANGELOG.txt2005-11-25 08:45:59 UTC (rev 4759)
+++ trunk/pgadmin3/CHANGELOG.txt2005-11-25 11:37:41 UTC (rev 4760)
@@ -18,6 +18,7 @@
 /ul
 br
 ul
+li2005-11-25 DP  1.4.1  Fix the server status SQL query
 li2005-11-25 FGP 1.4.1  Don't include pgAgent in the Mac OSX bundle
 li2005-11-25 FGP 1.4.1  Include pg_dump/pg_restore in the Mac OSX bundle
 li2005-11-20 DP  1.4.1  Use a proper 'Save As' style dialogue for 
selecting backup files

Modified: trunk/pgadmin3/src/frm/frmStatus.cpp
===
--- trunk/pgadmin3/src/frm/frmStatus.cpp2005-11-25 08:45:59 UTC (rev 
4759)
+++ trunk/pgadmin3/src/frm/frmStatus.cpp2005-11-25 11:37:41 UTC (rev 
4760)
@@ -358,22 +358,26 @@
long row=0;
wxString sql;
if (connection-BackendMinimumVersion(7, 4)) {
-   sql = wxT(SELECT )
- wxT((SELECT datname FROM pg_database WHERE 
oid = database) AS dbname, )
- wxT(relation::regclass AS class, )
- 
wxT(pg_get_userbyid(pg_stat_get_backend_userid(pid)::int4) as user, )
- wxT(transaction, pid, mode, granted, )
- wxT(pg_stat_get_backend_activity(pid) AS 
current_query, )
- wxT(pg_stat_get_backend_activity_start(pid) 
AS query_start )
- wxT(FROM pg_locks ORDER BY pid);
+sql = wxT(SELECT )
+  wxT((SELECT datname FROM pg_database WHERE oid = 
pgl.database) AS dbname, )
+  wxT(pgl.relation::regclass AS class, )
+  wxT(pg_get_userbyid(pg_stat_get_backend_userid(svrid)) as 
user, )
+  wxT(pgl.transaction, pg_stat_get_backend_pid(svrid) AS pid, 
pgl.mode, pgl.granted, )
+  wxT(pg_stat_get_backend_activity(svrid) AS current_query, )
+  wxT(pg_stat_get_backend_activity_start(svrid) AS 
query_start )
+  wxT(FROM pg_stat_get_backend_idset() svrid, pg_locks pgl )
+  wxT(WHERE pgl.pid = pg_stat_get_backend_pid(svrid) )
+  wxT(ORDER BY pid;);
} else {
-   sql = wxT(SELECT )
- wxT((SELECT datname FROM pg_database WHERE 
oid = database) AS dbname, )
- wxT(relation::regclass AS class, )
- 
wxT(pg_get_userbyid(pg_stat_get_backend_userid(pid)::int4) as user, )
- wxT(transaction, pid, mode, granted, )
- wxT(pg_stat_get_backend_activity(pid) AS 
current_query )
- wxT(FROM pg_locks ORDER BY pid);
+sql = wxT(SELECT )
+  wxT((SELECT datname FROM pg_database WHERE oid = 
pgl.database) AS dbname, )
+  wxT(pgl.relation::regclass AS class, )
+  wxT(pg_get_userbyid(pg_stat_get_backend_userid(svrid)) as 
user, )
+  wxT(pgl.transaction, pg_stat_get_backend_pid(svrid) AS pid, 
pgl.mode, pgl.granted, )
+  wxT(pg_stat_get_backend_activity(svrid) AS current_query )
+  wxT(FROM pg_stat_get_backend_idset() svrid, pg_locks pgl )
+  wxT(WHERE pgl.pid = pg_stat_get_backend_pid(svrid) )
+  wxT(ORDER BY pid;);
}
 
pgSet *dataSet2=connection-ExecuteSet(sql);


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


[pgadmin-hackers] SVN Commit by dpage: r4761 - in branches/REL-1_4_0_PATCHES/pgadmin3: . src/frm

2005-11-25 Thread svn
Author: dpage
Date: 2005-11-25 11:40:38 + (Fri, 25 Nov 2005)
New Revision: 4761

Modified:
   branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt
   branches/REL-1_4_0_PATCHES/pgadmin3/src/frm/frmStatus.cpp
Log:
Fix the server status SQL query

Modified: branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt
===
--- branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt   2005-11-25 11:37:41 UTC 
(rev 4760)
+++ branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt   2005-11-25 11:40:38 UTC 
(rev 4761)
@@ -18,6 +18,7 @@
 /ul
 br
 ul
+li2005-11-25 DP  1.4.1  Fix the server status SQL query
 li2005-11-20 FGP 1.4.1  Include pg_dump/pg_restore in the Mac OSX bundle
 li2005-11-20 DP  1.4.1  Use a proper 'Save As' style dialogue for 
selecting backup files
 li2005-11-20 AP  1.4.1  Don't show pk hint when editing view

Modified: branches/REL-1_4_0_PATCHES/pgadmin3/src/frm/frmStatus.cpp
===
--- branches/REL-1_4_0_PATCHES/pgadmin3/src/frm/frmStatus.cpp   2005-11-25 
11:37:41 UTC (rev 4760)
+++ branches/REL-1_4_0_PATCHES/pgadmin3/src/frm/frmStatus.cpp   2005-11-25 
11:40:38 UTC (rev 4761)
@@ -359,21 +359,25 @@
wxString sql;
if (connection-BackendMinimumVersion(7, 4)) {
sql = wxT(SELECT )
- wxT((SELECT datname FROM pg_database WHERE 
oid = database) AS dbname, )
- wxT(relation::regclass AS class, )
- 
wxT(pg_get_userbyid(pg_stat_get_backend_userid(pid)::int4) as user, )
- wxT(transaction, pid, mode, granted, )
- wxT(pg_stat_get_backend_activity(pid) AS 
current_query, )
- wxT(pg_stat_get_backend_activity_start(pid) 
AS query_start )
- wxT(FROM pg_locks ORDER BY pid);
+ wxT((SELECT datname FROM pg_database WHERE oid = 
pgl.database) AS dbname, )
+ wxT(pgl.relation::regclass AS class, )
+ 
wxT(pg_get_userbyid(pg_stat_get_backend_userid(svrid)) as user, )
+ wxT(pgl.transaction, 
pg_stat_get_backend_pid(svrid) AS pid, pgl.mode, pgl.granted, )
+ wxT(pg_stat_get_backend_activity(svrid) AS 
current_query, )
+ wxT(pg_stat_get_backend_activity_start(svrid) AS 
query_start )
+ wxT(FROM pg_stat_get_backend_idset() svrid, 
pg_locks pgl )
+ wxT(WHERE pgl.pid = 
pg_stat_get_backend_pid(svrid) )
+ wxT(ORDER BY pid;);
} else {
sql = wxT(SELECT )
- wxT((SELECT datname FROM pg_database WHERE 
oid = database) AS dbname, )
- wxT(relation::regclass AS class, )
- 
wxT(pg_get_userbyid(pg_stat_get_backend_userid(pid)::int4) as user, )
- wxT(transaction, pid, mode, granted, )
- wxT(pg_stat_get_backend_activity(pid) AS 
current_query )
- wxT(FROM pg_locks ORDER BY pid);
+ wxT((SELECT datname FROM pg_database WHERE oid = 
pgl.database) AS dbname, )
+ wxT(pgl.relation::regclass AS class, )
+ 
wxT(pg_get_userbyid(pg_stat_get_backend_userid(svrid)) as user, )
+ wxT(pgl.transaction, 
pg_stat_get_backend_pid(svrid) AS pid, pgl.mode, pgl.granted, )
+ wxT(pg_stat_get_backend_activity(svrid) AS 
current_query )
+ wxT(FROM pg_stat_get_backend_idset() svrid, 
pg_locks pgl )
+ wxT(WHERE pgl.pid = 
pg_stat_get_backend_pid(svrid) )
+ wxT(ORDER BY pid;);
}
 
pgSet *dataSet2=connection-ExecuteSet(sql);


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[pgadmin-hackers] SVN Commit by dpage: r4762 - branches/REL-1_4_0_PATCHES/pgadmin3

2005-11-25 Thread svn
Author: dpage
Date: 2005-11-25 11:42:00 + (Fri, 25 Nov 2005)
New Revision: 4762

Modified:
   branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt
Log:
Fix date

Modified: branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt
===
--- branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt   2005-11-25 11:40:38 UTC 
(rev 4761)
+++ branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt   2005-11-25 11:42:00 UTC 
(rev 4762)
@@ -19,7 +19,7 @@
 br
 ul
 li2005-11-25 DP  1.4.1  Fix the server status SQL query
-li2005-11-20 FGP 1.4.1  Include pg_dump/pg_restore in the Mac OSX bundle
+li2005-11-25 FGP 1.4.1  Include pg_dump/pg_restore in the Mac OSX bundle
 li2005-11-20 DP  1.4.1  Use a proper 'Save As' style dialogue for 
selecting backup files
 li2005-11-20 AP  1.4.1  Don't show pk hint when editing view
 li2005-11-20 AP  1.4.1  Add missing NO ACTION FK constraint


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


[pgadmin-hackers] wrong order of drop constraint/column statements

2005-11-25 Thread Miha Radej

hi!

with pgadmin built from a fresh svn checkout i have experienced the 
following problem, easily reproducible as follows:


i am working on an existing table with some columns and constraints 
placed on them. in the table properties window, columns tab i removed a 
column and in the constraints tab i removed the constraint placed on 
that column. pgadmin produced an incorrect statement order, which was


drop column...
drop constraint...

which resulted in an error saying that the constraint specified does not 
exist (as it got removed along with the column). the statement order 
should be switched so that the constraint drops are executed before 
column drops.


attached is a patch that works for me (pushes the drop constraint 
statements before any other statements generated so far) but i do not 
know if it will break something else somewhere or if there are such 
things as constraints that depend on other constraints and should 
therefore be removed in the correct order.


cheers,
M
Index: src/dlg/dlgTable.cpp
===
--- src/dlg/dlgTable.cpp(revision 4759)
+++ src/dlg/dlgTable.cpp(working copy)
@@ -513,8 +513,9 @@
 definition = definition.Mid(1).BeforeFirst('');
 else
 definition = definition.BeforeFirst(' ');
-sql += wxT(ALTER TABLE ) + tabname
-+  wxT( DROP CONSTRAINT ) + qtIdent(definition) + wxT(;\n);
+sql =  wxT(ALTER TABLE ) + tabname
++  wxT( DROP CONSTRAINT ) + qtIdent(definition) + wxT(;\n)
++  sql;
 }
 // Add the ADD CONSTRAINTs...
 sql += tmpsql;

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster