Re: pgsql: Allow db.schema.table patterns, but complain about random garbag

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Robert Haas <rhaas(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Allow db.schema.table patterns, but complain about random garbag
Date: 2022-04-22 13:15:31
Message-ID: 3a190754-b2b0-d02b-dcfd-4ec1610ffbcb@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers


On 2022-04-20 We 11:52, Robert Haas wrote:
> Allow db.schema.table patterns, but complain about random garbage.
>
> psql, pg_dump, and pg_amcheck share code to process object name
> patterns like 'foo*.bar*' to match all tables with names starting in
> 'bar' that are in schemas starting with 'foo'. Before v14, any number
> of extra name parts were silently ignored, so a command line '\d
> foo.bar.baz.bletch.quux' was interpreted as '\d bletch.quux'. In v14,
> as a result of commit 2c8726c4b0a496608919d1f78a5abc8c9b6e0868, we
> instead treated this as a request for table quux in a schema named
> 'foo.bar.baz.bletch'. That caused problems for people like Justin
> Pryzby who were accustomed to copying strings of the form
> db.schema.table from messages generated by PostgreSQL itself and using
> them as arguments to \d.
>
> Accordingly, revise things so that if an object name pattern contains
> more parts than we're expecting, we throw an error, unless there's
> exactly one extra part and it matches the current database name.
> That way, thisdb.myschema.mytable is accepted as meaning just
> myschema.mytable, but otherdb.myschema.mytable is an error, and so
> is some.random.garbage.myschema.mytable.

This has upset the buildfarm's msys2 animals. There appears to be some
wildcard expansion going on that causes the problem. I don't know why it
should here when it's not causing trouble elsewhere. I have tried
changing the way the tests are quoted, without success. Likewise,
setting SHELLOPTS=noglob didn't work.

At this stage I'm fresh out of ideas to fix it. It's also quite possible
that my diagnosis is wrong.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2022-04-22 14:04:05 Re: pgsql: Allow db.schema.table patterns, but complain about random garbag
Previous Message Peter Eisentraut 2022-04-22 09:25:17 pgsql: doc: Add links to tables

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2022-04-22 13:37:16 Re: pg_walcleaner - new tool to detect, archive and delete the unneeded wal files (was Re: pg_archivecleanup - add the ability to detect, archive and delete the unneeded wal files on the primary)
Previous Message Amul Sul 2022-04-22 12:26:40 Re: Proposal for internal Numeric to Uint64 conversion function.