Example Test Case:
psql
create database aaa;
\c aaa
create table t1(akey int);
insert into t1 VALUES(1);
\q
-- example generates exit code 1 for pg_restore when creating public schema
pg_dump -d aaa -p 6432 -C -c --if-exists -Fc -v -w -f ./db.dump
pg_restore -d postgres -p 6432 -C -c --if-exists -Fc -v ./db.dump
-- generate listing
pg_restore -C -c --if-exists -Fc -v -l db.dump > db.list
-- generate output commands (no db provided)
pg_restore -C -c --if-exists -Fc -v -L db.list db.dump
-- execute using the list: generates same exit code 1 when attempting to
create public schema
pg_restore -C -c --if-exists -Fc -v -L db.list db.dump -d postgres
> Michael Paquier <mailto:michael.paquier@gmail.com>
> Monday, December 7, 2015 7:06 PM
>
>
>
> If you think this is a bug, could you send a test case? There is not
> enough information regarding what you expect of pg_restore and what it
> is currently doing.
> --
> Michael