| From: | Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> |
|---|---|
| To: | egil(at)wp(dot)pl, pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Subject: | Re: BUG #19927: PostgreSQL 16: SQL dump adds experimental/incompatible options like \restrict |
| Date: | 2026-11-20 15:29:04 |
| Message-ID: | aa19bdb25e015d876ac06ecb5af1e4da59808868.camel@cybertec.at |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On Fri, 2026-11-20 at 13:21 +0000, PG Bug reporting form wrote:
> Hi. I encountered a compatibility issue while restoring a plain SQL dump
> using PostgreSQL 16.
>
> Created sql dump on one machine with 16.15 and wanted to restore on test
> machine that happens to be on 16.3 at the moment.
>
> **Expected:**
>
> A plain SQL dump generated using PostgreSQL 16 tools should be restorable
> using compatible PostgreSQL 16 client tools without encountering unsupported
> psql meta-commands.
>
> **Actual:**
>
> The restore process encounters `\restrict`, which PostgreSQL 16.3 `psql`
> does not recognise, and terminates with a non-zero exit code.
>
> **Workarounds?**
>
> If there is a workaround I would be interested. For procedural reasons we
> cannot upgrade all servers at once, but also might need to move clients
> around.
>
> 1. Is there any supported option to prevent `\restrict` and `\unrestrict`
> from appearing in plain SQL dumps?
> 2. What is the recommended way to ensure compatibility when generating and
> restoring plain SQL dumps?
What you are trying to do (downgrade) is not supported.
This is not a bug.
Update both servers to 16.16.
Don't try to tell me that you couldn't schedule the few minutes down time
for a restart of the server since August 2024, when 16.4 was released.
If you insist on staying on 16.3, you'd have to edit the dump file and
remove those lines. They serve a security purpose - but if security were
a consideration for you, you wouldn't be on 16.3...
Yours,
Laurenz Albe
| From | Date | Subject | |
|---|---|---|---|
| Next Message | yuansong | 2026-11-20 15:37:56 | [PATCH v1] Fix stale composite type OIDs in cached PL/pgSQL expressions |
| Previous Message | David G. Johnston | 2026-11-20 15:27:57 | Re: BUG #19927: PostgreSQL 16: SQL dump adds experimental/incompatible options like \restrict |