pg_dump --table=* dumps nothing? - Mailing list pgsql-patches

From David Walter
Subject pg_dump --table=* dumps nothing?
Date
Msg-id 87isn9nlc1.fsf@syr.edu
Whole thread Raw
Responses Re: pg_dump --table=* dumps nothing?  (Peter Eisentraut <peter_e@gmx.net>)
Re: pg_dump --table=* dumps nothing?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Using pg_dump version 7.3.4 with the following options
no table data is dumped.

pg_dump -i --table=* --schema-only db
--
-- PostgreSQL database dump
--
--

EOF

The following patch work for the tables in the specified database. The
patch was built from the source for 7.3.2.

I'm not subscribed to the list, so please cc me if you  wish me to see
any comments.

Thanks.


--- pg_dump.c.orig    2003-10-01 09:04:48.000000000 -0400
+++ pg_dump.c    2003-10-01 09:07:11.000000000 -0400
@@ -781,6 +781,16 @@ selectDumpableTable(TableInfo *tbinfo)
      */
     if (tbinfo->relnamespace->dump)
         tbinfo->dump = true;
+   /*
+    * ** selectTablename 'magic' **
+    * '*' == all tables strlen == 0
+    * selectTablename not null
+    * *selectTablename == '\0'
+    * assumes that saying '*'  doesn't include system tables --
+    * unless parent namespace had been specified.
+    */
+    else if (selectTablename != NULL && !strlen(selectTablename) && strncmp(tbinfo->relname, "pg_", 3) != 0)
+        tbinfo->dump = true;
     else if (selectTablename != NULL)
         tbinfo->dump = (strcmp(tbinfo->relname, selectTablename) == 0);
     else

--

pub  1024D/DC92AE30 2002-02-26 David Walter <dwalter@syr.edu>
fingerprint = 50A0 E513 732D 1D0F BD26  C84E A8DD 9D80 DC92 AE30
sub  2048g/51023582 2002-02-26

pgsql-patches by date:

Previous
From: Darko Prenosil
Date:
Subject: Fwd: Updated /src/backend/po/hr.po
Next
From: Peter Eisentraut
Date:
Subject: Re: pg_dump --table=* dumps nothing?