diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
new file mode 100644
index 08c2b0c..333e628
*** a/src/bin/pg_dump/pg_dump.c
--- b/src/bin/pg_dump/pg_dump.c
*************** getOwnedSeqs(Archive *fout, TableInfo tb
*** 6035,6048 ****
  
  		if (!OidIsValid(seqinfo->owning_tab))
  			continue;			/* not an owned sequence */
! 		if (seqinfo->dobj.dump & DUMP_COMPONENT_DEFINITION)
! 			continue;			/* no need to search */
  		owning_tab = findTableByOid(seqinfo->owning_tab);
! 		if (owning_tab && owning_tab->dobj.dump)
! 		{
  			seqinfo->interesting = true;
- 			seqinfo->dobj.dump = DUMP_COMPONENT_ALL;
- 		}
  	}
  }
  
--- 6035,6061 ----
  
  		if (!OidIsValid(seqinfo->owning_tab))
  			continue;			/* not an owned sequence */
! 
  		owning_tab = findTableByOid(seqinfo->owning_tab);
! 
! 		/*
! 		 * We need to dump the components that are being dumped for the table
! 		 * and any components which the sequence is explicitly marked with.
! 		 *
! 		 * We can't simply use the set of components which are being dumped for
! 		 * the table as the table might be in an extension (and only the
! 		 * non-extension components, eg: ACLs if changed, security labels, and
! 		 * policies, are being dumped) while the sequence is not (and therefore
! 		 * the definition and other components should also be dumped).
! 		 *
! 		 * If the sequence is part of the extension then it should be properly
! 		 * marked by checkExtensionMembership() and this will be a no-op as the
! 		 * table will be equivilantly marked.
! 		 */
! 		seqinfo->dobj.dump = seqinfo->dobj.dump | owning_tab->dobj.dump;
! 
! 		if (seqinfo->dobj.dump != DUMP_COMPONENT_NONE)
  			seqinfo->interesting = true;
  	}
  }
  
diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl
new file mode 100644
index 1d82bfd..5a042b8
*** a/src/bin/pg_dump/t/002_pg_dump.pl
--- b/src/bin/pg_dump/t/002_pg_dump.pl
*************** my %tests = (
*** 361,366 ****
--- 361,416 ----
  			only_dump_test_schema  => 1,
  			only_dump_test_table   => 1,
  			test_schema_plus_blobs => 1, }, },
+ 	'ALTER SEQUENCE test_table_col1_seq' => {
+ 		regexp => qr/^
+ 			\QALTER SEQUENCE test_table_col1_seq OWNED BY test_table.col1;\E
+ 			/xm,
+ 		like => {
+ 			binary_upgrade          => 1,
+ 			clean                   => 1,
+ 			clean_if_exists         => 1,
+ 			createdb                => 1,
+ 			defaults                => 1,
+ 			exclude_test_table_data => 1,
+ 			no_privs                => 1,
+ 			no_owner                => 1,
+ 			only_dump_test_schema   => 1,
+ 			only_dump_test_table    => 1,
+ 			pg_dumpall_dbprivs      => 1,
+ 			schema_only             => 1,
+ 			section_pre_data        => 1,
+ 			test_schema_plus_blobs  => 1, },
+ 		unlike => {
+ 			exclude_test_table       => 1,
+ 			exclude_dump_test_schema => 1,
+ 			pg_dumpall_globals       => 1,
+ 			pg_dumpall_globals_clean => 1,
+ 			section_post_data        => 1, }, },
+ 	'ALTER SEQUENCE test_third_table_col1_seq' => {
+ 		regexp => qr/^
+ 			\QALTER SEQUENCE test_third_table_col1_seq OWNED BY test_third_table.col1;\E
+ 			/xm,
+ 		like => {
+ 			binary_upgrade           => 1,
+ 			clean                    => 1,
+ 			clean_if_exists          => 1,
+ 			createdb                 => 1,
+ 			defaults                 => 1,
+ 			exclude_dump_test_schema => 1,
+ 			exclude_test_table       => 1,
+ 			exclude_test_table_data  => 1,
+ 			no_privs                 => 1,
+ 			no_owner                 => 1,
+ 			pg_dumpall_dbprivs       => 1,
+ 			schema_only              => 1,
+ 			section_pre_data         => 1, },
+ 		unlike => {
+ 			only_dump_test_schema    => 1,
+ 			only_dump_test_table     => 1,
+ 			pg_dumpall_globals       => 1,
+ 			pg_dumpall_globals_clean => 1,
+ 			section_post_data        => 1,
+ 			test_schema_plus_blobs   => 1, }, },
  	'ALTER TABLE ONLY test_table ADD CONSTRAINT ... PRIMARY KEY' => {
  		regexp => qr/^
  			\QALTER TABLE ONLY test_table\E \n^\s+
diff --git a/src/test/modules/test_pg_dump/t/001_base.pl b/src/test/modules/test_pg_dump/t/001_base.pl
new file mode 100644
index fd9c37f..fc93e1b
*** a/src/test/modules/test_pg_dump/t/001_base.pl
--- b/src/test/modules/test_pg_dump/t/001_base.pl
*************** my %tests = (
*** 223,232 ****
  			schema_only       => 1,
  			section_pre_data  => 1,
  			section_post_data => 1, }, },
  	'CREATE TABLE regress_pg_dump_table' => {
  		regexp => qr/^
  			\QCREATE TABLE regress_pg_dump_table (\E
! 			\n\s+\Qcol1 integer,\E
  			\n\s+\Qcol2 integer\E
  			\n\);$/xm,
  		like   => { binary_upgrade => 1, },
--- 223,274 ----
  			schema_only       => 1,
  			section_pre_data  => 1,
  			section_post_data => 1, }, },
