Re: Backing up a DB excluding certain tables - Mailing list pgsql-general

From JORGE MALDONADO
Subject Re: Backing up a DB excluding certain tables
Date
Msg-id CAAY=A7-FyONfqAF+Bc7=bk=jPL142p1FLf6J7f4K7aGO4x1o6A@mail.gmail.com
Whole thread Raw
In response to Re: Backing up a DB excluding certain tables  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Backing up a DB excluding certain tables  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: Backing up a DB excluding certain tables  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Good day,

Here is the output to commands suggested by Adrian Klaver. Encoding is the same in both client and server. Also, there are 7 tables I want to exclude.
image.png
The version of source DB is 11, and target version is 14.

Regarding the following comment:

FYI, -n riopoderoso and the riopoderoso in
'riopoderoso."AspNetRoleClaims"' are redundant.

Should I remove the schema name so the exclude switch is -T "AspNet" instead of -T 'riopoderoso."AspNet"'?

I have tried -T 'riopoderoso."Asp*"',  -T 'riopoderoso."Asp"*',  -T '"Asp"*',  -T "Asp"*' and several other combinations unsuccessfully. Also, I have escaped double quotes, single quotes and both at the same time using the ^ character as documented in several sources.

The command is issued using the command prompt in Windows 10.
image.png

The pg_dump command is included in a batch file which basically does the following. These are the only lines in the batch file:

image.png
After all the tests I have performed, it looks that there is a good chance that the problem has to do with the shell, the command prompt in this case.
Can I run the pg_dump command in psql? I rarely use psql.

Regards,
Jorge Maldonado

On Wed, Apr 27, 2022 at 6:19 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 4/27/22 15:45, JORGE MALDONADO wrote:
> Is this the correct way to answer when you say that I must *keep the
> list cc'd*? I am not sure if I only have to reply to the
> *pgsql-general@lists.postgresql.org
> <mailto:pgsql-general@lists.postgresql.org>* list or also include
> individual emails like yours and Adrian's.
>
> I have tried many ways to make this pg_dump command work without
> success. I just do not know what is going on. The last test I performed
> was as follows which only excludes 1 table in the *riopoderoso* schema
> but it did not work. Such a table is included in the resulting backup
> plain format file.
>
> *pg_dump -E win1252 -f c:/temp/respaldo.backup -n riopoderoso -F p -h
> localhost -p 5432 -U postgres -W -s -T 'riopoderoso."AspNetRoleClaims"'
> riopoderoso*

Using the command line client psql what does:

show client_encoding ;
show server_encoding ;

return?

Also in psql what does:

\dt riopoderoso."Asp"*

return?


FYI, -n riopoderoso and the riopoderoso in
'riopoderoso."AspNetRoleClaims"' are redundant.

>
> If there are any additional comments please let me know. I will keep
> trying. It is important to exclude these tables because they are created
> and managed by other means. Such tables are part of the authentication
> feature included in ASP.NET <http://ASP.NET> Core.
>
> With respect,
> Jorge Maldonado
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com
Attachment

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Privilege error with c functions during postgresql upgrade from 11 -> 13
Next
From: Tom Lane
Date:
Subject: Re: int8range and index usage for <@ operator