"Jan Cruz" <malebug@gmail.com> writes:
> On 2/24/06, Michael Glaesemann <grzm@myrealbox.com> wrote:
>> If this doesn't do what you want, can you give a bit more
>> explanation? Also, what are you trying to do with this dump file?
> I also want an option that would exclude "CREATE INDEX " whenever
> a schema is being dump
> The reason for this is that whenever I tried to migrate database
> whenever I restore a schema with indexes and then
> restore the data separately it took more or less 24 hours instead of
> the usual 1 hour more or less.
Restoring schema and data separately is guaranteed to be less efficient
than restoring a combined dump. An option to omit indexes from the
schema dump will not fix this. Indeed it will arguably make things
worse --- in the first place there are severe performance issues
associated with unindexed foreign-key checks, and in the second place
there is the foot-gun problem that you might forget to re-add the
indexes at all.
I think the right question to ask here is "why are you so intent on
using separate schema/data restores?" That's not the recommended way
to go about things, and it never will be.
regards, tom lane