diff --git a/pgadmin/dlg/dlgTable.cpp b/pgadmin/dlg/dlgTable.cpp
index e1207b8..14d64bb 100644
--- a/pgadmin/dlg/dlgTable.cpp
+++ b/pgadmin/dlg/dlgTable.cpp
@@ -29,6 +29,7 @@
 #include "schema/pgTable.h"
 #include "schema/pgColumn.h"
 #include "schema/pgCheck.h"
+#include "schema/pgExclude.h"
 #include "schema/pgForeignKey.h"
 #include "schema/pgIndexConstraint.h"
 #include "schema/pgDatatype.h"
@@ -352,6 +353,15 @@ int dlgTable::Go(bool modal)
                             + wxT(" ") + obj->GetTypeName().Upper() + wxT(" ") + obj->GetDefinition());
                         break;
                     }
+                    case PGM_EXCLUDE:
+                    {
+                        pgExclude *obj=(pgExclude*)data;
+
+                       lstConstraints->AppendItem(data->GetIconId(), obj->GetName(), obj->GetDefinition());
+                        previousConstraints.Add(obj->GetQuotedIdentifier() 
+                            + wxT(" ") + obj->GetTypeName().Upper() + wxT(" ") + obj->GetDefinition());
+                        break;
+                    }
                 }
                 
                 item=mainForm->GetBrowser()->GetNextChild(constraintsItem, cookie);
diff --git a/pgadmin/dlg/module.mk b/pgadmin/dlg/module.mk
index 4fa568d..24f8524 100644
--- a/pgadmin/dlg/module.mk
+++ b/pgadmin/dlg/module.mk
@@ -21,6 +21,7 @@ pgadmin3_SOURCES += \
 	$(srcdir)/dlg/dlgDatabase.cpp \
 	$(srcdir)/dlg/dlgDomain.cpp \
 	$(srcdir)/dlg/dlgEditGridOptions.cpp \
+	$(srcdir)/dlg/dlgExclude.cpp \
 	$(srcdir)/dlg/dlgFindReplace.cpp \
 	$(srcdir)/dlg/dlgForeignKey.cpp \
 	$(srcdir)/dlg/dlgFunction.cpp \
diff --git a/pgadmin/include/dlg/dlgExclude.h b/pgadmin/include/dlg/dlgExclude.h
new file mode 100644
index 0000000..2b15793
--- /dev/null
+++ b/pgadmin/include/dlg/dlgExclude.h
@@ -0,0 +1,60 @@
+//////////////////////////////////////////////////////////////////////////
+//
+// pgAdmin III - PostgreSQL Tools
+// RCS-ID:      $Id$
+// Copyright (C) 2002 - 2010, The pgAdmin Development Team
+// This software is released under the PostgreSQL Licence
+//
+// dlgExclude.h - Exclude Constraint property 
+//
+//////////////////////////////////////////////////////////////////////////
+
+
+#ifndef __DLG_EXCLUDEPROP
+#define __DLG_EXCLUDEPROP
+
+#include "dlg/dlgProperty.h"
+
+
+class pgExclude;
+
+#define btnAddCol       CTRL_BUTTON("btnAddCol")
+#define btnRemoveCol    CTRL_BUTTON("btnRemoveCol")
+
+class dlgExclude : public dlgCollistProperty
+{
+public:
+    dlgExclude(pgaFactory *factory, frmMain *frame, const wxString &resName, pgExcludeBase *index, pgTable *parentNode);
+    dlgExclude(pgaFactory *factory, frmMain *frame, const wxString &resName, ctlListView *colList);
+
+    void OnSelectComboCol(wxCommandEvent &ev);
+    void OnSelectListCol(wxListEvent &ev);
+    void OnSelectCol();
+    void CheckChange();
+    pgObject *GetObject();
+    int Go(bool modal);
+
+    wxString GetColumns();
+    wxString GetSql();
+    pgObject *CreateObject(pgCollection *collection);
+
+private:
+#ifdef __WXMAC__
+    void OnChangeSize(wxSizeEvent &ev);
+#endif
+
+    void OnSelectType(wxCommandEvent &ev);
+    void OnDescChange(wxCommandEvent &ev);
+    void OnAddCol(wxCommandEvent &ev);
+    void OnRemoveCol(wxCommandEvent &ev);
+
+    wxString m_previousType;
+
+protected:
+    pgExclude *index;
+
+private:
+    DECLARE_EVENT_TABLE()
+};
+
+#endif
diff --git a/pgadmin/include/dlg/module.mk b/pgadmin/include/dlg/module.mk
index 14afb22..db6cff2 100644
--- a/pgadmin/include/dlg/module.mk
+++ b/pgadmin/include/dlg/module.mk
@@ -21,6 +21,7 @@ pgadmin3_SOURCES += \
 	$(srcdir)/include/dlg/dlgDatabase.h \
 	$(srcdir)/include/dlg/dlgDomain.h \
 	$(srcdir)/include/dlg/dlgEditGridOptions.h \
+	$(srcdir)/include/dlg/dlgExclude.h \
 	$(srcdir)/include/dlg/dlgFindReplace.h \
 	$(srcdir)/include/dlg/dlgForeignKey.h \
 	$(srcdir)/include/dlg/dlgFunction.h \
diff --git a/pgadmin/include/precomp.h b/pgadmin/include/precomp.h
index 0277ae4..9a66e5b 100644
--- a/pgadmin/include/precomp.h
+++ b/pgadmin/include/precomp.h
@@ -168,6 +168,7 @@
 #include "schema/pgDatabase.h"
 #include "schema/pgDatatype.h"
 #include "schema/pgDomain.h"
