Обсуждение: backup question
Hello Postgres Gurus,
I have a restore problem.
If you do the backup as a text file:
pg_dump.exe -i -h machine -p 5432 -U postgres -F p -v -f "C:\dbname_text.dump.backup" dbname
You can see the order in which the restore will happen. And the restore seems to be happening in the following order
create objects (objects named in descending order of schema name.tablename), adam.table is created before public.table
populate objects (objects named in descending order of schema name.tablename), adam.table is populated before public.table
grant privs to objects (objects named in descending order of schema name.tablename) adam.table is granted privs to before public.table
The problem arises, if data in lets say the adam schema is dependent on tables in the public schema, since the data in the public schema does not exist yet, being created later.
If there was an option to do a backup and restore of a single schema, that would solve my problem.
Has anyone dealt with this issue before? Any workarounds?
Thank you,
Sincerely,
Kasia
Kasia Tuszynska <ktuszynska@esri.com> writes: > The problem arises, if data in lets say the adam schema is dependent on tables in the public schema, since the data inthe public schema does not exist yet, being created later. That's not supposed to happen. Are you possibly running an early 8.3 release? pg_dump 8.3.0-5 had a problem with user-defined operator classes that could cause misordering of the output. If it's not that, we'll need a lot more information. BTW, the -i switch is dangerous. Don't use it as a routine measure. regards, tom lane