From: "Ross J. Reedstrom" <reedstrm@rice.edu>
> Best to ask your questions on the list, so others may find them,
> with (hopefully) helpful answers in the archives in the future.
>
> so, you've got a table with indistinguishable rows. I'm afraid you've
> got to use an non ANSI extension. Every DB I've ever used has something
> equivelant. In PostgreSQL, it's the 'oid', so in your case, you'd do:
>
> SELECT oid,Name from tablename;
>
> and see something like:
> oid Name
> ------- -------
> 102453 ibrahim first row
> 102455 ibrahim second row
> 103756 ibrahim third row
>
>
> Then, you can delete, comparing on the oid:
>
> DELETE FROM tablename WHERE oid=102455;
Ibrahim - if you want to prevent any more duplicate entries you can make the
"name" column unique - see the CREATE TABLE docs but it would be something
like:
CREATE TABLE tablename ( "Name" varchar(64) UNIQUE;
);
Then PG will fail any attempt to insert a duplicate value (it is the same as
creating a UNIQUE index basically).
- Richard Huxton