pg_dump --table=* dumps nothing?

From: David Walter <dwalter(at)syr(dot)edu>
To: pgsql-patches(at)postgresql(dot)org
Subject: pg_dump --table=* dumps nothing?
Date: 2003-10-01 13:23:10
Message-ID: 87isn9nlc1.fsf@syr.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)syr(dot)edu>
fingerprint = 50A0 E513 732D 1D0F BD26 C84E A8DD 9D80 DC92 AE30
sub 2048g/51023582 2002-02-26

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2003-10-01 20:03:44 initdb
Previous Message Neil Conway 2003-10-01 00:00:22 introduce "default_use_oids"