Re: pg_dump: Exclude multiple tables in version 7.4

From: "Melvin Davidson" <mdavidson(at)cctus(dot)com>
To: "cha" <chandresh(dot)rana(at)metrixline(dot)com>, <pgadmin-support(at)postgresql(dot)org>
Subject: Re: pg_dump: Exclude multiple tables in version 7.4
Date: 2007-06-19 14:32:59
Message-ID: 2CC69F840555CB43B04195F218CCB57F9A0C7F@COENGEX01.cctus.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

>I knw that I have to use include instead of excluding the tables.Do I
have to include each and
>>every tables manually or is there way to do that?

There's no guarantee. but the following query might be a
good starting point to build your include list.

It selects only tables with less than 3000 tuples
(naturally you will change the value to suit your needs.

Note that per the documenatation:
"This is only an estimate used by the planner.
It is updated by VACUUM, ANALYZE,
and a few DDL commands such as CREATE INDEX."

So a FULL VACUUM is advised before executing.

SELECT n.nspname || ' .' || c.relname AS tablename
FROM pg_class c
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN pg_tablespace t ON t.oid = c.reltablespace
WHERE c.relkind = 'r'::"char"
AND reltuples < 3000
ORDER BY n.nspname;

Melvin Davidson
Database Developer
Computer & Communication Technologies, Inc.
6 Inverness Court East, Suite 220
Englewood, CO 80112

Attachment Content-Type Size
Melvin Davidson.vcf text/x-vcard 407 bytes

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Laurent ROCHE 2007-06-19 16:13:34 Using many pg_dump in pgAdmin (aka Re : Re : pg_dump: ALTER SEQUENCE ... OWNED in 8.1)
Previous Message Raymond O'Donnell 2007-06-19 13:40:14 Re: Re : pg_dump: ALTER SEQUENCE ... OWNED in 8.1