pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: JORGE MALDONADO <jorgemal1960@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Backing up a DB excluding certain tables
Date: Tue, 26 Apr 2022 14:43:13 -0400
Message-ID: <252494.1650998593@sss.pgh.pa.us> (raw)
In-Reply-To: <CAAY=A7-=_1xyODtD4QMhZQDek2BqP8krFZ8mAGxStDX_F6_LZA@mail.gmail.com>
References: <CAAY=A7-=_1xyODtD4QMhZQDek2BqP8krFZ8mAGxStDX_F6_LZA@mail.gmail.com>

JORGE MALDONADO <jorgemal1960@gmail.com> writes:
> I am using *pg_dump* to backup a DB but I would like to exclude some tables
> so I added the *-T* switch with a pattern like this: *aspnet*.**. The
> backup command  includes the *-s* switch to consider the schema only
> because I do not need the data. However, even with the *-T* switch, the
> tables with the above pattern are created and I also want to exclude their
> creation. Is this possible? Or maybe I am not setting the pattern
> correctly. This is the command I am issuing:

> pg_dump -E win1252 -f c:/temp/respaldo.backup -F p -n riopoderoso -h
> localhost -p 5432 -U postgres -W -T aspnet*.* -s riopoderoso

"-n riopoderoso" is already restricting the dump to objects in
schema riopoderoso, so it doesn't look to me like that -T switch
is going to change anything.

I suspect the problem is somewhere else in your process.  Maybe
you are restoring the backup into a database that isn't empty,
but already contains the aspnet*.* tables?

			regards, tom lane





view thread (21+ messages)  latest in thread

Message-ID: <252494.1650998593@sss.pgh.pa.us>
Permalink:  ../252494.1650998593@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/252494.1650998593@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jorgemal1960@gmail.com
  Subject: Re: Backing up a DB excluding certain tables
  In-Reply-To: <252494.1650998593@sss.pgh.pa.us>
  References: <CAAY=A7-=_1xyODtD4QMhZQDek2BqP8krFZ8mAGxStDX_F6_LZA@mail.gmail.com> <252494.1650998593@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox