Re: pg_dump: Exclude multiple tables in version 7.4 - Mailing list pgadmin-support

From Melvin Davidson
Subject Re: pg_dump: Exclude multiple tables in version 7.4
Date
Msg-id 2CC69F840555CB43B04195F218CCB57F9A0C7F@COENGEX01.cctus.com
Whole thread Raw
In response to pg_dump: Exclude multiple tables in version 7.4  (cha <chandresh.rana@metrixline.com>)
List 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

pgadmin-support by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: Re : pg_dump: ALTER SEQUENCE ... OWNED in 8.1
Next
From: Marcin Zajączkowski
Date:
Subject: Re: pgadmin 1.6.3 - segmentation fault