On 16 June 2011 15:41, Dave Page <dp...@pgadmin.org> wrote: > On Thu, Jun 16, 2011 at 2:45 PM, Thom Brown <t...@linux.com> wrote: >> Hi, >> >> I'm using PgAdmin III 1.14.0 beta 1 and noticed that if I go into the >> properties dialog box for a table, the Fill Factor field cannot be >> modified. I've manually altered a table so that the fill factor is >> set to a valid value, re-checked the properties box and can see my new >> value in the Fill Factor field. However, it still cannot be modified. > > This appears to be a missing feature. We need to add code to support > adjustment of the fill factor on existing tables. > >> Also, the properties dialog box for a primary key also has a Fill >> Factor field, and values can be entered into it, but the OK button >> stays greyed out and the SQL tab shows nothing to be changed. > > That has the same issue, plus a bug which leaves the field enabled. > I'll push a fix for the bug - a patch would be cool for the new > feature though :-p
Very well then. Dodgy patch attached. -- Thom Brown Twitter: @darkixion IRC (freenode): dark_ixion Registered Linux user: #516935 EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
diff --git a/pgadmin/dlg/dlgTable.cpp b/pgadmin/dlg/dlgTable.cpp index 72c2cae..cfd9030 100644 --- a/pgadmin/dlg/dlgTable.cpp +++ b/pgadmin/dlg/dlgTable.cpp @@ -105,6 +105,7 @@ BEGIN_EVENT_TABLE(dlgTable, dlgSecurityProperty) EVT_CHECKBOX(XRCID("chkUnlogged"), dlgProperty::OnChange) EVT_TEXT(XRCID("cbTablespace"), dlgProperty::OnChange) EVT_COMBOBOX(XRCID("cbTablespace"), dlgProperty::OnChange) + EVT_TEXT(XRCID("txtFillFactor"), dlgProperty::OnChange) EVT_COMBOBOX(XRCID("cbOfType"), dlgTable::OnChangeOfType) EVT_CHECKBOX(XRCID("chkHasOids"), dlgProperty::OnChange) EVT_TEXT(XRCID("cbTables"), dlgTable::OnChangeTable) @@ -745,13 +746,10 @@ int dlgTable::Go(bool modal) if (table) { txtFillFactor->SetValue(table->GetFillFactor()); - txtFillFactor->Disable(); } - else - { - txtFillFactor->Enable(); txtFillFactor->SetValidator(numericValidator); - } + + txtFillFactor->Enable(); } else { @@ -933,6 +931,13 @@ wxString dlgTable::GetSql() + wxT(" SET TABLESPACE ") + qtIdent(cbTablespace->GetValue()) + wxT(";\n"); + if (txtFillFactor->GetValue().Trim().Length() > 0) + { + sql += wxT("ALTER TABLE ") + tabname + + wxT("\n SET (FILLFACTOR=") + + txtFillFactor->GetValue() + wxT(");\n"); + } + if (connection->BackendMinimumVersion(8, 1)) { if (!chkCustomVac->GetValue())
-- Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-support