Re: deleting an identical record - Mailing list pgsql-general

From Jean-Luc Lachance
Subject Re: deleting an identical record
Date
Msg-id 3C74BCF9.C25A8597@nsd.ca
Whole thread Raw
In response to Re: deleting an identical record  (missive@frontiernet.net (Lee Harr))
Responses Re: deleting an identical record
List pgsql-general
Oliver Elphick wrote:
>
> On Thu, 2002-02-21 at 03:44, Lee Harr wrote:
> > > In a table I entered by accident two times the same record, if I now
> > > list the table I see two lines with exactly the same contents. How can
> > > I delete one of those two records? I can't find a select criterium which
> > > differs for both.
> > >
> >
> >
> > create table t (a int, b text);
> >
> > insert into t values (1, 'a');
> > insert into t values (1, 'a');
> > insert into t values (1, 'a');
> > insert into t values (1, 'a');
> >
> > select oid, * from t;
>
> Aren't the oids different?
>
> DELETE FROM t WHERE oid <> xxx
>
 OUCH !!! There will be only one row left in the table.  Be carefull.

pgsql-general by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: OID
Next
From: Oliver Elphick
Date:
Subject: Re: deleting an identical record