Re: backup solo de algunas tuplas

From: Lenin Hernández <leninmhs(at)gmail(dot)com>
To: Miguel Angel Hernandez Moreno <miguel(dot)hdz(dot)mrn(at)gmail(dot)com>
Cc: Arcel Labrada Batista <alabradab(at)uci(dot)cu>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: backup solo de algunas tuplas
Date: 2011-06-23 15:28:12
Message-ID: BANLkTimCtRkL2SOwXmFiAyWK8VfR94zBxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

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".

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Álvaro Hernández Tortosa 2011-06-23 15:49:14 Re: backup solo de algunas tuplas
Previous Message Arcel Labrada Batista 2011-06-23 15:02:19 Re: backup solo de algunas tuplas