+#include "schema/pgExclude.h"
 #include "schema/pgForeignKey.h"
 #include "schema/pgFunction.h"
 #include "schema/pgGroup.h"
diff --git a/pgadmin/include/schema/module.mk b/pgadmin/include/schema/module.mk
index 2b9a38d..8357742 100644
--- a/pgadmin/include/schema/module.mk
+++ b/pgadmin/include/schema/module.mk
@@ -25,6 +25,7 @@ pgadmin3_SOURCES += \
 	$(srcdir)/include/schema/pgDatabase.h \
 	$(srcdir)/include/schema/pgDatatype.h \
 	$(srcdir)/include/schema/pgDomain.h \
+	$(srcdir)/include/schema/pgExclude.h \
 	$(srcdir)/include/schema/pgForeignKey.h \
 	$(srcdir)/include/schema/pgFunction.h \
 	$(srcdir)/include/schema/pgGroup.h \
diff --git a/pgadmin/include/schema/pgExclude.h b/pgadmin/include/schema/pgExclude.h
new file mode 100644
index 0000000..3425344
--- /dev/null
+++ b/pgadmin/include/schema/pgExclude.h
@@ -0,0 +1,132 @@
+//////////////////////////////////////////////////////////////////////////
+//
+// pgAdmin III - PostgreSQL Tools
+// RCS-ID:      $Id$
+// Copyright (C) 2002 - 2010, The pgAdmin Development Team
+// This software is released under the PostgreSQL Licence
+//
+// pgExclude.h PostgreSQL Exclude
+//
+//////////////////////////////////////////////////////////////////////////
+
+#ifndef PGEXCLUDE_H
+#define PGEXCLUDE_H
+
+#include "pgTable.h"
+#include <wx/arrstr.h>
+
+
+
+
+class pgExclude : public pgTableObject
+{
+protected:
+    pgExclude(pgTable *newTable, pgaFactory &factory, const wxString& newName = wxT(""));
+
+public:
+    void ShowTreeDetail(ctlTree *browser, frmMain *form=0, ctlListView *properties=0, ctlSQLBox *sqlPane=0);
+    void ShowStatistics(frmMain *form, ctlListView *statistics);
+    bool CanDropCascaded() { return GetSchema()->GetMetaType() != PGM_CATALOG; }
+
+    wxString GetProcArgs() const { return procArgs; }
+    wxString GetQuotedTypedColumns() const { return quotedTypedColumns; }
+    wxString GetTypedColumns() const { return typedColumns; }
+    wxString GetOperatorClasses() const { return operatorClasses; }
+    wxString GetQuotedColumns() const { return quotedColumns; }
+    wxString GetColumns() const { return columns; }
+	wxArrayString GetColumnList() const { return columnList; }
+
+    wxString GetColumnNumbers() const { return columnNumbers; }
+    void iSetColumnNumbers(const wxString& s) { columnNumbers=s; }
+    wxString GetConstraint() const { return constraint; }
+    void iSetConstraint(const wxString& s) { constraint=s; }
+    wxString GetExcludeType() const { return indexType; }
+    void iSetExcludeType(const wxString& s) { indexType=s; }
+    long GetColumnCount() const { return columnCount; }
+    void iSetColumnCount(const long l) { columnCount=l; }
+    wxString GetIdxTable() const { return idxTable; }
+    void iSetIdxTable(const wxString& s) { idxTable=s; }
+    wxString GetIdxSchema() const { return idxSchema; }
+    void iSetIdxSchema(const wxString& s) { idxSchema=s; }
+    OID GetRelTableOid() const { return relTableOid; }
+    void iSetRelTableOid(const OID d) { relTableOid=d; }
+    wxString GetTablespace() const { return tablespace; };
+    void iSetTablespace(const wxString& newVal) { tablespace = newVal; }
+    OID GetTablespaceOid() const { return tablespaceOid; };
+    void iSetTablespaceOid(const OID newVal) { tablespaceOid = newVal; }
+    wxString GetFillFactor() { return fillFactor; }
+    void iSetFillFactor(const wxString& s) { fillFactor = s; }
+
+    wxString GetProcName() const { return procName; }
+    void iSetProcName(const wxString& s) { procName=s; }
+    wxString GetProcNamespace() const { return procNamespace; }
+    void iSetProcNamespace(const wxString& s) { procNamespace=s; }
+
+    bool GetDeferrable() const { return deferrable; }
+    void iSetDeferrable(const bool b) { deferrable=b; }
+    bool GetDeferred() const { return deferred; }
+    void iSetDeferred(const bool b) { deferred=b; }
+
+    void iSetOperatorClassList(const wxString& s) { operatorClassList=s; }
+    void iSetProcArgTypeList(const wxString& s) { procArgTypeList=s; }
+
+    bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded);
+    wxString GetCreate();
+    bool CanRestore() { return true; }
+    wxString GetSql(ctlTree *browser);
+    pgObject *Refresh(ctlTree *browser, const wxTreeItemId item);
+    bool CanMaintenance() { return true; }
+    bool GetShowExtendedStatistics() { return showExtendedStatistics; }
+    void iSetShowExtendedStatistics(bool b) { showExtendedStatistics = b; }
+
+    bool HasStats() { return true; }
+    bool HasDepends() { return true; }
+    bool HasReferences() { return true; }
+    bool HasPgstatindex();
+
+protected:
+    void ReadColumnDetails();
+
+private:
+    wxString columnNumbers, columns, quotedColumns, indexType, idxTable, idxSchema, constraint, tablespace;
+    wxString procName, procNamespace, procArgs, procArgTypeList, typedColumns, quotedTypedColumns, operatorClasses, operatorClassList;
+    long columnCount;
+	wxArrayString columnList;
+    bool isUnique, isPrimary, isClustered;
+    bool deferrable, deferred, showExtendedStatistics;
+    OID relTableOid, tablespaceOid;
+    wxString fillFactor;
+};
+
+
+class pgExcludeFactory : public pgTableObjFactory
+{
+public:
+    pgExcludeFactory();
+    virtual dlgProperty *CreateDialog(frmMain *frame, pgObject *node, pgObject *parent);
+    virtual pgObject *CreateObjects(pgCollection *obj, ctlTree *browser, const wxString &restr=wxEmptyString);
+    virtual pgCollection *CreateCollection(pgObject *obj);
+protected:
+    pgExcludeFactory(const wxChar *tn, const wxChar *ns, const wxChar *nls, const char **img) : pgTableObjFactory(tn, ns, nls, img) {}
+};
+extern pgExcludeFactory excludeFactory;
+
+class pgExcludeCollection : public pgTableObjCollection
+{
+public:
+    pgExcludeCollection(pgaFactory *factory, pgTable *tbl);
+    void ShowStatistics(frmMain *form, ctlListView *statistics);
+};
+
+
+class executePgstatindexFactory : public contextActionFactory
+{
+public:
+    executePgstatindexFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar);
+    wxWindow *StartDialog(frmMain *form, pgObject *obj);
+    bool CheckEnable(pgObject *obj);
+	bool CheckChecked(pgObject *obj);
+};
+
+
+#endif
diff --git a/pgadmin/include/utils/misc.h b/pgadmin/include/utils/misc.h
index d36cdee..d951f0e 100644
--- a/pgadmin/include/utils/misc.h
+++ b/pgadmin/include/utils/misc.h
@@ -204,6 +204,7 @@ enum
     PGM_COLUMN,    
     PGM_CONSTRAINT,
     PGM_DATABASE,
