Re: Why is pg_restore trying to create tables in pg_catalog?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Seamus Abshere <seamus(at)abshere(dot)net>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why is pg_restore trying to create tables in pg_catalog?
Date: 2014-04-04 15:58:10
Message-ID: 19003.1396627090@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Seamus Abshere <seamus(at)abshere(dot)net> writes:
> Why is pg_restore trying to put stuff into the pg_catalog schema of all
> places?

Hm ... does myschema actually exist in the target database? If it
doesn't, and the dump file doesn't include a command to create it,
this is what you'll get. That's because what pg_dump emits is

SET search_path = myschema, pg_catalog;
CREATE TABLE ...

and at the moment, if myschema doesn't exist, the creation target
devolves to pg_catalog. This is not terribly elegant but I'm not
sure if there's consensus to change it.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2014-04-04 16:04:01 Re: SSD Drives
Previous Message Seamus Abshere 2014-04-04 15:38:20 Why is pg_restore trying to create tables in pg_catalog?