Re: deleting an identical record

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: deleting an identical record
Date: 2002-02-21 10:31:28
Message-ID: 1014287488.13241.237.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2002-02-21 at 09:25, Jean-Luc Lachance wrote:
> Oliver Elphick wrote:
> > > 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.

True. But in my defence, that is valid in the context of this
particular example. (Nevertheless, I was right only by accident and
your warning is very necessary.)

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C

"My sheep hear my voice, and I know them, and they
follow me; And I give unto them eternal life; and they
shall never perish, neither shall any man pluck them
out of my hand." John 10:27,28

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sean Chittenden 2002-02-21 10:44:51 pg_dumpall perms errata...
Previous Message Eric Veldhuyzen 2002-02-21 10:11:03 Re: execute permissions of stored procedures?