Re: Backing up a DB excluding certain tables

From: JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Backing up a DB excluding certain tables
Date: 2022-05-03 17:26:56
Message-ID: CAAY=A7-ZEBGsg8hr7cqOxuoZ76bAAH9Qc2MVAhvM1ve8HemVzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I included the space in chcp 1252, it was a typo in the last message I sent.
This is what I just did as per your suggestion in a command prompt with
Lucida Console font.

C:\Users\JorgeMal>chcp
Active code page: 437

C:\Users\JorgeMal>cmd.exe /c chcp 1252
Active code page: 1252

C:\Users\JorgeMal>chcp
Active code page: 1252

C:\Users\JorgeMal>cd "C:\Program Files\PostgreSQL\14\bin"

C:\Program Files\PostgreSQL\14\bin>pg_dump -E win1252 -f
c:/temp/respaldo.backup -n riopoderoso -F p -h localhost -p 5433 -U
postgres -W -s --exclude-table *.AspNet* riopoderoso
Password:

C:\Program Files\PostgreSQL\14\bin>chcp
Active code page: 1252

C:\Program Files\PostgreSQL\14\bin>pg_dump -E win1252 -f
c:/temp/respaldo.backup -n riopoderoso -F p -h localhost -p 5433 -U
postgres -W -s --exclude-table '*.AspNet*' riopoderoso
Password:

C:\Program Files\PostgreSQL\14\bin>pg_dump -E win1252 -f
c:/temp/respaldo.backup -n riopoderoso -F p -h localhost -p 5433 -U
postgres -W -s --exclude-table '*."AspNet"*' riopoderoso
Password:

C:\Program Files\PostgreSQL\14\bin>pg_dump -f c:/temp/respaldo.backup -n
riopoderoso -F p -h localhost -p 5433 -U postgres -W -s --exclude-table
'*."AspNet"*' riopoderoso
Password:

C:\Program Files\PostgreSQL\14\bin>pg_dump -f c:/temp/respaldo.backup -n
riopoderoso -F p -h localhost -p 5433 -U postgres -W -s --exclude-table
'*."AspNet"'* riopoderoso
Password:

The result always included tables with *AspNet* in the name.

Regards,
Jorge Maldonado

On Tue, May 3, 2022 at 9:47 AM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 5/3/22 09:10, JORGE MALDONADO wrote:
> > Hi,
> >
> > I tried the suggestion in the "*Notes for Windows Users*" which
> > recommends the following:
> >
>
> >
> > The first suggestion says that 1252 is the code page for German.
> > However, I used it because that is the code the DB was created with.
> > When I ran the *cmd.exe /c chcp1252* command, nothing appeared on screen
> > but it looked like something was done. So I ran the command without the
> > */c* argument so the console window remained open. Then I changed the
>
> If you do in a console window:
>
> chcp
> cmd.exe /c chcp 1252 --It should be this not chcp1252
> chcp
>
> You should see the value returned by chcp change from 437 to 1252 with
> the window staying open. chcp without an argument will only display the
> current code page number.
>
> Not sure what '...so the console window remained open.' means?
> Did running cmd.exe close the console window?
> If so how did you get to the console(command prompt)?
>
>
>
> > font to *Lucida Console* and ran the *pg_dump* command with different
> > combinations in the *--exclude-table* argument without success.
> >
> > * --exclude-table *.AspNet*
> > * --exclude-table '*."AspNet"*'
> > * --exclude-table '*."AspNet*"'
> > * --exclude-table'*."AspNet*"'
> >
> >
> ------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zheng Li 2022-05-03 21:30:20 Re: Support logical replication of DDLs
Previous Message Adrian Klaver 2022-05-03 17:12:43 Re: Backing up a DB excluding certain tables