+     'CREATE SEQUENCE regress_pg_dump_table_col1_seq' => {
+             regexp => qr/^
+                     \QCREATE SEQUENCE regress_pg_dump_table_col1_seq\E
+                     \n\s+\QSTART WITH 1\E
+                     \n\s+\QINCREMENT BY 1\E
+                     \n\s+\QNO MINVALUE\E
+                     \n\s+\QNO MAXVALUE\E
+                     \n\s+\QCACHE 1;\E
+                     $/xm,
+             like   => { binary_upgrade => 1, },
+             unlike => {
+                     clean              => 1,
+                     clean_if_exists    => 1,
+                     createdb           => 1,
+                     defaults           => 1,
+                     no_privs           => 1,
+                     no_owner           => 1,
+                     pg_dumpall_globals => 1,
+                     schema_only        => 1,
+                     section_pre_data   => 1,
+                     section_post_data  => 1, }, },
+     'CREATE SEQUENCE regress_pg_dump_seq' => {
+             regexp => qr/^
+                     \QCREATE SEQUENCE regress_pg_dump_seq\E
+                     \n\s+\QSTART WITH 1\E
+                     \n\s+\QINCREMENT BY 1\E
+                     \n\s+\QNO MINVALUE\E
+                     \n\s+\QNO MAXVALUE\E
+                     \n\s+\QCACHE 1;\E
+                     $/xm,
+             like   => { binary_upgrade => 1, },
+             unlike => {
+                     clean              => 1,
+                     clean_if_exists    => 1,
+                     createdb           => 1,
+                     defaults           => 1,
+                     no_privs           => 1,
+                     no_owner           => 1,
+                     pg_dumpall_globals => 1,
+                     schema_only        => 1,
+                     section_pre_data   => 1,
+                     section_post_data  => 1, }, },
  	'CREATE TABLE regress_pg_dump_table' => {
  		regexp => qr/^
  			\QCREATE TABLE regress_pg_dump_table (\E
! 			\n\s+\Qcol1 integer NOT NULL,\E
  			\n\s+\Qcol2 integer\E
  			\n\);$/xm,
  		like   => { binary_upgrade => 1, },
diff --git a/src/test/modules/test_pg_dump/test_pg_dump--1.0.sql b/src/test/modules/test_pg_dump/test_pg_dump--1.0.sql
new file mode 100644
index 5fe6063..93de2c5
*** a/src/test/modules/test_pg_dump/test_pg_dump--1.0.sql
--- b/src/test/modules/test_pg_dump/test_pg_dump--1.0.sql
***************
*** 4,13 ****
  \echo Use "CREATE EXTENSION test_pg_dump" to load this file. \quit
  
  CREATE TABLE regress_pg_dump_table (
! 	col1 int,
  	col2 int
  );
  
  GRANT SELECT ON regress_pg_dump_table TO regress_dump_test_role;
  GRANT SELECT(col1) ON regress_pg_dump_table TO public;
  
--- 4,15 ----
  \echo Use "CREATE EXTENSION test_pg_dump" to load this file. \quit
  
  CREATE TABLE regress_pg_dump_table (
! 	col1 serial,
  	col2 int
  );
  
+ CREATE SEQUENCE regress_pg_dump_seq;
+ 
  GRANT SELECT ON regress_pg_dump_table TO regress_dump_test_role;
  GRANT SELECT(col1) ON regress_pg_dump_table TO public;
  
