Tighten pg_restore's recognition of its -F (format) option values.
Tom Lane <tgl@sss.pgh.pa.us>
Tighten pg_restore's recognition of its -F (format) option values.
Instead of checking just the first letter, match the whole string
using pg_strcasecmp. Per the documentation, we allow either just
the first letter (e.g. "c") or the whole name ("custom"); but we
will no longer accept random variations such as "chump". This
matches pg_dump's longstanding parsing code for the same option.
Also for consistency with pg_dump, recognize "p"/"plain". We don't
support it, but we can give a more helpful error message than
"unrecognized archive format".
Author: Srinath Reddy <srinath2133@gmail.com>
Discussion: https://postgr.es/m/CAFC+b6pfK-BGcWW1kQmtxVrCh-JGjB2X02rLPQs_ZFaDGjZDsQ@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/pg_dump/pg_restore.c | modified | +17 −19 |
Discussion
- why -Fdance archive format option works with ./pg_restore but not with ./pg_dump? 11 messages · 2025-01-23 → 2025-01-25