pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid harmless warning from pg_dump --if-exists mode.
Date: Fri, 20 Jan 2023 00:33:05 +0000
Message-ID: <E1pIfL6-004XNL-Sb@gemulon.postgresql.org> (raw)

Avoid harmless warning from pg_dump --if-exists mode.

If the public schema has a non-default owner (perhaps due to
dropping and recreating it) then use of pg_dump's "--if-exists"
option results in a warning message:

warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it"

This is harmless since the dump output is the same either way,
but nonetheless it's undesirable.  It's the fault of commit
a7a7be1f2, which created situations where a TOC entry's "defn"
or "dropStmt" fields could be just comments.  Although that
commit fixed up the kluges in pg_backup_archiver.c that munge defn
strings, it missed doing so for the one that munges dropStmts.

Per bug# 17753 from Justin Zhang.

Discussion: https://postgr.es/m/17753-9c8773631747ee1c@postgresql.org

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/488e89bf725a3b4a1caf9e3e82ae6e75e914d123

Modified Files
--------------
src/bin/pg_dump/pg_backup_archiver.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1pIfL6-004XNL-Sb@gemulon.postgresql.org>
Permalink:  ../E1pIfL6-004XNL-Sb@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pIfL6-004XNL-Sb@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Avoid harmless warning from pg_dump --if-exists mode.
  In-Reply-To: <E1pIfL6-004XNL-Sb@gemulon.postgresql.org>
  References: <E1pIfL6-004XNL-Sb@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox