]> granicus.if.org Git - postgresql/commitdiff
Un-break pg_dump for the case of zero-column tables.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 24 Feb 2010 02:15:58 +0000 (02:15 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 24 Feb 2010 02:15:58 +0000 (02:15 +0000)
This was evidently broken by the CREATE TABLE OF TYPE patch.  It would have
been noticed if anyone had bothered to try dumping and restoring the
regression database ...

src/bin/pg_dump/pg_dump.c

index cf38f167fbec1c78041c0cdcdedb2cc05347c250..95c08f11f97cff7d9d5346f70f5474a39c9fb218 100644 (file)
@@ -12,7 +12,7 @@
  *     by PostgreSQL
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.573 2010/02/24 01:57:16 tgl Exp $
+ *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.574 2010/02/24 02:15:58 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -10685,6 +10685,14 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
 
                if (actual_atts)
                        appendPQExpBuffer(q, "\n)");
+               else if (!tbinfo->reloftype)
+               {
+                       /*
+                        * We must have a parenthesized attribute list, even though empty,
+                        * when not using the OF TYPE syntax.
+                        */
+                       appendPQExpBuffer(q, " (\n)");
+               }
 
                if (numParents > 0 && !binary_upgrade)
                {