diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index bd7b1a0c009399c294927618bd6dc63f03c7e547..7870a0d66d21d6a8d2e2c526b9e3bd15494195f3 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.70 2002/09/04 20:31:34 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.71 2002/10/09 16:20:25 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -284,16 +284,18 @@ flagInhAttrs(TableInfo *tblinfo, int numTables,
 		if (numParents == 0)
 			continue;			/* nothing to see here, move along */
 
-		/*
+		/*----------------------------------------------------------------
 		 * For each attr, check the parent info: if no parent has an attr
 		 * with the same name, then it's not inherited. If there *is* an
 		 * attr with the same name, then only dump it if:
 		 *
-		 * - it is NOT NULL and zero parents are NOT NULL OR - it has a
-		 * default value AND the default value does not match all parent
-		 * default values, or no parents specify a default.
+		 * - it is NOT NULL and zero parents are NOT NULL
+		 *   OR 
+		 * - it has a default value AND the default value does not match
+		 *   all parent default values, or no parents specify a default.
 		 *
 		 * See discussion on -hackers around 2-Apr-2001.
+		 *----------------------------------------------------------------
 		 */
 		for (j = 0; j < tblinfo[i].numatts; j++)
 		{
@@ -359,6 +361,12 @@ flagInhAttrs(TableInfo *tblinfo, int numTables,
 					tblinfo[i].inhAttrs[j] = false;
 					tblinfo[i].inhNotNull[j] = false;
 				}
+
+				/* Clear it if attr has local definition */
+				if (g_fout->remoteVersion >= 70300 && tblinfo[i].attislocal[j])
+				{
+					tblinfo[i].inhAttrs[j] = false;
+				}
 			}
 		}
 	}
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index e94d8c1103eaaeec034e71dcaba31dfd271fc7f3..5f7bf54e01bcb0ac01289a3c54fecb842b27a4f2 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -22,7 +22,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.301 2002/09/24 23:14:25 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.302 2002/10/09 16:20:25 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -2356,6 +2356,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
 	int			i_attnotnull;
 	int			i_atthasdef;
 	int			i_attisdropped;
+	int			i_attislocal;
 	PGresult   *res;
 	int			ntups;
 	bool		hasdefaults;
@@ -2397,7 +2398,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
 		if (g_fout->remoteVersion >= 70300)
 		{
 			appendPQExpBuffer(q, "SELECT attnum, attname, atttypmod, attstattarget, "
-							  "attnotnull, atthasdef, attisdropped, "
+					  "attnotnull, atthasdef, attisdropped, attislocal, "
 			  "pg_catalog.format_type(atttypid,atttypmod) as atttypname "
 							  "from pg_catalog.pg_attribute a "
 							  "where attrelid = '%s'::pg_catalog.oid "
@@ -2413,7 +2414,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
 			 * been explicitly set or was just a default.
 			 */
 			appendPQExpBuffer(q, "SELECT attnum, attname, atttypmod, -1 as attstattarget, "
-						 "attnotnull, atthasdef, false as attisdropped, "
+						 "attnotnull, atthasdef, false as attisdropped, null as attislocal, "
 						 "format_type(atttypid,atttypmod) as atttypname "
 							  "from pg_attribute a "
 							  "where attrelid = '%s'::oid "
@@ -2425,7 +2426,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
 		{
 			/* format_type not available before 7.1 */
 			appendPQExpBuffer(q, "SELECT attnum, attname, atttypmod, -1 as attstattarget, "
-						 "attnotnull, atthasdef, false as attisdropped, "
+						 "attnotnull, atthasdef, false as attisdropped, null as attislocal, "
 							  "(select typname from pg_type where oid = atttypid) as atttypname "
 							  "from pg_attribute a "
 							  "where attrelid = '%s'::oid "
@@ -2451,6 +2452,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
 		i_attnotnull = PQfnumber(res, "attnotnull");
 		i_atthasdef = PQfnumber(res, "atthasdef");
 		i_attisdropped = PQfnumber(res, "attisdropped");
+		i_attislocal = PQfnumber(res, "attislocal");
 
 		tbinfo->numatts = ntups;
 		tbinfo->attnames = (char **) malloc(ntups * sizeof(char *));
@@ -2458,6 +2460,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
 		tbinfo->atttypmod = (int *) malloc(ntups * sizeof(int));
 		tbinfo->attstattarget = (int *) malloc(ntups * sizeof(int));
 		tbinfo->attisdropped = (bool *) malloc(ntups * sizeof(bool));
+		tbinfo->attislocal = (bool *) malloc(ntups * sizeof(bool));
 		tbinfo->attisserial = (bool *) malloc(ntups * sizeof(bool));
 		tbinfo->notnull = (bool *) malloc(ntups * sizeof(bool));
 		tbinfo->adef_expr = (char **) malloc(ntups * sizeof(char *));
@@ -2473,6 +2476,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
 			tbinfo->atttypmod[j] = atoi(PQgetvalue(res, j, i_atttypmod));
 			tbinfo->attstattarget[j] = atoi(PQgetvalue(res, j, i_attstattarget));
 			tbinfo->attisdropped[j] = (PQgetvalue(res, j, i_attisdropped)[0] == 't');
+			tbinfo->attislocal[j] = (PQgetvalue(res, j, i_attislocal)[0] == 't');
 			tbinfo->attisserial[j] = false;		/* fix below */
 			tbinfo->notnull[j] = (PQgetvalue(res, j, i_attnotnull)[0] == 't');
 			tbinfo->adef_expr[j] = NULL;		/* fix below */
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index d7e214c972ad5559ef6a77eedb234affff4bac37..8193f66aeb9e0a53debb4125558f34649ba15d29 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: pg_dump.h,v 1.99 2002/09/04 20:31:35 momjian Exp $
+ * $Id: pg_dump.h,v 1.100 2002/10/09 16:20:25 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -129,6 +129,7 @@ typedef struct _tableInfo
 	int		   *atttypmod;		/* type-specific type modifiers */
 	int		   *attstattarget;	/* attribute statistics targets */
 	bool	   *attisdropped;	/* true if attr is dropped; don't dump it */
+	bool	   *attislocal;		/* true if attr has local definition */
 	bool	   *attisserial;	/* true if attr is serial or bigserial */
 
 	/*