+    PGM_EXCLUDE,
     PGM_FOREIGNKEY,
     PGM_FUNCTION,
     PGM_INDEX,
diff --git a/pgadmin/schema/module.mk b/pgadmin/schema/module.mk
index 66b3eb6..5a42e55 100644
--- a/pgadmin/schema/module.mk
+++ b/pgadmin/schema/module.mk
@@ -27,6 +27,7 @@ pgadmin3_SOURCES += \
         $(subdir)/pgDatabase.cpp \
         $(subdir)/pgDatatype.cpp \
         $(subdir)/pgDomain.cpp \
+        $(subdir)/pgExclude.cpp \
         $(subdir)/pgForeignKey.cpp \
         $(subdir)/pgFunction.cpp \
         $(subdir)/pgGroup.cpp \
diff --git a/pgadmin/schema/pgConstraints.cpp b/pgadmin/schema/pgConstraints.cpp
index 2c494c4..9cb637b 100644
--- a/pgadmin/schema/pgConstraints.cpp
+++ b/pgadmin/schema/pgConstraints.cpp
@@ -18,6 +18,7 @@
 #include "schema/pgConstraints.h"
 #include "schema/pgIndexConstraint.h"
 #include "schema/pgCheck.h"
+#include "schema/pgExclude.h"
 #include "schema/pgForeignKey.h"
 
 
