public inbox for [email protected]
help / color / mirror / Atom feedFrom: Francisco Olarte <[email protected]>
To: Rich Shepard <[email protected]>
Cc: [email protected]
Subject: Re: Removing duplicate rows in table
Date: Tue, 10 Sep 2024 18:03:16 +0200
Message-ID: <CA+bJJbyxMUJFmZ4r22WZ018GJoZxFn+gr3Ad1y5XY5QkjvXZAQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<CA+bJJbzg2H-oLvKKt49bFEpkzXpnjcnwtB--28tE1xwin9mxnA@mail.gmail.com>
<[email protected]>
Rich:
On Tue, 10 Sept 2024 at 17:32, Rich Shepard <[email protected]> wrote:
> Only a duplicate problem because when I created this table I didn't make the
> proj_nbr column a PK.
Always report this is if you have future problems, so people know if
it is a case of pilot error or corruption, solutions differ and the
good for ones may harm others.
> > Also, if you do not have any uniqueness criteria consider adding an
> > "id identity" column, it is useful when shit hits the fan.
> Yep. that's what I will do.
Bear in mind the relational model on which relational databases are
modeled needs unique rows ( i.e., no two full rows should be equal on
all fields ). It is not enforced in SQL, but now having it normally
leads to problems. When it cannot be done in any other way, normally
adding an identity column is a cheap way to make them unique. I had
that problem with CDR tables ( it means call detail record, and until
I managed to add circuit identification I had the problem that you can
have two calls from and two the same two numbers with equal start and
end times ) and solved it using an identity column ( added just for
this purpose, after doing it a couple times using ctid in testing, it
is slightly more expensive, but a lot more civilized ).
Francisco Olarte.
view thread (16+ messages) latest in thread
reply
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Removing duplicate rows in table
In-Reply-To: <CA+bJJbyxMUJFmZ4r22WZ018GJoZxFn+gr3Ad1y5XY5QkjvXZAQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox