Re: deleting an identical record

From: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: deleting an identical record
Date: 2002-02-21 09:25:13
Message-ID: 3C74BCF9.C25A8597@nsd.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric Veldhuyzen 2002-02-21 10:11:03 Re: execute permissions of stored procedures?
Previous Message eric 2002-02-21 09:12:41 Re: execute permissions of stored procedures?