RE: Two questions in a row - Mailing list pgsql-general

From Andrew Snow
Subject RE: Two questions in a row
Date
Msg-id NHEALMDKDACEIPBNOOOCCEPNCGAA.als@fl.net.au
Whole thread Raw
In response to Re: Two questions in a row  (Gilles DAROLD <gilles@darold.net>)
List 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.




pgsql-general by date:

Previous
From: Gilles DAROLD
Date:
Subject: Re: Two questions in a row
Next
From: Mike Mascari
Date:
Subject: Re: Two questions in a row