Re: [pgadmin-hackers] Weird git messages

2011-08-12 Thread Magnus Hagander
On Thu, Aug 11, 2011 at 22:08, Guillaume Lelarge  wrote:
> Hi,
>
> When pushing my last commit, I got some weird messages:
>
> [master!git.pgadmin3]$ git push
> Counting objects: 37, done.
> Delta compression using up to 4 threads.
> Compressing objects: 100% (19/19), done.
> Writing objects: 100% (19/19), 3.58 KiB, done.
> Total 19 (delta 18), reused 0 (delta 0)
> Auto packing the repository for optimum performance.
> fatal: protocol error: bad line length character: Remo
> error: error in sideband demultiplexer
> To ssh://g...@git.postgresql.org/pgadmin3.git
>   f75720d..43693e1  master -> master
> error: failed to push some refs to
> 'ssh://g...@git.postgresql.org/pgadmin3.git'
>
> If I try another git push, it seems good:
>
> [master!git.pgadmin3]$ git push
> Everything up-to-date
>
> Not sure what happened here. I'm downloading the repo in another
> directory to check if everything is fine. Feels weird though. Have
> anyone seen these messages before?

No.

AFAICT, the problem is that the repacking done on the server for some
reason sends "remo" instead of hex data. remo probably being the
beginning of "remote" or something like that.

I googled around a bit on it, and from what I can tell it's harmless -
the operation went fine, the only problem was telling the client about
it...

-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin III] #332: SQL for TRIGGER with WHEN clause broken

2011-08-12 Thread pgAdmin Trac
#332: SQL for TRIGGER with WHEN clause broken
--+-
 Reporter:  brsa  |   Owner:  dpage
 Type:  bug   |  Status:  new  
 Priority:  minor |   Milestone:   
Component:  pgadmin   | Version:  trunk
 Keywords:  SQL pane  |Platform:  all  
--+-
 Brackets around the WHEN condition are missing or unmatched in the SQL
 pane. (See ticket #98)

 pg feature applies to postgresql 9.0+
 Tested with pgAdmin 1.14.0 Beta 3 on Win XP; pg 9.0.4 on Debian Squeeze.

 Docs:
 http://www.postgresql.org/docs/9.0/interactive/sql-createtrigger.html


 -- Test case --

 CREATE TABLE foo(a serial, b text, c text, d text);

 CREATE OR REPLACE FUNCTION trg_foo_upaft() RETURNS trigger AS
 $BODY$
 BEGIN

 -- do something
 RETURN NEW;

 END;
 $BODY$  LANGUAGE plpgsql VOLATILE;


 -- Test 1.)
 -- I say:
 -- DROP TRIGGER up_aft ON foo;
 CREATE TRIGGER up_aft
   AFTER UPDATE
   ON foo
   FOR EACH ROW
   WHEN ((old.b, old.c, old.d) <> (new.b, new.c, new.d))
   EXECUTE PROCEDURE trg_foo_upaft();

 --> pgAdmin says:
 CREATE TRIGGER up_aft
   AFTER UPDATE
   ON foo
   FOR EACH ROW
   WHEN (old.b <> new.b) OR (old.c <> new.c) OR (old.d <> new.d)
   EXECUTE PROCEDURE trg_foo_upaft();
 --! no enclosing brackets !


 -- Test 2.)
 -- I say:
 -- DROP TRIGGER up_aft ON foo;
 CREATE TRIGGER up_aft
   AFTER UPDATE
   ON foo
   FOR EACH ROW
   WHEN ((old.b <> new.b) OR (old.c <> new.c) OR (old.d <> new.d))
   EXECUTE PROCEDURE trg_foo_upaft();

 --> pgAdmin says:
 CREATE TRIGGER up_aft
   AFTER UPDATE
   ON foo
   FOR EACH ROW
   WHEN (old.b <> new.b) OR (old.c <> new.c)) OR (old.d <> new.d)
   EXECUTE PROCEDURE trg_foo_upaft();
 --! unmatched bracket and missing enclosing brackets !

-- 
Ticket URL: 
pgAdmin III 
pgAdmin III

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin III] #332: SQL for TRIGGER with WHEN clause broken

