From: Michael Glaesemann <grzm@myrealbox.com>
To: Rodrigo Sakai <rodrigo.sakai@zanthus.com.br>
Cc: pgsql-performance@postgresql.org
Subject: Re: FOREIGN KEYS vs PERFORMANCE
Date: Wed, 12 Apr 2006 08:06:17 +0900
Message-ID: <72C39159-1A4B-4595-A978-1DF57AD42527@myrealbox.com> (raw)
In-Reply-To: <001301c65d9c$08884ef0$4700a8c0@TREEZANTHUS>
References: <001301c65d9c$08884ef0$4700a8c0@TREEZANTHUS>
On Apr 12, 2006, at 4:13 , Rodrigo Sakai wrote:
> I think this is an old question, but I want to know if it really
> is well worth to not create some foreign keys an deal with the
> referential integrity at application-level?????
If I had to choose between one or the other, I'd leave all
referential integrity in the database and deal with the errors thrown
when referential integrity is violated in the application. PostgreSQL
is designed to handle these kinds of issues. Anything you code in
your application is more likely to contain bugs or miss corner cases
that would allow referential integrity to be violated. PostgreSQL has
been pounded on for years by a great many users and developers,
making the likelihood of bugs still remaining much smaller.
Of course, you can add some referential integrity checks in your
application code, but those should be in addition to your database-
level checks.
Michael Glaesemann
grzm myrealbox com
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: grzm@myrealbox.com, rodrigo.sakai@zanthus.com.br
Subject: Re: FOREIGN KEYS vs PERFORMANCE
In-Reply-To: <72C39159-1A4B-4595-A978-1DF57AD42527@myrealbox.com>
References: <001301c65d9c$08884ef0$4700a8c0@TREEZANTHUS> <72C39159-1A4B-4595-A978-1DF57AD42527@myrealbox.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