Last active
October 26, 2021 23:46
-
-
Save antarr/f2141872d13027ff05794e6a4df6a0e2 to your computer and use it in GitHub Desktop.
Fix PrimayKey with existing Refrences
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN; | |
-- Extend timeout for really large datasets | |
SET statement_timeout = 10000; | |
SET session_replication_role='replica'; | |
UPDATE legiscan_model_states SET id=43 WHERE abbr='TX'; | |
UPDATE voter_records SET state_id=43 WHERE state_id=54; | |
SET session_replication_role='original'; | |
COMMIT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.mendelowski.com/docs/postgresql/update-primary-key-with-foreign-constraints/