pg_dump -n schema -Fc has a DROP DATABASE command... confused

From: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: pg_dump -n schema -Fc has a DROP DATABASE command... confused
Date: 2022-01-21 04:44:26
Message-ID: CAOC+FBWrBPQOeL5_BXL2Xypr9aoJ56fbLsusyM7GU=5nXXaB_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I did a few pg_dumps of different schemas using:

pg_dump -h host dbname -n schema -Fc > schema.dump

Opening it in VIM brings up a binary file (compressed, sure) but it looks
like this:

[image: Screen Shot 2022-01-20 at 8.40.24 PM.png]

Which contains the line "DROP DATABASE". Which is weird-- it does not drop
the database, I mean, I restored from the same file. Why is this in there?

Doing a text dump w/o -Fc yields a text file with no DROP statement.

More just curious, less afraid at this point.

--
Wells Oliver
wells(dot)oliver(at)gmail(dot)com <wellsoliver(at)gmail(dot)com>

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2022-01-21 04:57:21 Re: pg_dump -n schema -Fc has a DROP DATABASE command... confused
Previous Message Khushboo Vashi 2022-01-21 04:31:32 Re: PGAdmin - psql tool issue