Tom Lane schrieb am 08.01.2018 um 17:04:
>> There was a left over pipe symbol in the script that we didn't see:
>
>> pg_dump --table=l10n --table=l10n_value --clean ${db_stag} |
>> psql --single-transaction --dbname=${db_prod} --file=${backup_stag}
>
>> So pg_dump pipes a script with DROP statement into psql, which then
>> runs essentially the same script again which was created in a previous step (also with --clean)
>
> Hm, but if psql is restoring into a different database than pg_dump
> is dumping from, I don't see how they'd interact?
Yes, put psql is running the restore script (created with --clean) *twice*:
once because of the pipe and a second time because of the --file argument