Search Postgresql Archives

pg_dump vs schemas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



pg_dump by default puts at the top SET search_path = public,pg_catalog;

This considering a plain vanilla setup where no schemas other than public have been created.

I however noticed that pg_dump also does this:
ALTER TABLE public.mytable OWNER TO pgsql;

Shouldn't the "public." be left out?
I verified that even if multiple tables exist with the same name only the table in the first referenced schema in the path will be deleted.

By the same token shouldn't all references to schemas be left out?
In the case there are reasons why the schema is referenced, perhaps create a parameter in pg_dump to omit the schema.

The rationale is to be able to easily move schemas in the target restore.
Specially if one was doing an entire database.

Alternatively is there any easy way to take all data in one schema and load it into a target DB and a different schema? The default produced by pg_dump would be a problem because of the "schema." references.


As for why I am doing this schema move..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux