Re: DEFERRABLE NOT NULL constraint - Mailing list pgsql-general

From Andreas Joseph Krogh
Subject Re: DEFERRABLE NOT NULL constraint
Date
Msg-id OrigoEmail.18f.46b7c3475c4bcbb.13caaba25b5@prod2.officenet.no
Whole thread Raw
In response to Re: DEFERRABLE NOT NULL constraint  (Chris Angelico <rosuav@gmail.com>)
List pgsql-general
P=C3=A5 tirsdag 05. februar 2013 kl. 14:13:20, skrev Chris Angelico &l=
t;rosuav@gmail.com</a=
>>:

<blockquote style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt=
 0pt 0pt 0.8ex; padding-left: 1ex;">
On =
Tue, Feb 5, 2013 at 11:32 PM, Alban Hertroys <haramrae@gmail.com> wro=
te:
> On 5 February 2013 12:41, Andreas Joseph Krogh <andreak@officenet.n=
o> wrote:
>>
>> There are lots of things you can do, but when it's the ORM which d=
oes it
>> you have limited control, and that's the way it should to be (me a=
s
>> application-developer having to worry less about such details).
>
> In that case it's your ORM that needs fixing, not the database.

Agreed. One of the differences between MySQL and PostgreSQL is that
the latter gives you a database with rules, while the former is a
place for an application to store data. This last couple of weeks I've
been working with a really sloppily-built application (and a very
popular one too, so I won't name names), and it fits MySQL
perfectly... What I'd much rather do is build real rules that may not
EVER be violated. While I can see the value in deferring foreign key
constraints (circular references - never used 'em though), I don't see
any reason to create a record with a NULL and then replace that NULL
before committing. Sort out program logic first; then look to the
database.

Making people's lives easier in the short term is NOT the greatest
goal of a database. Consistent data will make the admins' lives far
easier in the long term. I do not ever want to have to deal with
BTrieve file corruption in my life.


=C2=A0

I've been using PG since v-6.5 and I'm very aware of its strengths, an=
d also its weaknesses. There really isn't an argument for not having NOT NU=
LL deferrable constraints, other than -hackers not prioritizing it, which I=
 understand perfectly well as they have lots of other interesting stuff on =
their plate.

=C2=A0
--
Andreas Joseph Krogh <andreak@officenet.no>=C2=A0 =C2=A0 =C2=A0 mob: =
+47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc

=C2=A0
=

pgsql-general by date:

Previous
From: Vick Khera
Date:
Subject: Re: COPY table to file missing quotation marks
Next
From: Alban Hertroys
Date:
Subject: Re: DEFERRABLE NOT NULL constraint