Re: Non-text mode for pg_dumpall - Mailing list pgsql-hackers

From Dagfinn Ilmari Mannsåker
Subject Re: Non-text mode for pg_dumpall
Date
Msg-id 8734fj1mlq.fsf@wibble.ilmari.org
Whole thread Raw
In response to Re: Non-text mode for pg_dumpall  (Álvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Non-text mode for pg_dumpall
List pgsql-hackers
Álvaro Herrera <alvherre@alvh.no-ip.org> writes:

> Hello,
>
> On 2025-Mar-11, Mahendra Singh Thalor wrote:
>
>> In map.dat file, I tried to fix this issue by adding number of characters
>> in dbname but as per code comments, as of now, we are not supporting \n\r
>> in dbnames so i removed handling.
>> I will do some more study to fix this issue.
>
> Yeah, I think this is saying that you should not consider the contents
> of map.dat as a shell string.  After all, you're not going to _execute_
> that file via the shell.
>
> Maybe for map.dat you need to escape such characters somehow, so that
> they don't appear as literal newlines/carriage returns.

I haven't looked at the code for this, but why are we inventing an
ad-hoc file format?  Why not use JSON, like we do for backup manifests?
Then storing arbitrary database names won't be a problem.

- ilmari



pgsql-hackers by date:

Previous
From: "Devulapalli, Raghuveer"
Date:
Subject: RE: CRC32C Parallel Computation Optimization on ARM
Next
From: Andres Freund
Date:
Subject: Re: AIO v2.5