dbTalk Databases Forums  

Backup and restore, manual rearrange

comp.databases.postgresql comp.databases.postgresql


Discuss Backup and restore, manual rearrange in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Johannes Bauer
 
Posts: n/a

Default Re: Backup and restore, manual rearrange - 08-25-2008 , 09:37 AM






Laurenz Albe schrieb:

Quote:
So if you restore a complete dump, you'll have the CREATE TABLE first,
then the data, and then the constraints.
That is because this is the most efficient way to do it.

The problem you experience happens because you dump only the data.
Ah, okay.

Quote:
But I can see several options how you could solve your problem,
apart from major editing:

- You can dump all tables individually and restore them in the correct
order.
- You can dump the schema defiition with the data and just edit the
CREATE TABLE or CREATE SCHEMA statements to reflect the changes you want.
Then import the dump which will recreate the objects with your changes.
- You can define the constraints on your tables as
DEFERRABLE INITIALLY DEFERRED. That way you should be able to import
your dump if it is within one transaction.

The last one I like best, this is exactly what I want. Thanks a lot for
your suggestion (again!).

Kind regards,
Johannes


Reply With Quote
  #12  
Old   
Johannes Bauer
 
Posts: n/a

Default Re: Backup and restore, manual rearrange - 08-25-2008 , 09:37 AM






Laurenz Albe schrieb:

Quote:
So if you restore a complete dump, you'll have the CREATE TABLE first,
then the data, and then the constraints.
That is because this is the most efficient way to do it.

The problem you experience happens because you dump only the data.
Ah, okay.

Quote:
But I can see several options how you could solve your problem,
apart from major editing:

- You can dump all tables individually and restore them in the correct
order.
- You can dump the schema defiition with the data and just edit the
CREATE TABLE or CREATE SCHEMA statements to reflect the changes you want.
Then import the dump which will recreate the objects with your changes.
- You can define the constraints on your tables as
DEFERRABLE INITIALLY DEFERRED. That way you should be able to import
your dump if it is within one transaction.

The last one I like best, this is exactly what I want. Thanks a lot for
your suggestion (again!).

Kind regards,
Johannes


Reply With Quote
  #13  
Old   
Johannes Bauer
 
Posts: n/a

Default Re: Backup and restore, manual rearrange - 08-25-2008 , 09:37 AM



Laurenz Albe schrieb:

Quote:
So if you restore a complete dump, you'll have the CREATE TABLE first,
then the data, and then the constraints.
That is because this is the most efficient way to do it.

The problem you experience happens because you dump only the data.
Ah, okay.

Quote:
But I can see several options how you could solve your problem,
apart from major editing:

- You can dump all tables individually and restore them in the correct
order.
- You can dump the schema defiition with the data and just edit the
CREATE TABLE or CREATE SCHEMA statements to reflect the changes you want.
Then import the dump which will recreate the objects with your changes.
- You can define the constraints on your tables as
DEFERRABLE INITIALLY DEFERRED. That way you should be able to import
your dump if it is within one transaction.

The last one I like best, this is exactly what I want. Thanks a lot for
your suggestion (again!).

Kind regards,
Johannes


Reply With Quote
  #14  
Old   
Johannes Bauer
 
Posts: n/a

Default Re: Backup and restore, manual rearrange - 08-25-2008 , 09:37 AM



Laurenz Albe schrieb:

Quote:
So if you restore a complete dump, you'll have the CREATE TABLE first,
then the data, and then the constraints.
That is because this is the most efficient way to do it.

The problem you experience happens because you dump only the data.
Ah, okay.

Quote:
But I can see several options how you could solve your problem,
apart from major editing:

- You can dump all tables individually and restore them in the correct
order.
- You can dump the schema defiition with the data and just edit the
CREATE TABLE or CREATE SCHEMA statements to reflect the changes you want.
Then import the dump which will recreate the objects with your changes.
- You can define the constraints on your tables as
DEFERRABLE INITIALLY DEFERRED. That way you should be able to import
your dump if it is within one transaction.

The last one I like best, this is exactly what I want. Thanks a lot for
your suggestion (again!).

Kind regards,
Johannes


Reply With Quote
  #15  
Old   
Johannes Bauer
 
Posts: n/a

Default Re: Backup and restore, manual rearrange - 08-25-2008 , 09:37 AM



Laurenz Albe schrieb:

Quote:
So if you restore a complete dump, you'll have the CREATE TABLE first,
then the data, and then the constraints.
That is because this is the most efficient way to do it.

The problem you experience happens because you dump only the data.
Ah, okay.

Quote:
But I can see several options how you could solve your problem,
apart from major editing:

- You can dump all tables individually and restore them in the correct
order.
- You can dump the schema defiition with the data and just edit the
CREATE TABLE or CREATE SCHEMA statements to reflect the changes you want.
Then import the dump which will recreate the objects with your changes.
- You can define the constraints on your tables as
DEFERRABLE INITIALLY DEFERRED. That way you should be able to import
your dump if it is within one transaction.

The last one I like best, this is exactly what I want. Thanks a lot for
your suggestion (again!).

Kind regards,
Johannes


Reply With Quote
  #16  
Old   
Johannes Bauer
 
Posts: n/a

Default Re: Backup and restore, manual rearrange - 08-25-2008 , 09:37 AM



Laurenz Albe schrieb:

Quote:
So if you restore a complete dump, you'll have the CREATE TABLE first,
then the data, and then the constraints.
That is because this is the most efficient way to do it.

The problem you experience happens because you dump only the data.
Ah, okay.

Quote:
But I can see several options how you could solve your problem,
apart from major editing:

- You can dump all tables individually and restore them in the correct
order.
- You can dump the schema defiition with the data and just edit the
CREATE TABLE or CREATE SCHEMA statements to reflect the changes you want.
Then import the dump which will recreate the objects with your changes.
- You can define the constraints on your tables as
DEFERRABLE INITIALLY DEFERRED. That way you should be able to import
your dump if it is within one transaction.

The last one I like best, this is exactly what I want. Thanks a lot for
your suggestion (again!).

Kind regards,
Johannes


Reply With Quote
  #17  
Old   
Johannes Bauer
 
Posts: n/a

Default Re: Backup and restore, manual rearrange - 08-25-2008 , 09:37 AM



Laurenz Albe schrieb:

Quote:
So if you restore a complete dump, you'll have the CREATE TABLE first,
then the data, and then the constraints.
That is because this is the most efficient way to do it.

The problem you experience happens because you dump only the data.
Ah, okay.

Quote:
But I can see several options how you could solve your problem,
apart from major editing:

- You can dump all tables individually and restore them in the correct
order.
- You can dump the schema defiition with the data and just edit the
CREATE TABLE or CREATE SCHEMA statements to reflect the changes you want.
Then import the dump which will recreate the objects with your changes.
- You can define the constraints on your tables as
DEFERRABLE INITIALLY DEFERRED. That way you should be able to import
your dump if it is within one transaction.

The last one I like best, this is exactly what I want. Thanks a lot for
your suggestion (again!).

Kind regards,
Johannes


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.