Home > Archive > PostgreSQL Administration > June 2005 > pg_dump -Fc does not dump indexes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author pg_dump -Fc does not dump indexes
Alberto

2005-06-28, 3:23 am

Hi everybody,
I have tried to backup my postgres database with
pg_dump -Fc $db > ~/backups/$db.backup.c
and restore it with:
createdb -U postgres -D aestel_admin -T template0 restoreTMP
pg_restore -d restoreTMP -U postgres $db.backup.c

I do not get any error messages but none of my indexes are created. None
of the primary key or foreign key constraint are created. However simple
check constraints are created.

Using the -v flag does not show any index creation.

Using the -l option to list the commands does not show any indexes either.
pg_restore -lv -U postgres $db.backup.c

pg_dump -vFc does produce lines like:
pg_dump: reading indexes for table " acc_controlled_expre
ssion"

If I do not use the -Fc option just plain
pg_dump $db >t
then "Alter Table add constraint PRIMARY KEY" and foreign key statements
are created as well as create unique index statements.

Is this a known feature, other people must be using the same commands.
Do I need to use pg_dump without the -FC option to create the tables,
indexes and constraints?

Am I missing something?

Any help is greatly appreciated.

Thanks,
Alberto Gobbi

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Michael Fuhr

2005-06-28, 3:24 am

On Fri, Jun 24, 2005 at 08:02:40PM -0700, Alberto wrote:
>
> I have tried to backup my postgres database with
> pg_dump -Fc $db > ~/backups/$db.backup.c
> and restore it with:
> createdb -U postgres -D aestel_admin -T template0 restoreTMP
> pg_restore -d restoreTMP -U postgres $db.backup.c
>
> I do not get any error messages but none of my indexes are created. None
> of the primary key or foreign key constraint are created. However simple
> check constraints are created.


What version of PostgreSQL are you using?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com