Skip to content

Instantly share code, notes, and snippets.

@graphbear
Created May 1, 2017 14:03
Show Gist options
  • Save graphbear/c094c0166f5b75cc70c02395849335f9 to your computer and use it in GitHub Desktop.
Save graphbear/c094c0166f5b75cc70c02395849335f9 to your computer and use it in GitHub Desktop.
check for identical data in two postgres tables
-- https://dba.stackexchange.com/questions/72641/checking-whether-two-tables-have-identical-content-in-postgresql
-- more sql for other cases and good discussion in reply to this question
(TABLE a EXCEPT TABLE b)
UNION ALL
(TABLE b EXCEPT TABLE a) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment