On Mon, 2013-09-09 at 09:00 +0100, Dave Page wrote:
> On Sat, Sep 7, 2013 at 7:06 PM, Paragon Corporation <[email protected]> wrote:
> > Now that PostgreSQL 9.3 has the parallel backup feature in pg_dump, would it
> > be possible to have that option on the pgAdmin Backup menu panel?
> >
> > I didn't see it on 1.18.0 RC1 when connected to PostgreSQL 9.3 db.
>
> Patches welcome :-)
>
See attached.
Will apply it on master this week if noone objects.
--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
diff --git a/pgadmin/frm/frmBackup.cpp b/pgadmin/frm/frmBackup.cpp
index 9cd4d85..f912906 100644
--- a/pgadmin/frm/frmBackup.cpp
+++ b/pgadmin/frm/frmBackup.cpp
@@ -33,6 +33,7 @@
#define txtCompressRatio CTRL_TEXT("txtCompressRatio")
#define cbEncoding CTRL_COMBOBOX("cbEncoding")
#define cbFormat CTRL_COMBOBOX("cbFormat")
+#define txtNumberOfJobs CTRL_TEXT("txtNumberOfJobs")
#define cbRolename CTRL_COMBOBOX("cbRolename")
#define chkBlobs CTRL_CHECKBOX("chkBlobs")
#define chkOid CTRL_CHECKBOX("chkOid")
@@ -227,6 +228,10 @@ frmBackup::frmBackup(frmMain *form, pgObject *obj) : ExternProcessDialog(form)
delete objects;
}
+ if (!pgAppMinimumVersion(backupExecutable, 9, 3))
+ {
+ txtNumberOfJobs->Disable();
+ }
if (!pgAppMinimumVersion(backupExecutable, 9, 2))
{
chkSectionPreData->Disable();
@@ -360,6 +365,10 @@ void frmBackup::OnChangePlain(wxCommandEvent &ev)
btnFilename->Enable(!isDirectory);
+ txtNumberOfJobs->Enable(isDirectory && pgAppMinimumVersion(backupExecutable, 9, 3));
+ if (!txtNumberOfJobs->IsEnabled())
+ txtNumberOfJobs->SetValue(wxEmptyString);
+
wxCommandEvent nullEvent;
OnChange(nullEvent);
}
@@ -494,6 +503,9 @@ wxString frmBackup::getCmdPart2()
cmd.Append(wxT(" --file \"") + txtFilename->GetValue() + wxT("\""));
+ if (!txtNumberOfJobs->GetValue().IsEmpty())
+ cmd.Append(wxT(" --jobs ") + txtNumberOfJobs->GetValue());
+
// Process selected items
wxTreeItemId root, schema, table;
wxTreeItemIdValue schemaData, tableData;
diff --git a/pgadmin/ui/frmBackup.xrc b/pgadmin/ui/frmBackup.xrc
index 7fa4095..62262be 100644
--- a/pgadmin/ui/frmBackup.xrc
+++ b/pgadmin/ui/frmBackup.xrc
@@ -95,6 +95,18 @@
<border>4</border>
</object>
<object class="sizeritem">
+ <object class="wxStaticText" name="stNumberOfJobs">
+ <label>Number Of Jobs</label>
+ </object>
+ <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+ <border>4</border>
+ </object>
+ <object class="sizeritem">
+ <object class="wxTextCtrl" name="txtNumberOfJobs"/>
+ <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+ <border>4</border>
+ </object>
+ <object class="sizeritem">
<object class="wxStaticText" name="stRolename">
<label>Rolename</label>
</object>
--
Sent via pgadmin-support mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support