Put some data tables from one database to another #2257
szabozoltan69
started this conversation in
General
Replies: 1 comment
-
In an Azure based PostgreSQL flexible server it is not allowed to disable triggers table-wise (permission denied), but there is an easier way:
After the COMMIT any new operations you perform will have the constraints enforced immediately unless you explicitly defer them again. Then the same sequence is needed for "\i ...guest.sql" command. It can not be performed in the same loop as the deletes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sometimes some data tables are required in a database that can be found in another one (Staging, Prod) for testing purpose.
Here are the steps to do it in an "SQL way". Maybe later we can develop another ("manage.py") way for that also.
An example:
Fixes which comes from difference between the databases (!!!). Sometimes non-existent names (like "statusz") are good to ignore non-needed columns.
Sometimes MANUAL changes are needed in guest.sql, e.g. (status to molnix_status, molnix_status to statusz):
original was:
Also happens that an interval of user ID-s are missing from the "host" database. In this case some dummy users can be added via a loop:
Beta Was this translation helpful? Give feedback.
All reactions