Skip to content

Instantly share code, notes, and snippets.

@da3mon
Created October 21, 2008 19:29
Show Gist options
  • Save da3mon/18391 to your computer and use it in GitHub Desktop.
Save da3mon/18391 to your computer and use it in GitHub Desktop.
#detect duplicates across columns in really large tables
psql -d database -c 'select col_1, col_2, col_3 from table order by col_1, col_2, col_3'|tr -ds '|' ' '|awk '{print $1 " " $2 " " $3}'|uniq -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment