[PATCH] minor bug fix for pg_dump --clean

From: Frédéric Yhuel <frederic(dot)yhuel(at)dalibo(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] minor bug fix for pg_dump --clean
Date: 2022-09-01 07:13:10
Message-ID: b43e03eb-3997-700e-c2d4-92c31e4e31ee@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

When using pg_dump (or pg_restore) with option "--clean", there is some
SQL code to drop every objects at the beginning.

The DROP statement for a view involving circular dependencies is :

CREATE OR REPLACE VIEW [...]

(see commit message of d8c05aff for a much better explanation)

If the view is not in the "public" schema, and the target database is
empty, this statement fails, because the schema hasn't been created yet.

The attached patches are a TAP test which can be used to reproduce the
bug, and a proposed fix. They apply to the master branch.

Best regards,
Frédéric

Attachment Content-Type Size
0002-pg_dump-fix-up-d8c05aff.patch text/x-patch 1.8 KB
0001-Add-TAP-test-for-pg_restore.patch text/x-patch 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Drouvot, Bertrand 2022-09-01 07:16:35 Re: [PATCH] Query Jumbling for CALL and SET utility statements
Previous Message Pavel Stehule 2022-09-01 07:12:19 broken table formatting in psql