pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Mahendra Singh Thalor <mahi6run@gmail.com>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix small memory leak in get_dbname_oid_list_from_mfile().
Date: Mon, 16 Mar 2026 12:47:28 -0400
Message-ID: <35967.1773679648@sss.pgh.pa.us> (raw)
In-Reply-To: <202603161539.zldv3z456gn4@alvherre.pgsql>
References: <202603161539.zldv3z456gn4@alvherre.pgsql>

=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:
> On 2026-Mar-16, Mahendra Singh Thalor wrote:
>> We were trimming slashes due to the below test case.
>> 
>> *Ex:*
>> ./pg_dumpall -f dumpdir --format=d
>> 
>> ./pg_restore *dumpdir/ *-d postgres -C --format=d --verbose
>> pg_restore: found database "template1" (OID: 1) in file "*dumpdir//map.dat*"
>> pg_restore: found database "postgres" (OID: 5) in file "*dumpdir//map.dat*"
>> pg_restore: found 2 database names in "map.dat"
>> pg_restore: need to restore 2 databases out of 2 databases
>> 
>> Here, before map.dat, there were 2 slashes so we were trimming slashes.
>> Please add your opinion for this output.

> I think this is perfectly fine.  Two slashes work correctly, and many
> other tools behave this way when given redundant slashes.  If the user
> doesn't want to see the redundant slashes, they can just not specify a
> trailing slash in the argument value.

As I said in my commit message, if we wanted to do something about
this the correct thing would be to apply canonicalize_path to the
constructed strings.  On Unix systems that's really just cosmetic, as
Alvaro says.  But if memory serves it's not necessarily so on Windows.
Has anyone tested this patch on Windows, with Windows peculiarities
like using backslash separators in the given path?

			regards, tom lane





view thread (4+ messages)

Message-ID: <35967.1773679648@sss.pgh.pa.us>
Permalink:  ../35967.1773679648@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/35967.1773679648@sss.pgh.pa.us

 · 

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: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@kurilemu.de, mahi6run@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix small memory leak in get_dbname_oid_list_from_mfile().
  In-Reply-To: <35967.1773679648@sss.pgh.pa.us>

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

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