pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #18453: --exclude-database has problems with capital letters
4+ messages / 4 participants
[nested] [flat]

* BUG #18453: --exclude-database has problems with capital letters
@ 2024-04-30 23:28 PG Bug reporting form <noreply@postgresql.org>
  2024-05-01 00:09 ` Re: BUG #18453: --exclude-database has problems with capital letters David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: PG Bug reporting form @ 2024-04-30 23:28 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: jernej-s31+pg@simoncic.si

The following bug has been logged on the website:

Bug reference:      18453
Logged by:          Jernej Simončič
Email address:      jernej-s31+pg@simoncic.si
PostgreSQL version: 16.2
Operating system:   Windows Server 2022
Description:        

I've got a database named Lidar, which I want to exclude from being dumped
with pg_dumpall. When I use the following command, the database is not
skipped:

"C:\Program Files\PostgreSQL\16\bin\pg_dumpall.exe"
--exclude-database="Lidar" -U postgres > D:\dumps\pg.dump

If I instead use --exclude-database="?idar", the database is skipped as
expected (using "lidar" instead of "Lidar" also doesn't skip the database).



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #18453: --exclude-database has problems with capital letters
  2024-04-30 23:28 BUG #18453: --exclude-database has problems with capital letters PG Bug reporting form <noreply@postgresql.org>
@ 2024-05-01 00:09 ` David G. Johnston <david.g.johnston@gmail.com>
  2024-05-01 00:31   ` Re: BUG #18453: --exclude-database has problems with capital letters Tom Lane <tgl@sss.pgh.pa.us>
  2024-05-01 11:12   ` Re: BUG #18453: --exclude-database has problems with capital letters Jernej Simončič <jernej-s31+pg@simoncic.si>
  0 siblings, 2 replies; 4+ messages in thread

From: David G. Johnston @ 2024-05-01 00:09 UTC (permalink / raw)
  To: jernej-s31+pg@simoncic.si <jernej-s31+pg@simoncic.si>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

On Tuesday, April 30, 2024, PG Bug reporting form <noreply@postgresql.org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference:      18453
> Logged by:          Jernej Simončič
> Email address:      jernej-s31+pg@simoncic.si
> PostgreSQL version: 16.2
> Operating system:   Windows Server 2022
> Description:
>
> I've got a database named Lidar, which I want to exclude from being dumped
> with pg_dumpall. When I use the following command, the database is not
> skipped:
>
> "C:\Program Files\PostgreSQL\16\bin\pg_dumpall.exe"
> --exclude-database="Lidar" -U postgres > D:\dumps\pg.dump
>
> If I instead use --exclude-database="?idar", the database is skipped as
> expected (using "lidar" instead of "Lidar" also doesn't skip the database).
>
>
There is no bug here.  The pattern specified doesn’t quote the identifier
so it is folded to lowercase.

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

You will need to deal with getting quotes into the pattern while dealing
with the fact your OS uses quotes for its own purpose.

David J.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #18453: --exclude-database has problems with capital letters
  2024-04-30 23:28 BUG #18453: --exclude-database has problems with capital letters PG Bug reporting form <noreply@postgresql.org>
  2024-05-01 00:09 ` Re: BUG #18453: --exclude-database has problems with capital letters David G. Johnston <david.g.johnston@gmail.com>
@ 2024-05-01 00:31   ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 4+ messages in thread

From: Tom Lane @ 2024-05-01 00:31 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: jernej-s31+pg@simoncic.si <jernej-s31+pg@simoncic.si>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tuesday, April 30, 2024, PG Bug reporting form <noreply@postgresql.org>
> wrote:
>> I've got a database named Lidar, which I want to exclude from being dumped
>> with pg_dumpall. When I use the following command, the database is not
>> skipped:
>> "C:\Program Files\PostgreSQL\16\bin\pg_dumpall.exe"
>> --exclude-database="Lidar" -U postgres > D:\dumps\pg.dump

> You will need to deal with getting quotes into the pattern while dealing
> with the fact your OS uses quotes for its own purpose.

Yeah.  In a Unix shell something like
	'--exclude-database="Lidar"'
would work, but I'm not up on the quoting rules under Windows.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #18453: --exclude-database has problems with capital letters
  2024-04-30 23:28 BUG #18453: --exclude-database has problems with capital letters PG Bug reporting form <noreply@postgresql.org>
  2024-05-01 00:09 ` Re: BUG #18453: --exclude-database has problems with capital letters David G. Johnston <david.g.johnston@gmail.com>
@ 2024-05-01 11:12   ` Jernej Simončič <jernej-s31+pg@simoncic.si>
  1 sibling, 0 replies; 4+ messages in thread

From: Jernej Simončič @ 2024-05-01 11:12 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

On sreda, 01. maj 2024, 02:09:29, David G. Johnston wrote:

> There is no bug here.  The pattern specified doesn’t quote the identifier so it is folded to lowercase.

Ah, I missed that pattern is folded to lower-case.
 
> You will need to deal with getting quotes into the pattern while dealing with the fact your OS uses quotes for its own purpose.

On Windows the program itself deals with splitting the command line to arguments – Windows just passes everything as a single string (though the C library does abstract this away, so in this case --exclude-database="\"Lidar\"" or even --exclude-database=\"Lidar\" works).
 
-- 
< Jernej Simončič ><><><><><><><><><><><>< https://eternallybored.org/ ;






^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2024-05-01 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-04-30 23:28 BUG #18453: --exclude-database has problems with capital letters PG Bug reporting form <noreply@postgresql.org>
2024-05-01 00:09 ` David G. Johnston <david.g.johnston@gmail.com>
2024-05-01 00:31   ` Tom Lane <tgl@sss.pgh.pa.us>
2024-05-01 11:12   ` Jernej Simončič <jernej-s31+pg@simoncic.si>

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