La opcion -t en el pg_dump creo es lo que andas buscando, con ella haces el
respaldo de una o varias tablas segun indiques o las tablas que quieras
excluir: te pongo la referencia de: $man pg_dump


     --table=table
              Dump only tables (or views or sequences) matching table.
Multiple tables can be selected by writing multiple  -t  switches.
              Also,  the table parameter is interpreted as a pattern
according to the same rules used by psql's \d commands (see Patterns
              [psql(1)]), so multiple tables can also be selected by writing
wildcard characters in the pattern. When using wildcards, be
              careful to quote the pattern if needed to prevent the shell
from expanding the wildcards.

              The  -n  and  -N  switches have no effect when -t is used,
because tables selected by -t will be dumped regardless of those
              switches, and non-table objects will not be dumped.

              Note: When -t is specified, pg_dump makes no attempt to dump
any other database objects that the  selected  table(s)  might
              depend  upon.  Therefore,  there  is no guarantee that the
results of a specific-table dump can be successfully restored by
              themselves into a clean database.

              Note: The behavior of the -t switch is not entirely upward
compatible with pre-8.2 PostgreSQL versions.  Formerly,  writing
              -t  tab would dump all tables named tab, but now it just dumps
whichever one is visible in your default search path. To get
              the old behavior you can write -t '*.tab'. Also, you must
write something like -t sch.tab to select a table in a particular
              schema, rather than the old locution of -n sch -t tab.

       -T table

       --exclude-table=table
              Do  not  dump  any tables matching the table pattern. The
pattern is interpreted according to the same rules as for -t.  -T
              can be given more than once to exclude tables matching any of
several patterns.

              When both -t and -T are given, the behavior is to dump just
the tables that  match  at  least  one  -t  switch  but  no  -T
              switches. If -T appears without -t, then tables matching -T
are excluded from what is otherwise a normal dump.



Saludos'''


-- 
Lenin Hernández
Twitter: @leninmhs <http://twitter.com/#%21/leninmhs>
2.6.32 on Debian Wheezy
CUCLUG.: "no hay nada mejor, que hacer lo que realmente te gusta".
Linus Tordvalds.: "If it compiles, it is good, if it boots up it is
perfect".

Responder a