SELECT my_key, count(*) FROM my_table GROUP BY my_key HAVING count(*) > 1;
November 11, 2009
Find duplicate in a database
November 5, 2009
Insert timestamps with a loop
This sql command allow you to test data writting in your database. It can be useful to benchmark your disk performances or check the impact of a lock.
INSERT INTO table SELECT timeofday()::timestamp FROM generate_series(1,1000000) WHERE pg_sleep(1) IS NOT NULL;