2011-08-12 Thread pgAdmin Trac
#332: SQL for TRIGGER with WHEN clause broken
--+-
 Reporter:  brsa  |   Owner:  dpage
 Type:  patch |  Status:  new  
 Priority:  minor |   Milestone:   
Component:  pgadmin   | Version:  trunk
 Keywords:  SQL pane  |Platform:  all  
--+-
Changes (by brsa):

  * type:  bug => patch


Comment:

 The fix is pretty obvious in this case. The code mistakenly trims all
 outer enclosing brackets, which leads to unmatched brackets in test 2.) -
 both left brackets were removed.

 pgTrigger.cpp, line 393:

 - wxT("  trim(substring(pg_get_triggerdef(t.oid), 'WHEN (.*) EXECUTE
 PROCEDURE'), '()') AS whenclause\n")
 + wxT("  substring(pg_get_triggerdef(t.oid), 'WHEN (.*) EXECUTE
 PROCEDURE') AS whenclause\n")

-- 
Ticket URL: 
pgAdmin III 
pgAdmin III

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Weird git messages

2011-08-12 Thread Guillaume Lelarge
On Fri, 2011-08-12 at 13:51 +0200, Magnus Hagander wrote:
> On Thu, Aug 11, 2011 at 22:08, Guillaume Lelarge  
> wrote:
> > Hi,
> >
> > When pushing my last commit, I got some weird messages:
> >
> > [master!git.pgadmin3]$ git push
> > Counting objects: 37, done.
> > Delta compression using up to 4 threads.
> > Compressing objects: 100% (19/19), done.
> > Writing objects: 100% (19/19), 3.58 KiB, done.
> > Total 19 (delta 18), reused 0 (delta 0)
> > Auto packing the repository for optimum performance.
> > fatal: protocol error: bad line length character: Remo
> > error: error in sideband demultiplexer
> > To ssh://g...@git.postgresql.org/pgadmin3.git
> >   f75720d..43693e1  master -> master
> > error: failed to push some refs to
> > 'ssh://g...@git.postgresql.org/pgadmin3.git'
> >
> > If I try another git push, it seems good:
> >
> > [master!git.pgadmin3]$ git push
> > Everything up-to-date
> >
> > Not sure what happened here. I'm downloading the repo in another
> > directory to check if everything is fine. Feels weird though. Have
> > anyone seen these messages before?
> 
> No.
> 
> AFAICT, the problem is that the repacking done on the server for some
> reason sends "remo" instead of hex data. remo probably being the
> beginning of "remote" or something like that.
> 
> I googled around a bit on it, and from what I can tell it's harmless -
> the operation went fine, the only problem was telling the client about
> it...
> 

Googled too yesterday, and saw some mails about it. But I wasn't able to
tell if it was harmless or not. Hope you're right :)


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin III commit: Renamed wxhotdraw library to hotdraw

2011-08-12 Thread Guillaume Lelarge
Renamed wxhotdraw library to hotdraw

Changed prefix wxhd to hd, moved files from /dd/wxhotdraw to /hotdraw, fixed
related classes references.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin3.git;a=commitdiff;h=a08974662b092d96270ce8936de900aec29e6e54
Author: Luis Ochoa 

Modified Files
--
pgadmin/Makefile.am|1 +
pgadmin/dd/dditems/figures/ddColumnFigure.cpp  |   30 +-
pgadmin/dd/dditems/figures/ddColumnKindIcon.cpp|   16 +-
pgadmin/dd/dditems/figures/ddColumnOptionIcon.cpp  |   10 +-
.../dd/dditems/figures/ddRelationshipFigure.cpp|   44 +-
pgadmin/dd/dditems/figures/ddRelationshipItem.cpp  |2 +-
.../dd/dditems/figures/ddRelationshipTerminal.cpp  |   24 +-
pgadmin/dd/dditems/figures/ddTableFigure.cpp   |  100 +-
.../dd/dditems/figures/ddTextTableItemFigure.cpp   |   26 +-
pgadmin/dd/dditems/figures/xml/ddXmlStorage.cpp|   20 +-
.../dd/dditems/handles/ddAddColButtonHandle.cpp|   12 +-
pgadmin/dd/dditems/handles/ddAddFkButtonHandle.cpp |   18 +-
.../dditems/handles/ddMinMaxTableButtonHandle.cpp  |   12 +-
.../dditems/handles/ddRemoveTableButtonHandle.cpp  |   16 +-
pgadmin/dd/dditems/handles/ddScrollBarHandle.cpp   |   28 +-
.../dd/dditems/handles/ddSouthTableSizeHandle.cpp  |   26 +-
pgadmin/dd/dditems/locators/ddAddColLocator.cpp|2 +-
pgadmin/dd/dditems/locators/ddAddFkLocator.cpp |2 +-
.../dd/dditems/locators/ddMinMaxTableLocator.cpp   |2 +-
.../dd/dditems/locators/ddRemoveTableLocator.cpp   |2 +-
.../dditems/locators/ddScrollBarTableLocator.cpp   |2 +-
.../dd/dditems/locators/ddTableBottomLocator.cpp   |2 +-
pgadmin/dd/dditems/tools/ddColumnFigureTool.cpp|   42 +-
pgadmin/dd/dditems/tools/ddColumnTextTool.cpp  |   14 +-
.../dd/dditems/utilities/ddSelectKindFksDialog.cpp |4 +-
pgadmin/dd/ddmodel/ddBrowserDataContainer.cpp  |6 +-
pgadmin/dd/ddmodel/ddDatabaseDesign.cpp|   72 +-
pgadmin/dd/ddmodel/ddDrawingEditor.cpp |   52 +-
pgadmin/dd/ddmodel/ddDrawingView.cpp   |8 +-
pgadmin/dd/ddmodel/ddModelBrowser.cpp  |6 +-
pgadmin/dd/module.mk   |1 -
pgadmin/dd/wxhotdraw/connectors/module.mk  |   19 -
.../wxhotdraw/connectors/wxhdChopBoxConnector.cpp  |   82 -
pgadmin/dd/wxhotdraw/connectors/wxhdIConnector.cpp |   66 -
.../wxhotdraw/connectors/wxhdLocatorConnector.cpp  |   60 -
.../connectors/wxhdStickyRectangleConnector.cpp|   73 -
.../wxhotdraw/figures/defaultAttributes/module.mk  |   19 -
.../defaultAttributes/wxhdFillAttribute.cpp|   45 -
.../defaultAttributes/wxhdFontAttribute.cpp|   45 -
.../defaultAttributes/wxhdFontColorAttribute.cpp   |   38 -
.../defaultAttributes/wxhdLineAttribute.cpp|   43 -
pgadmin/dd/wxhotdraw/figures/module.mk |   31 -
.../dd/wxhotdraw/figures/wxhdAbstractFigure.cpp|  130 --
.../wxhotdraw/figures/wxhdAbstractMenuFigure.cpp   |   59 -
pgadmin/dd/wxhotdraw/figures/wxhdAttribute.cpp |   34 -
.../dd/wxhotdraw/figures/wxhdAttributeFigure.cpp   |   95 --
pgadmin/dd/wxhotdraw/figures/wxhdBitmapFigure.cpp  |   62 -
.../dd/wxhotdraw/figures/wxhdCompositeFigure.cpp   |  271 
.../dd/wxhotdraw/figures/wxhdIConnectionFigure.cpp |   23 -
pgadmin/dd/wxhotdraw/figures/wxhdIFigure.cpp   |  175 ---
.../dd/wxhotdraw/figures/wxhdLineConnection.cpp|  293 
pgadmin/dd/wxhotdraw/figures/wxhdLineTerminal.cpp  |   59 -
.../dd/wxhotdraw/figures/wxhdPolyLineFigure.cpp|  446 --
.../dd/wxhotdraw/figures/wxhdRectangleFigure.cpp   |   52 -
.../dd/wxhotdraw/figures/wxhdSimpleTextFigure.cpp  |  139 --
pgadmin/dd/wxhotdraw/figures/xml/module.mk |   16 -
pgadmin/dd/wxhotdraw/figures/xml/wxhdStorage.cpp   |   34 -
pgadmin/dd/wxhotdraw/handles/module.mk |   23 -
pgadmin/dd/wxhotdraw/handles/wxhdButtonHandle.cpp  |   72 -
.../handles/wxhdChangeConnectionEndHandle.cpp  |   65 -
.../handles/wxhdChangeConnectionHandle.cpp |  116 --
.../handles/wxhdChangeConnectionStartHandle.cpp|   65 -
pgadmin/dd/wxhotdraw/handles/wxhdIHandle.cpp   |   47 -
.../wxhotdraw/handles/wxhdLineConnectionHandle.cpp |   46 -
pgadmin/dd/wxhotdraw/handles/wxhdLocatorHandle.cpp |   53 -
.../dd/wxhotdraw/handles/wxhdPolyLineHandle.cpp|   90 --
pgadmin/dd/wxhotdraw/locators/module.mk|   17 -
pgadmin/dd/wxhotdraw/locators/wxhdILocator.cpp |   27 -
.../dd/wxhotdraw/locators/wxhdPolyLineLocator.cpp  |   59 -
pgadmin/dd/wxhotdraw/main/module.mk|   18 -
pgadmin/dd/wxhotdraw/main/wxhdDrawing.cpp  |  245 ---
pgadmin/dd/wxhotdraw/main/wxhdDrawingEditor.cpp|  301 
pgadmin/dd/wxhotdraw/main/wxhdDrawingView.cpp  |  467 --
pgadmin/dd/wxhotdraw/module.mk |   21 -
pgadmin/dd/wxhotdraw/tools/module.mk   |   30 -
pgadmin/dd/wxhotdraw/tools/wxhdAbstractTool.cpp|   67 -
pgadmin/dd/wxhotdraw/tools/wxhdCanvasMenuTool

[pgadmin-hackers] pgAdmin III commit: Fixed a remove/delete dialog, not allowing to remov

2011-08-12 Thread Guillaume Lelarge
Fixed a remove/delete dialog, not allowing to remove relationships from a 
diagram, only removing it from a model which is the correct behavior.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin3.git;a=commitdiff;h=79ac06efd1fdb8425a9880ce406744eb9c7f1a60
Author: Luis Ochoa 

Modified Files
--
.../dd/dditems/figures/ddRelationshipFigure.cpp|3 ++-
pgadmin/dd/ddmodel/ddDrawingEditor.cpp |5 +++--
.../wxhotdraw/utilities/wxhdRemoveDeleteDialog.cpp |7 ++-
.../wxhotdraw/utilities/wxhdRemoveDeleteDialog.h   |4 +++-
4 files changed, 14 insertions(+), 5 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Refresh objects on Click

2011-08-12 Thread Vinicius Santos

Em 11/08/2011 07:25, Dave Page escreveu:

- On frmOptions, the combo box to select the refresh mode should be to
the right of the label, not underneath. The sizing should following
the layout of other tabs.

Done.

- In "Refresh object on click" mode, if I click a table, and then
click the parent database, all nodes below the "Schemas" node are
collapsed.

Done.


- Please use an actual declared enum for the setting, so we can avoid
using "magic" numbers in execSelChange() - eg. if
(settingRefreshOnClick == REFRESH_OBJECT_ONLY)

Done.

Unfortunately, I have no time to make tests more heavy.
If you find errors or have more suggestions, please let me know.

Thank You.



--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Refresh objects on Click

2011-08-12 Thread Vinicius Santos


>From 63c2b20eff916b89fee7135d754094a35f01770c Mon Sep 17 00:00:00 2001
From: Vinicius Santos 
Date: Sat, 13 Aug 2011 01:03:11 -0300
Subject: [PATCH] Implement Refresh Object on Click.

---
 pgadmin/frm/events.cpp  |   49 +++
 pgadmin/frm/frmOptions.cpp  |3 ++
 pgadmin/include/frm/frmMain.h   |5 +++
 pgadmin/include/utils/sysSettings.h |   10 +++
 pgadmin/ui/frmOptions.xrc   |   32 ++-
 5 files changed, 98 insertions(+), 1 deletions(-)

diff --git a/pgadmin/frm/events.cpp b/pgadmin/frm/events.cpp
index f725d39..9e52671 100644
--- a/pgadmin/frm/events.cpp
+++ b/pgadmin/frm/events.cpp
@@ -38,6 +38,8 @@
 #include "schema/pgTable.h"
 #include "dlg/dlgProperty.h"
 
+
+
 // Event table
 BEGIN_EVENT_TABLE(frmMain, pgFrame)
EVT_CHILD_FOCUS(frmMain::OnChildFocus)
@@ -388,6 +390,7 @@ void frmMain::ResetLists()
 
 void frmMain::execSelChange(wxTreeItemId item, bool currentNode)
 {
+   static bool refresh = true;
if (currentNode)
{
ResetLists();
@@ -406,6 +409,52 @@ void frmMain::execSelChange(wxTreeItemId item, bool 
currentNode)
}
else
{
+   int settingRefreshOnClick = settings->GetRefreshOnClick();
+
+   if ( settingRefreshOnClick != REFRESH_OBJECT_NONE
+   && refresh
+   && currentObject->GetTypeName() != wxT("Server")
+   && currentObject->GetTypeName() != wxT("Servers"))
+   {
+   refresh = false;
+   
+   if (settingRefreshOnClick == REFRESH_OBJECT_ONLY )
+   {
+   //We can not update the schema/database, 
because it would cause an update to the entire tree.
+   if (currentObject->GetTypeName() != 
wxT("Schema")
+   && currentObject->GetTypeName() != 
wxT("Database")
+   && !currentObject->IsCollection())
+   {
+   wxTreeItemId currentItem = 
currentObject->GetId();
+   
+
+   pgObject *newData = 
currentObject->Refresh(browser, currentItem);
+
+   if (newData != 0)
+   {
+   wxLogInfo(wxT("Replacing with 
new node %s %s for refresh"), newData->GetTypeName().c_str(), 
newData->GetQuotedFullIdentifier().c_str());
+
+   
browser->DeleteChildren(currentItem);
+   newData->SetId(currentItem);
// not done automatically
+   
browser->SetItemData(currentItem, newData);
+
+   // Update the node text if this 
is an object, as it may have been renamed
+   if (!newData->IsCollection())
+   
browser->SetItemText(currentItem, newData->GetDisplayName());
+
+   delete currentObject;
+   currentObject = newData;
+   }
+   else
+   browser->Delete(currentItem);
+   }
+   }
+   else
+   Refresh(currentObject);
+
+   refresh = true;
+   }
+
if (currentNode)
{
properties->Freeze();
diff --git a/pgadmin/frm/frmOptions.cpp b/pgadmin/frm/frmOptions.cpp
index 92f9b75..4ef39c3 100644
--- a/pgadmin/frm/frmOptions.cpp
+++ b/pgadmin/frm/frmOptions.cpp
@@ -101,6 +101,7 @@
 #define pickerSQLColour11   CTRL_COLOURPICKER("pickerSQLColour11")
 #define pickerSQLCaretColour   
CTRL_COLOURPICKER("pickerSQLCaretColour")
 #define chkKeywordsInUppercase  CTRL_CHECKBOX("chkKeywordsInUppercase")
+#define cbRefreshOnClick   
CTRL_COMBOBOX("cbRefreshOnClick")
 
 BEGIN_EVENT_TABLE(frmOptions, pgDialog)
EVT_MENU(MNU_HELP,
frmOptions::OnHelp)
@@ -243,6 +244,7 @@ frmOptions::frmOptions(frmMain *parent)
chkSpacesForTabs->SetValue(settings->GetSpacesForTabs());
cbCopyQuote->SetSelection(settings->GetCopyQuoting());
cbCopyQuoteChar->SetValue(settings->GetCopyQuoteChar());
+   cbRefreshOnClick->SetSelection(settings->GetRefreshOnClick());
 
wxString copySeparator = settings->GetCopyColSeparator();
if (copySeparator == wxT("\t"))
@@ -553,6 +5