diff --git a/pgadmin/schema/pgExclude.cpp b/pgadmin/schema/pgExclude.cpp
new file mode 100644
index 0000000..df8f208
--- /dev/null
+++ b/pgadmin/schema/pgExclude.cpp
@@ -0,0 +1,395 @@
+//////////////////////////////////////////////////////////////////////////
+//
+// pgAdmin III - PostgreSQL Tools
+// RCS-ID:      $Id$
+// Copyright (C) 2002 - 2010, The pgAdmin Development Team
+// This software is released under the PostgreSQL Licence
+//
+// pgExclude.cpp - Exclude class
+//
+//////////////////////////////////////////////////////////////////////////
+
+// wxWindows headers
+#include <wx/wx.h>
+
+// App headers
+#include "pgAdmin3.h"
+#include "frm/frmMain.h"
+#include "utils/misc.h"
+#include "utils/pgfeatures.h"
+#include "schema/pgExclude.h"
+#include "schema/pgConstraints.h"
+#include "schema/pgIndexConstraint.h"
+
+
+pgExclude::pgExclude(pgTable *newTable, pgaFactory &factory, const wxString& newName)
+: pgTableObject(newTable, factory, newName)
+{
+    showExtendedStatistics = false;
+}
+
+bool pgExclude::DropObject(wxFrame *frame, ctlTree *browser, bool cascaded)
+{
+    wxString sql=wxT("ALTER TABLE ") + GetQuotedSchemaPrefix(GetIdxSchema()) + qtIdent(GetIdxTable())
+      + wxT(" DROP CONSTRAINT ") + GetQuotedIdentifier();
+    return GetDatabase()->ExecuteVoid(sql);
+}
+
+wxString pgExclude::GetDefinition()
+{
+    wxString str;
+
+    str = wxT("\n  USING ") + GetExcludeType()
+        + wxT("\n  (") + GetQuotedColumns() + wxT(")");
+
+    if (GetFillFactor().Length() > 0)
+        str += wxT("\n  WITH (FILLFACTOR=") + GetFillFactor() + wxT(")");
+
+    if (tablespace != GetDatabase()->GetDefaultTablespace())
+        str += wxT("\nUSING INDEX TABLESPACE ") + qtIdent(tablespace);
+
+    AppendIfFilled(str, wxT("\n  WHERE "), GetConstraint());
+
+    return str;
+}
+
+wxString pgExclude::GetCreate()
+{
+    wxString sql;
+
+    sql = GetQuotedIdentifier() + wxT(" EXCLUDE ") + GetDefinition();
+
+    return sql;
+}
+
+
+wxString pgExclude::GetSql(ctlTree *browser)
+{
+    if (sql.IsNull())
+    {
+        sql = wxT("-- Exclusion Constraint: ") + GetQuotedFullIdentifier() 
+            + wxT("\n\n-- ALTER TABLE ") + GetQuotedSchemaPrefix(GetIdxSchema()) + qtIdent(GetIdxTable())
+            + wxT(" DROP CONSTRAINT ") + GetQuotedIdentifier() + wxT(";")
+            + wxT("\n\nALTER TABLE ") + GetQuotedSchemaPrefix(GetIdxSchema()) + qtIdent(GetIdxTable())
+            + wxT("\n  ADD CONSTRAINT ")
+            + GetCreate()
+            + wxT(";\n");
+
+		if (!GetComment().IsNull())
+		{
+		    sql += wxT("COMMENT ON CONSTRAINT ") + GetQuotedIdentifier() + wxT(" ON ") + GetQuotedSchemaPrefix(GetIdxSchema()) + qtIdent(GetIdxTable())
+			    + wxT(" IS ") + qtDbString(GetComment()) + wxT(";\n");
+		}
+    }
+    return sql;
+}
+
+
+
+void pgExclude::ReadColumnDetails()
+{
+    if (!expandedKids)
+    {
+        expandedKids = true;
+
+		// Allocate memory to store column def
+		if (columnCount>0) columnList.Alloc(columnCount);
+
+        long i;
+
+        for (i=1 ; i <= columnCount ; i++)
+        {
+            if (i > 1)
+            {
+                columns += wxT(", ");
+                quotedColumns += wxT(", ");
+            }
+
+            wxString options, coldef;
+            if (GetConnection()->BackendMinimumVersion(8, 3))
+                options = wxT("  i.indoption[") + NumToStr((long)(i-1)) + wxT("] AS options,\n");
+
+            pgSet *res = ExecuteSet(
+                wxT("SELECT\n") + options +
+                wxT("  CASE WHEN (o.opcdefault = FALSE) THEN\n")
+                wxT("    pg_get_indexdef(i.indexrelid, ") + NumToStr(i) + GetDatabase()->GetPrettyOption() + wxT(") || ' ' || o.opcname\n") +
+                wxT("  ELSE\n") +
+                wxT("    pg_get_indexdef(i.indexrelid, ") + NumToStr(i) + GetDatabase()->GetPrettyOption() + wxT(")\n") +
+                wxT("  END AS coldef\n") +
+                wxT("FROM pg_index i\n") +
+                wxT("JOIN pg_attribute a ON (a.attrelid = i.indexrelid AND attnum = ") + NumToStr(i) + wxT(")\n") +
+                wxT("LEFT OUTER JOIN pg_opclass o ON (o.oid = i.indclass[") + NumToStr((long)(i-1)) + wxT("])\n") +
+                wxT("WHERE i.indexrelid = ") + GetOidStr());
+
+            if (res->NumRows() > 0)
+            {
+                coldef = res->GetVal(wxT("coldef"));
+
+                // Get the column options
+                if (GetConnection()->BackendMinimumVersion(8, 3))
+                {
+                    long opt = res->GetLong(wxT("options"));
+                    
+                    if (opt && (opt & 0x0001)) // Descending...
+                    {
+                        coldef += wxT(" DESC");
+                        // NULLS FIRST is the default for descending
+                        if (!(opt && (opt & 0x0002)))
+                            coldef += wxT(" NULLS LAST");
+                    }
+                    else // Ascending...
+                    {
+                        if ((opt && (opt & 0x0002)))
+                            coldef += wxT(" NULLS FIRST");
+                    }
+                }
+            }
+
+            columns += coldef;
+            quotedColumns += coldef;
+			columnList.Add(coldef);
+        }
+        wxStringTokenizer ops(operatorClassList);
+        wxString op;
+        while (ops.HasMoreTokens())
+        {
+            op = ops.GetNextToken();
+            pgSet *set=ExecuteSet(wxT(
+                "SELECT opcname FROM pg_opclass WHERE oid=") + op);
+            if (set)
+            {
+                if (!operatorClasses.IsNull())
+                    operatorClasses += wxT(", ");
+                operatorClasses += set->GetVal(0);
+                delete set;
+            }
+        }
+    }
+}
+
+
+void pgExclude::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *properties, ctlSQLBox *sqlPane)
+{
+    ReadColumnDetails();
+    if (properties)
+    {
+        CreateListColumns(properties);
+
+        properties->AppendItem(_("Name"), GetName());
+        properties->AppendItem(_("OID"), GetOid());
+        properties->AppendItem(_("Tablespace"), tablespace);
+        properties->AppendItem(_("Columns"), GetColumns());
+        properties->AppendItem(_("Operator classes"), GetOperatorClasses());
+        properties->AppendItem(_("Access method"), GetExcludeType());
+        properties->AppendItem(_("Constraint"), GetConstraint());
+        properties->AppendItem(_("System index?"), GetSystemObject());
+        properties->AppendItem(_("Fill factor"), GetFillFactor());
+        properties->AppendItem(_("Comment"), firstLineOnly(GetComment()));
+    }
+}
+
+
+pgObject *pgExclude::Refresh(ctlTree *browser, const wxTreeItemId item)
+{
+    pgObject *index=0;
+    pgCollection *coll=browser->GetParentCollection(item);
+    if (coll)
+        index = indexFactory.CreateObjects(coll, 0, wxT("\n   AND cls.oid=") + GetOidStr());
+
+    return index;
+}
+
+
+pgObject *pgExcludeFactory::CreateObjects(pgCollection *coll, ctlTree *browser, const wxString &restriction)
+{
+    pgTableObjCollection *collection=(pgTableObjCollection*)coll;
+    pgExclude *index=0;
+    wxString query;
+
+    wxString proname, projoin;
+    proname = wxT("indnatts, ");
+    proname += wxT("cls.reltablespace AS spcoid, spcname, ");
+    projoin = wxT("  LEFT OUTER JOIN pg_tablespace ta on ta.oid=cls.reltablespace\n");
+    query = wxT("SELECT DISTINCT ON(cls.relname) cls.oid, cls.relname as idxname, indrelid, indkey, indisclustered, indisunique, indisprimary, n.nspname,\n")
+        wxT("       ") + proname + wxT("tab.relname as tabname, indclass, con.oid AS conoid, CASE contype WHEN 'p' THEN desp.description WHEN 'u' THEN desp.description ELSE des.description END AS description,\n")
+        wxT("       pg_get_expr(indpred, indrelid") + collection->GetDatabase()->GetPrettyOption() + wxT(") as indconstraint, contype, condeferrable, condeferred, amname\n");
+    query += wxT(", substring(array_to_string(cls.reloptions, ',') from 'fillfactor=([0-9]*)') AS fillfactor \n");
+    query += wxT("  FROM pg_index idx\n")
+        wxT("  JOIN pg_class cls ON cls.oid=indexrelid\n")
+        wxT("  JOIN pg_class tab ON tab.oid=indrelid\n")
+        + projoin + 
+        wxT("  JOIN pg_namespace n ON n.oid=tab.relnamespace\n")
+        wxT("  JOIN pg_am am ON am.oid=cls.relam\n")
+        wxT("  LEFT JOIN pg_depend dep ON (dep.classid = cls.tableoid AND dep.objid = cls.oid AND dep.refobjsubid = '0')\n")
+        wxT("  LEFT OUTER JOIN pg_constraint con ON (con.tableoid = dep.refclassid AND con.oid = dep.refobjid)\n")
+        wxT("  LEFT OUTER JOIN pg_description des ON des.objoid=cls.oid\n")
+        wxT("  LEFT OUTER JOIN pg_description desp ON (desp.objoid=con.oid AND desp.objsubid = 0)\n")
+        wxT(" WHERE indrelid = ") + collection->GetOidStr()
+        + restriction + wxT("\n")
+        wxT(" ORDER BY cls.relname");
+    pgSet *indexes= collection->GetDatabase()->ExecuteSet(query);
+
+    if (indexes)
+    {
+        while (!indexes->Eof())
+        {
+            switch (indexes->GetVal(wxT("contype"))[0U])
+            {
+                case 0:
+                    index = new pgExclude(collection->GetTable(), indexes->GetVal(wxT("idxname")));
+                    break;
+                case 'p':
+                    index = new pgPrimaryKey(collection->GetTable(), indexes->GetVal(wxT("idxname")));
+                    ((pgPrimaryKey *)index)->iSetConstraintOid(indexes->GetOid(wxT("conoid")));
+                    break;
+                case 'u':
+                    index = new pgUnique(collection->GetTable(), indexes->GetVal(wxT("idxname")));
+                    ((pgUnique *)index)->iSetConstraintOid(indexes->GetOid(wxT("conoid")));
+                    break;
+                default:
+                    index=0;
+                    break;
+            }
+
+            index->iSetOid(indexes->GetOid(wxT("oid")));
+            index->iSetIsClustered(indexes->GetBool(wxT("indisclustered")));
+            index->iSetIsUnique(indexes->GetBool(wxT("indisunique")));
+            index->iSetIsPrimary(indexes->GetBool(wxT("indisprimary")));
+            index->iSetColumnNumbers(indexes->GetVal(wxT("indkey")));
+            index->iSetIdxSchema(indexes->GetVal(wxT("nspname")));
+            index->iSetComment(indexes->GetVal(wxT("description")));
+            index->iSetIdxTable(indexes->GetVal(wxT("tabname")));
+            index->iSetRelTableOid(indexes->GetOid(wxT("indrelid")));
+            if (collection->GetConnection()->BackendMinimumVersion(7, 4))
+            {
+                index->iSetColumnCount(indexes->GetLong(wxT("indnatts")));
+                if (collection->GetConnection()->BackendMinimumVersion(8, 0))
+                {
+					if (indexes->GetOid(wxT("spcoid")) == 0)
+						index->iSetTablespaceOid(collection->GetDatabase()->GetTablespaceOid());
+					else
+						index->iSetTablespaceOid(indexes->GetOid(wxT("spcoid")));
+
+                    if (indexes->GetVal(wxT("spcname")) == wxEmptyString)
+                        index->iSetTablespace(collection->GetDatabase()->GetTablespace());
+                    else
+                        index->iSetTablespace(indexes->GetVal(wxT("spcname")));
+                }
+
+            }
+            else
+            {
+                index->iSetColumnCount(0L);
+                index->iSetProcNamespace(indexes->GetVal(wxT("pronspname")));
+                index->iSetProcName(indexes->GetVal(wxT("proname")));
+                index->iSetProcArgTypeList(indexes->GetVal(wxT("proargtypes")));
+            }
+            index->iSetOperatorClassList(indexes->GetVal(wxT("indclass")));
+            index->iSetDeferrable(indexes->GetBool(wxT("condeferrable")));
+            index->iSetDeferred(indexes->GetBool(wxT("condeferred")));
+            index->iSetConstraint(indexes->GetVal(wxT("indconstraint")));
+            index->iSetExcludeType(indexes->GetVal(wxT("amname")));
+            if (collection->GetConnection()->BackendMinimumVersion(8, 2))
+                index->iSetFillFactor(indexes->GetVal(wxT("fillfactor")));
+
+            if (browser)
+            {
+                browser->AppendObject(collection, index);
+        		indexes->MoveNext();
+            }
+            else
+                break;
+        }
+
+		delete indexes;
+    }
+    return index;
+}
+
+
+pgCollection *pgExcludeFactory::CreateCollection(pgObject *obj)
+{
+    return new pgExcludeCollection(GetCollectionFactory(), (pgTable*)obj);
+}
+
+
+
+pgObject *pgExcludeFactory::CreateObjects(pgCollection *collection, ctlTree *browser, const wxString &restriction)
+{
+    return pgExcludeFactory::CreateObjects(collection, browser, restriction + wxT("\n   AND conname IS NULL"));
+}
+
+
+/////////////////////////////
+
+#include "images/index.xpm"
+#include "images/indexes.xpm"
+
+pgExcludeFactory::pgExcludeFactory()
+: pgExcludeFactory(__("Exclude"), __("New Exclude..."), __("Create a new Exclude."), index_xpm)
+{
+    metaType = PGM_INDEX;
+}
+
+
+pgExcludeFactory indexFactory;
+static pgaCollectionFactory cf(&indexFactory, __("Excludees"), indexes_xpm);
+
+
+pgExcludeCollection::pgExcludeCollection(pgaFactory *factory, pgTable *tbl)
+: pgTableObjCollection(factory, tbl)
+{
+}
+
+
+void pgExcludeCollection::ShowStatistics(frmMain *form, ctlListView *statistics)
+{
+    wxLogInfo(wxT("Displaying statistics for indexes on ") + GetTable()->GetName());
+
+    bool hasSize=GetConnection()->HasFeature(FEATURE_SIZE);
+
+    // Add the statistics view columns
+    statistics->ClearAll();
+    statistics->AddColumn(_("Exclude Name"));
+    statistics->AddColumn(_("Exclude Scans"));
+    statistics->AddColumn(_("Exclude Tuples Read"));
+    statistics->AddColumn(_("Exclude Tuples Fetched"));
+    if (hasSize)
+        statistics->AddColumn(_("Size"));
+
+    wxString sql = wxT("SELECT indexrelname, ")
+		wxT("idx_scan, idx_tup_read, idx_tup_fetch");
+
+    if (hasSize)
+        sql += wxT(", pg_size_pretty(pg_relation_size(") + GetOidStr() + wxT(")) AS ") + qtIdent(_("size"));
+
+    sql += wxT("\n")
+        wxT("  FROM pg_stat_all_indexes stat\n")
+        wxT("  JOIN pg_class cls ON cls.oid=indexrelid\n")
+        wxT("  LEFT JOIN pg_depend dep ON (dep.classid = cls.tableoid AND dep.objid = cls.oid AND dep.refobjsubid = '0')\n")
+        wxT("  LEFT OUTER JOIN pg_constraint con ON (con.tableoid = dep.refclassid AND con.oid = dep.refobjid)\n")
+        wxT("  WHERE schemaname = ") + qtDbString(GetTable()->GetSchema()->GetName())
+		+ wxT(" AND stat.relname = ") + qtDbString(GetTable()->GetName())
+		+ wxT(" AND con.contype IS NULL")
+        + wxT("\n ORDER BY indexrelname");
+
+    pgSet *stats = GetDatabase()->ExecuteSet(sql);
+
+    if (stats)
+    {
+        long pos=0;
+        while (!stats->Eof())
+        {
+            statistics->InsertItem(pos, stats->GetVal(wxT("indexrelname")), PGICON_STATISTICS);
+            statistics->SetItem(pos, 1, stats->GetVal(wxT("idx_scan")));
+            statistics->SetItem(pos, 2, stats->GetVal(wxT("idx_tup_read")));
+            statistics->SetItem(pos, 3, stats->GetVal(wxT("idx_tup_fetch")));
+            if (hasSize)
+                statistics->SetItem(pos, 4, stats->GetVal(wxT("size")));
+            stats->MoveNext();
+            pos++;
+        }
+
+        delete stats;
+    }
+}
diff --git a/pgadmin/schema/pgObject.cpp b/pgadmin/schema/pgObject.cpp
index 05c95a1..829804d 100644
--- a/pgadmin/schema/pgObject.cpp
+++ b/pgadmin/schema/pgObject.cpp
@@ -41,6 +41,7 @@
 #include "schema/pgCheck.h"
 #include "schema/pgIndexConstraint.h"
 #include "schema/pgForeignKey.h"
