Re: pg_dump negation regex

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Eudald Valcàrcel Lacasa <eudald(dot)valcarcel(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_dump negation regex
Date: 2020-05-07 17:36:38
Message-ID: 3e1c0334-dcbf-54d1-1d51-939acf1d826d@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5/7/20 9:53 AM, Eudald Valcàrcel Lacasa wrote:
> Hello!
> I've been looking at the documentation and there seems to be no keyword
> for negation purposes.
>
> Am I missing something? Or it's like this?

https://www.postgresql.org/docs/12/app-pgdump.html

-T pattern
--exclude-table=pattern

Do not dump any tables matching 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.

For what patterns you can use see:

https://www.postgresql.org/docs/12/app-psql.html#APP-PSQL-PATTERNS

>
> I'm trying to use pg_dump to create a database skeleton and I have
> tables like program_0, program_1, etc. And I'd like to dump all the
> tables but client_1 onwards.
>
> Does anybody happen to know a way to accomplish it?
>
> Thank you!
> Eudald

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Amarendra Konda 2020-05-07 17:49:18 Re: Explain plan changes - IN CLAUSE ( Passing direct values Vs INNER Query )
Previous Message Amarendra Konda 2020-05-07 17:36:02 Re: Explain plan changes - IN CLAUSE ( Passing direct values Vs INNER Query )