BUG #17753: pg_dump --if-exists bug - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #17753: pg_dump --if-exists bug
Date
Msg-id 17753-9c8773631747ee1c@postgresql.org
Whole thread Raw
Responses Re: BUG #17753: pg_dump --if-exists bug  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      17753
Logged by:          Justin Zhang
Email address:      justin@tonic.ai
PostgreSQL version: 15.1
Operating system:   MacOS 12.6
Description:

Running pg_dump with the options "--section=pre-data --no-owner
--no-privileges --no-subscriptions --no-publications --clean --if-exists
--file=/Users/ju5tinz/Dev/pg_pass_test/pre_data.sql" prints the warning: 
pg_dump: warning: could not find where to insert IF EXISTS in statement "--
*not* dropping schema, since initdb creates it
"

Seems like pg_dump is trying to add the IF EXISTS operator to a comment
because of the --if-exists option. Tested this in v14 and the warning does
not appear. Also, the sql file is generated successfully.


pgsql-bugs by date:

Previous
From: "Sam.Mesh"
Date:
Subject: Re: index not used for bigint without explicit cast
Next
From: Noah Misch
Date:
Subject: Re: index not used for bigint without explicit cast