+#include "schema/pgExclude.h"
 #include "schema/pgRule.h"
 #include "schema/pgRole.h"
 #include "utils/pgDefs.h"
diff --git a/pgadmin/schema/pgTable.cpp b/pgadmin/schema/pgTable.cpp
index 99744cb..549ed48 100644
--- a/pgadmin/schema/pgTable.cpp
+++ b/pgadmin/schema/pgTable.cpp
@@ -21,6 +21,7 @@
 #include "schema/pgIndexConstraint.h"
 #include "schema/pgForeignKey.h"
 #include "schema/pgCheck.h"
+#include "schema/pgExclude.h"
 #include "utils/sysSettings.h"
 #include "utils/pgfeatures.h"
 #include "schema/pgRule.h"
@@ -355,6 +356,9 @@ wxString pgTable::GetSql(ctlTree *browser)
                     case PGM_CHECK:
                         cols_sql += wxT("(") + ((pgCheck*)data)->GetDefinition() + wxT(")");
                         break;
+                    case PGM_EXCLUDE:
+                      sql += wxT("(") + ((pgExclude*)data)->GetDefinition() + wxT(")");
+                        break;
                 }
             }
         }
diff --git a/pgadmin/ui/dlgExclude.xrc b/pgadmin/ui/dlgExclude.xrc
new file mode 100644
index 0000000..177a6d8
--- /dev/null
+++ b/pgadmin/ui/dlgExclude.xrc
@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<resource>
+  <object class="wxDialog" name="dlgExclude">
+    <title></title>
+    <size>220,280d</size>
+    <style>wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxSYSTEM_MENU|wxRESIZE_BORDER|wxRESIZE_BOX|wxTHICK_FRAME</style>
+    <object class="wxFlexGridSizer">
+      <cols>1</cols>
+      <growablerows>0</growablerows>
+      <growablecols>0</growablecols>
+      <object class="sizeritem">
+        <object class="wxNotebook" name="nbNotebook">
+          <size>216,255d</size>
+          <selected>0</selected>
+          <object class="notebookpage">
+            <label>Properties</label>
+            <object class="wxPanel" name="pnlProperties">
+              <object class="wxFlexGridSizer">
+                <cols>2</cols>
+                <rows>7</rows>
+                <vgap>5</vgap>
+                <hgap>5</hgap>
+                <growablerows>5</growablerows>
+                <growablecols>1</growablecols>
+                <object class="sizeritem">
+                  <object class="wxStaticText" name="stName">
+                    <label>Name</label>
+                  </object>
+                  <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxTextCtrl" name="txtName"/>
+                  <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxStaticText" name="stTablespace">
+                    <label>Tablespace</label>
+                  </object>
+                  <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxComboBox" name="cbTablespace">
+                    <content/>
+                    <style>wxCB_READONLY|wxCB_DROPDOWN</style>
+                  </object>
+                  <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxStaticText" name="stType">
+                    <label>Access method</label>
+                  </object>
+                  <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxComboBox" name="cbType">
+                    <content/>
+                    <style>wxCB_READONLY|wxCB_DROPDOWN</style>
+                  </object>
+                  <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxStaticText" name="stFillFactor">
+                    <label>Fill factor</label>
+                  </object>
+                  <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxTextCtrl" name="txtFillFactor"/>
+                  <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxStaticText" name="stWhere">
+                    <label>Constraint</label>
+                  </object>
+                  <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxTextCtrl" name="txtWhere">
+                    <style>wxTE_MULTILINE</style>
+                  </object>
+                  <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxStaticText" name="stComment">
+                    <label>Comment</label>
+                  </object>
+                  <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxTextCtrl" name="txtComment">
+                    <style>wxTE_MULTILINE</style>
+                  </object>
+                  <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxStaticText" name="stClusterSet">
+                    <label>Use replication</label>
+                  </object>
+                  <flag>wxALIGN_CENTRE_VERTICAL|wxALL</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxComboBox" name="cbClusterSet">
+                    <content/>
+                    <style>wxCB_READONLY|wxCB_DROPDOWN</style>
+                  </object>
+                  <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL</flag>
+                  <border>4</border>
+                </object>
+              </object>
+            </object>
+            <selected>1</selected>
+          </object>
+          <object class="notebookpage">
+            <label>Exclude items</label>
+            <object class="wxPanel" name="pnlColumns">
+              <object class="wxFlexGridSizer">
+                <cols>1</cols>
+                <rows>4</rows>
+                <growablecols>0</growablecols>
+                <growablerows>0</growablerows>
+                <object class="sizeritem">
+                  <object class="wxListCtrl" name="lstColumns">
+                    <style>wxLC_REPORT|wxLC_SINGLE_SEL</style>
+                  </object>
+                  <flag>wxEXPAND|wxALL</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxFlexGridSizer">
+                    <cols>2</cols>
+                    <rows>3</rows>
+                    <vgap>5</vgap>
+                    <hgap>5</hgap>
+                    <growablecols>1</growablecols>
+                    <growablerows>0</growablerows>
+                    <object class="sizeritem">
+                      <object class="wxStaticText" name="stColumns">
+                        <label>Column</label>
+                      </object>
+                      <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                      <border>4</border>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxComboBox" name="cbColumns">
+                        <content/>
+                        <style>wxCB_READONLY|wxCB_DROPDOWN</style>
+                      </object>
+                      <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                      <border>4</border>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxStaticText" name="stOperator">
+                        <label>Operator</label>
+                      </object>
+                      <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                      <border>4</border>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxComboBox" name="cbOperator">
+                        <content/>
+                        <style>wxCB_READONLY|wxCB_DROPDOWN</style>
+                      </object>
+                      <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                      <border>4</border>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxStaticText" name="stOpClass">
+                        <label>Operator class</label>
+                      </object>
+                      <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                      <border>4</border>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxComboBox" name="cbOpClass">
+                        <content/>
+                        <style>wxCB_READONLY|wxCB_DROPDOWN</style>
+                      </object>
+                      <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                      <border>4</border>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxStaticText" name="stDesc">
+                        <label>DESC</label>
+                      </object>
+                      <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                      <border>4</border>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxFlexGridSizer">
+                        <cols>5</cols>
+                        <rows>1</rows>
+                        <object class="sizeritem">
+                          <object class="wxCheckBox" name="chkDesc">
+                            <label></label>
+                          </object>
+                          <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT</flag>
+                          <border>4</border>
+                        </object>
+                        <object class="spacer">
+                          <size>15,3d</size>
+                        </object>
+                        <object class="sizeritem">
+                          <object class="wxStaticText" name="stNulls">
+                            <label>NULLs</label>
+                          </object>
+                          <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                          <border>4</border>
+                        </object>
+                        <object class="spacer">
+                          <size>10,3d</size>
+                        </object>
+                        <object class="sizeritem">
+                          <object class="wxFlexGridSizer">
+                            <cols>3</cols>
+                            <object class="sizeritem">
+                              <object class="wxRadioButton" name="rdbNullsFirst">
+                                <label>FIRST</label>
+                                <style>wxRB_GROUP</style>
+                              </object>
+                            </object>
+                            <object class="spacer">
+                              <size>15,3d</size>
+                            </object>
+                            <object class="sizeritem">
+                              <object class="wxRadioButton" name="rdbNullsLast">
+                                <label>LAST</label>
+                                <value>1</value>
+                              </object>
+                            </object>
+                          </object>
+                          <flag>wxTOP</flag>
+                          <border>5</border>
+                        </object>
+                      </object>
+                      <flag>wxEXPAND|wxALL</flag>
+                      <border>4</border>
+                    </object>
+                  </object>
+                  <flag>wxEXPAND|wxALL</flag>
+                  <border>4</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxFlexGridSizer">
+                    <cols>4</cols>
+                    <growablecols>0</growablecols>
+                    <object class="spacer">
+                      <size>3,3d</size>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxButton" name="btnAddCol">
+                        <label>Add</label>
+                      </object>
+                    </object>
+                    <object class="spacer">
+                      <size>3,3d</size>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxButton" name="btnRemoveCol">
+                        <label>Remove</label>
+                        <size>50,-1d</size>
+                      </object>
+                    </object>
+                  </object>
+                  <flag>wxEXPAND|wxALL</flag>
+                  <border>4</border>
+                </object>
+              </object>
+            </object>
+          </object>
+        </object>
+        <flag>wxALL|wxGROW|wxALIGN_CENTRE</flag>
+        <border>3</border>
+      </object>
+      <object class="sizeritem">
+        <object class="wxFlexGridSizer">
+          <cols>4</cols>
+          <growablecols>1</growablecols>
+          <object class="sizeritem">
+            <object class="wxButton" name="wxID_HELP">
+              <label>Help</label>
+            </object>
+            <flag>wxEXPAND|wxALL</flag>
+            <border>3</border>
+          </object>
+          <object class="spacer">
+            <size>0,0d</size>
+          </object>
+          <object class="sizeritem">
+            <object class="wxButton" name="wxID_OK">
+              <label>&amp;OK</label>
+              <default>1</default>
+            </object>
+            <flag>wxEXPAND|wxALL</flag>
+            <border>3</border>
+          </object>
+          <object class="sizeritem">
+            <object class="wxButton" name="wxID_CANCEL">
+              <label>&amp;Cancel</label>
+            </object>
+            <flag>wxEXPAND|wxALL</flag>
+            <border>3</border>
+          </object>
+        </object>
+        <flag>wxEXPAND|wxTOP|wxLEFT|wxRIGHT</flag>
+      </object>
+      <object class="sizeritem">
+        <object class="wxStatusBar" name="unkStatusBar">
+          <style>wxST_SIZEGRIP</style>
+        </object>
+        <flag>wxEXPAND|wxALIGN_CENTRE</flag>
+        <border>3</border>
+      </object>
+    </object>
+  </object>
+</resource>
diff --git a/pgadmin/ui/module.mk b/pgadmin/ui/module.mk
index 1a0868c..c224215 100644
--- a/pgadmin/ui/module.mk
+++ b/pgadmin/ui/module.mk
@@ -24,6 +24,7 @@ TMP_ui += \
 	$(srcdir)/ui/dlgDirectDbg.xrc \
 	$(srcdir)/ui/dlgDomain.xrc \
 	$(srcdir)/ui/dlgEditGridOptions.xrc \
+	$(srcdir)/ui/dlgExclude.xrc \
 	$(srcdir)/ui/dlgExtTable.xrc \
 	$(srcdir)/ui/dlgFindReplace.xrc \
 	$(srcdir)/ui/dlgForeignKey.xrc \
