I have a table with 4 columns, none of them unique. I want to delete all but one of the duplicate records. I think there's a way to do this with ctid. Examples that pop up in google searches always rely on something like a unique (id) field, like a primary key, (no good in my case)
create table dog (variety varchar, name varchar, color varchar, age int);
insert into dogs
('lab','moby','white',12),
('lab','moby','white',12),
('spaniel','max','black',13),
('spaniel','max','black'),13,
('lab','moby','white',12);
I want the result to be just 2 recs, one for each dog.