RE: Two questions in a row

From: "Andrew Snow" <als(at)fl(dot)net(dot)au>
To: <pgsql-general(at)hub(dot)org>
Subject: RE: Two questions in a row
Date: 2000-07-06 08:11:42
Message-ID: NHEALMDKDACEIPBNOOOCCEPNCGAA.als@fl.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> > 1. How do you remove one of two identical rows
> > from a pgsql table ?
>
> DELETE FROM t1 WHERE .... wil do the stuff for you. If you don't know
> the value into the duplicate field just export the database with pg_dump
> create
> a unique index onto this field and reimport all your data. Duplicate
> data will
> not be inserted.

Another way could be to
SELECT oid FROM table WHERE ...;

and then delete based on that. However I believe it is possible to have two
rows have the same oid but usually that isn't the case.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Mascari 2000-07-06 08:18:30 Re: Two questions in a row
Previous Message Gilles DAROLD 2000-07-06 08:09:27 Re: Two questions in a row