Re: pgsql: Fix small memory leak in get_dbname_oid_list_from_mfile().

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Fix small memory leak in get_dbname_oid_list_from_mfile().
Date: 2026-03-16 15:48:04
Message-ID: 202603161539.zldv3z456gn4@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"¿Cómo puedes confiar en algo que pagas y que no ves,
y no confiar en algo que te dan y te lo muestran?" (Germán Poo)

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Bertrand Drouvot 2026-03-16 15:52:59 Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals)
Previous Message Peter Eisentraut 2026-03-16 15:28:49 pgsql: Make some tests more stable by adding more explicit ordering