![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
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. |
|
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. |
#12
| |||
| |||
|
|
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. |
|
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. |
#13
| |||
| |||
|
|
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. |
|
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. |
#14
| |||
| |||
|
|
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. |
|
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. |
#15
| |||
| |||
|
|
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. |
|
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. |
#16
| |||
| |||
|
|
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. |
|
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. |
#17
| |||
| |||
|
|
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. |
|
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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |