Re: What does count(*) count? - Mailing list pgsql-general

From Karsten Hilbert
Subject Re: What does count(*) count?
Date
Msg-id 20031231174630.F941@hermes.hilbert.loc
Whole thread Raw
In response to Re: What does count(*) count?  (Együd Csaba <csegyud@vnet.hu>)
List pgsql-general
> In the database table the records have duplicated and I've two rows for
> every primary key - with different OIDs.
> Is there any safe method to get rid of only one of each duplicated row?

select distinct on (oid) * from your_table into working_table

check working_table

truncate your_table

select from working_table into your_table
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug and/or feature? Complex data types in tables...
Next
From: Tom Lane
Date:
Subject: Re: What does count(*) count?