From: Richard Huxton <dev@archonet.com>
To: Ross J. Reedstrom <reedstrm@rice.edu>
To: ibrahim cobanoglu <icoban77@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: Re: pls Help us... (sql question)
Date: Tue, 3 Jul 2001 17:19:13 +0100
Message-ID: <005201c103dc$0b82e260$1001a8c0@archonet.com> (raw)
References: <20010703102342.89388.qmail@web14406.mail.yahoo.com>
<20010703094709.A31594@rice.edu>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, reedstrm@rice.edu, icoban77@yahoo.com
Subject: Re: Re: pls Help us... (sql question)
In-Reply-To: <005201c103dc$0b82e260$1001a8c0@archonet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox