pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_restore: warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it
3+ messages / 2 participants
[nested] [flat]

* pg_restore: warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it
@ 2023-02-17 11:21 Samo Dadela <samo.dadela@gmail.com>
  2023-02-17 18:23 ` Re: pg_restore: warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Samo Dadela @ 2023-02-17 11:21 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org

Hi,

Can you please take a look at the following?

It's just a warning - the restore succeeded anyway.

pg_restore is emitting the following:

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

The restore is done with:
pg_restore --username=user --host=localhost --port=5432 --dbname=db3
--format=d db-3.20230217102426/db3.pg_dump --clean --if-exists

The backup was done with:
pg_dump --username=user --host=db-3.com --port=5432 --dbname=db3
--file=db-3.20230217102426/db3.pg_dump --format=d --clean --if-exists
--no-blobs --jobs=4 --verbose

It seems that the string pg_restore complains about is created by
db_restore. I suspect pg_restore wrongly parsed the comment as a
statement that should be prefixed with IF EXISTS.

# pg_restore --version
pg_restore (PostgreSQL) 15.1
# pg_dump --version
pg_dump (PostgreSQL) 15.1
# uname -a
Linux aura 6.0.19-4-MANJARO #1 SMP PREEMPT_DYNAMIC Mon Feb 6 11:26:13 UTC
2023 x86_64 GNU/Linux


Best regards,

Samo

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pg_restore: warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it
  2023-02-17 11:21 pg_restore: warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it Samo Dadela <samo.dadela@gmail.com>
@ 2023-02-17 18:23 ` Tom Lane <tgl@sss.pgh.pa.us>
  2023-02-22 09:04   ` Re: pg_restore: warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it Samo Dadela <samo.dadela@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2023-02-17 18:23 UTC (permalink / raw)
  To: Samo Dadela <samo.dadela@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org

Samo Dadela <samo.dadela@gmail.com> writes:
> Can you please take a look at the following?

> It's just a warning - the restore succeeded anyway.

> pg_restore is emitting the following:

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

This was reported already, and is fixed in 15.2.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pg_restore: warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it
  2023-02-17 11:21 pg_restore: warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it Samo Dadela <samo.dadela@gmail.com>
  2023-02-17 18:23 ` Re: pg_restore: warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it Tom Lane <tgl@sss.pgh.pa.us>
@ 2023-02-22 09:04   ` Samo Dadela <samo.dadela@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Samo Dadela @ 2023-02-22 09:04 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org

Thanks!

On Fri, Feb 17, 2023 at 7:23 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Samo Dadela <samo.dadela@gmail.com> writes:
> > Can you please take a look at the following?
>
> > It's just a warning - the restore succeeded anyway.
>
> > pg_restore is emitting the following:
>
> > pg_restore: warning: could not find where to insert IF EXISTS in
> statement
> > "-- *not* dropping schema, since initdb creates it
>
> This was reported already, and is fixed in 15.2.
>
>                         regards, tom lane
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2023-02-22 09:04 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-02-17 11:21 pg_restore: warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it Samo Dadela <samo.dadela@gmail.com>
2023-02-17 18:23 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-02-22 09:04   ` Samo Dadela <samo.dadela@gmail.com>

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