public inbox for [email protected]  
help / color / mirror / Atom feed
From: Magnus Hagander <[email protected]>
To: Pavel Stehule <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Cc: Daniel Gustafsson <[email protected]>
Subject: Re: pg_dump include/exclude fails to error
Date: Sun, 10 Mar 2024 19:20:35 +0100
Message-ID: <CABUevEzxEGaACznuP-FcrYm6HCpU=hotzYZUYyENZawOO_S3BA@mail.gmail.com> (raw)
In-Reply-To: <CAFj8pRBVC0urVkfu1Lh=zFUDSkWZ9ax7hFpg8pxKja6qc=poWw@mail.gmail.com>
References: <CABUevEwC9Q_kmHRC6c5D2PE18FDvqbp_ZZUk88o38WRuJxjzXA@mail.gmail.com>
	<CAFj8pRBVC0urVkfu1Lh=zFUDSkWZ9ax7hFpg8pxKja6qc=poWw@mail.gmail.com>

On Sun, Mar 10, 2024 at 4:51 PM Pavel Stehule <[email protected]> wrote:
>
> Hi
>
> ne 10. 3. 2024 v 15:23 odesílatel Magnus Hagander <[email protected]> napsal:
>>
>> When including tables with the new pg_dump functionality, it fails to
>> error out if a table is missing, but only if more than one table is
>> specified.
>>
>> E.g., if table foo exist, but not bar:
>>
>> pg_dump --table bar
>> pg_dump: error: no matching tables were found
>>
>> with file "myfilter" containing just "table bar"
>> pg_dump --filter myfilter
>> pg_dump: error: no matching tables were found
>>
>> with the file "myfilter" containing both "table foo" and "table bar"
>> (order doesn't matter):
>> <no error, but dump of course only contains foo>
>
>
> is not this expected behaviour (consistent with -t option)?
>
> (2024-03-10 16:48:07) postgres=# \dt
>         List of relations
> ┌────────┬──────┬───────┬───────┐
> │ Schema │ Name │ Type  │ Owner │
> ╞════════╪══════╪═══════╪═══════╡
> │ public │ foo  │ table │ pavel │
> └────────┴──────┴───────┴───────┘
> (1 row)
>
> pavel@nemesis:~/src/orafce$ /usr/local/pgsql/master/bin/pg_dump -t foo -t boo > /dev/null
> pavel@nemesis:~/src/orafce$
>
> if you want to raise error, you should to use option --strict-names.
>
> pavel@nemesis:~/src/orafce$ /usr/local/pgsql/master/bin/pg_dump -t foo -t boo --strict-names > /dev/null
> pg_dump: error: no matching tables were found for pattern "boo"

Hmpf, you're right. I guess I don't use multiple-dash-t often enough
:) So yeah, then I agree this is probably the right behaviour. Maybe
the docs for --filter deserves a specific mention about these rules
though, as it's going to be a lot more common to specify multiples
when using --filter?

-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/






view thread (2+ messages)

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: pg_dump include/exclude fails to error
  In-Reply-To: <CABUevEzxEGaACznuP-FcrYm6HCpU=hotzYZUYyENZawOO_S3BA@mail.gmail.com>

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

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