Deleting duplicate rows using ctid ? - Mailing list pgsql-general

From David Gauthier
Subject Deleting duplicate rows using ctid ?
Date
Msg-id CAEs=6DnRvQoV_pCLOU91J9y=xQRKfiJFTdqpk+a4LJay0VeEwg@mail.gmail.com
Whole thread Raw
Responses Re: Deleting duplicate rows using ctid ?  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
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.





pgsql-general by date:

Previous
From: Максим Чистяков
Date:
Subject: Log pre-master keys during TLS v1.3 handshake
Next
From: "David G. Johnston"
Date:
Subject: Re: Deleting duplicate rows using ctid ?