pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_dump -Fc does not dump indexes
7+ messages / 3 participants
[nested] [flat]

* pg_dump -Fc does not dump indexes
@ 2005-06-25 03:02  Alberto <nspmma@freenet.de>
  0 siblings, 3 replies; 7+ messages in thread

From: Alberto @ 2005-06-25 03:02 UTC (permalink / raw)
  To: pgsql-admin

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_expression"

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



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pg_dump -Fc does not dump indexes]
@ 2005-06-25 15:55  Alberto <nspmma@freenet.de>
  0 siblings, 1 reply; 7+ messages in thread

From: Alberto @ 2005-06-25 15:55 UTC (permalink / raw)
  To: pgsql-admin

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_expression"

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





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_dump -Fc does not dump indexes]
@ 2005-06-25 17:08  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Alberto <nspmma@freenet.de>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2005-06-25 17:08 UTC (permalink / raw)
  To: Alberto <nspmma@freenet.de>; +Cc: pgsql-admin

Alberto <nspmma@freenet.de> writes:
> 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.

Works for me ... can you create a self-contained test case?  What PG
version are you using, anyway (and are you sure the pg_dump and
pg_restore programs are of the same version)?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_dump -Fc does not dump indexes
@ 2005-06-25 20:39  Alberto <nspmma@freenet.de>
  parent: Alberto <nspmma@freenet.de>
  2 siblings, 1 reply; 7+ messages in thread

From: Alberto @ 2005-06-25 20:39 UTC (permalink / raw)
  To: pgsql-admin

Hi Tom,
thanks for answering so quickly!

The error occurs for me using pg_dump and pg_restore on postgres 8.0.3 
running on RedHat ES4. But also occurs if I take the dump from the Linux 
box and run restore on a winxp box with postgres 8.0.2.

I would definetely be willing to create a self contained test case but I 
am not sure what that would be. I can create a dump file from a test 
database, but that would be after using pg_dump so you could not check 
that. Do you want me to create a database, shut it down and zip up the 
database files? Which files would those be?

Is there a way for me to find out if the dump file created with -Fc does 
contain information on the indexes?

Thanks,
Alberto

 >> 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. 
 
 >Works for me ... can you create a self-contained test case?  What PG 
 >version are you using, anyway (and are you sure the pg_dump and 
 >pg_restore programs are of the same version)? 
 >  regards, tom lane 



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_dump -Fc does not dump indexes
@ 2005-06-25 21:36  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Alberto <nspmma@freenet.de>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2005-06-25 21:36 UTC (permalink / raw)
  To: Alberto <nspmma@freenet.de>; +Cc: pgsql-admin

Alberto <nspmma@freenet.de> writes:
> I would definetely be willing to create a self contained test case but I 
> am not sure what that would be. I can create a dump file from a test 
> database, but that would be after using pg_dump so you could not check 
> that. Do you want me to create a database, shut it down and zip up the 
> database files? Which files would those be?

Well, basically I want to know how to create a database from which
pg_dump can't dump indexes ... can you reconstruct the sequence that got
you into this condition?

Also ... this is really grasping at straws, but do you have SELinux set
in enforcement mode in your RHEL4 system, and if so does changing it to
permissive mode make a difference?  We've seen a bunch of issues with
SELinux :-( --- this does not seem like any of them, but you never know.

> Is there a way for me to find out if the dump file created with -Fc does 
> contain information on the indexes?

If "pg_restore -l" shows a lot of stuff but not the indexes (either as
indexes or as constraints) then I'd say that's sufficient evidence.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_dump -Fc does not dump indexes
@ 2005-06-26 03:46  Alberto <nspmma@freenet.de>
  parent: Alberto <nspmma@freenet.de>
  2 siblings, 0 replies; 7+ messages in thread

From: Alberto @ 2005-06-26 03:46 UTC (permalink / raw)
  To: pgsql-admin

Hi Tom,
I tried to reproduce the problem once more creating a new blank database and some tables with constraints.
I could not reproduce the problem. I then went back and tried to reproduce the problem with the original database.
Now I can not reproduce even that although it happened multiple times to me before.

I would suggest that I keep an eye on it and try to figure out how to reproduce the problem.

Thanks for your time!!
Alberto

ps. I had switched SELinux off for now.



Alberto <nspmma ( at ) freenet ( dot ) de> writes:
> I would definetely be willing to create a self contained test case but I 
> am not sure what that would be. I can create a dump file from a test 
> database, but that would be after using pg_dump so you could not check 
> that. Do you want me to create a database, shut it down and zip up the 
> database files? Which files would those be?

Well, basically I want to know how to create a database from which
pg_dump can't dump indexes ... can you reconstruct the sequence that got
you into this condition?

Also ... this is really grasping at straws, but do you have SELinux set
in enforcement mode in your RHEL4 system, and if so does changing it to
permissive mode make a difference?  We've seen a bunch of issues with
SELinux :-( --- this does not seem like any of them, but you never know.

> Is there a way for me to find out if the dump file created with -Fc does 
> contain information on the indexes?

If "pg_restore -l" shows a lot of stuff but not the indexes (either as
indexes or as constraints) then I'd say that's sufficient evidence.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_dump -Fc does not dump indexes
@ 2005-06-28 04:43  Michael Fuhr <mike@fuhr.org>
  parent: Alberto <nspmma@freenet.de>
  2 siblings, 0 replies; 7+ messages in thread

From: Michael Fuhr @ 2005-06-28 04:43 UTC (permalink / raw)
  To: Alberto <nspmma@freenet.de>; +Cc: pgsql-admin

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/



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2005-06-28 04:43 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-06-25 03:02 pg_dump -Fc does not dump indexes Alberto <nspmma@freenet.de>
2005-06-25 20:39 ` Alberto <nspmma@freenet.de>
2005-06-25 21:36   ` Tom Lane <tgl@sss.pgh.pa.us>
2005-06-26 03:46 ` Alberto <nspmma@freenet.de>
2005-06-28 04:43 ` Michael Fuhr <mike@fuhr.org>
2005-06-25 15:55 pg_dump -Fc does not dump indexes] Alberto <nspmma@freenet.de>
2005-06-25 17:08 ` Re: pg_dump -Fc does not dump indexes] Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox