Re: Polymorphic delete help needed - Mailing list pgsql-general

From Alexander Staubo
Subject Re: Polymorphic delete help needed
Date
Msg-id 88daf38c0707061320l5774004ajd48708d4b1c97647@mail.gmail.com
Whole thread Raw
In response to Re: Polymorphic delete help needed  (David Fetter <david@fetter.org>)
List pgsql-general
On 7/6/07, David Fetter <david@fetter.org> wrote:
> At some point, you're going to realize that Rails is the problem, not
> the solution.  It's written by people who do not understand what a
> shared data store is and reflects problems inherent in its native
> database platform: MySQL 3.23.

This is rampant FUD; generalizations such as these help nobody. There
are plenty of developers, myself included, who use Rails in a
relational way, with relational integrity, transactions and normalized
schemas, none of which are particularly hampered by Rails' MySQLisms.

On the other hand, it is true that ActiveRecord lacks some tools out
of the box -- for example, model-level foreign key constraints are
accessible through a plugin you need to install separately. It is also
true that some of ActiveRecord's mechanisms are less than clean,
polymorphic associations in particular.

Keep in mind that ActiveRecord is an object-relational mapper. There
is the well-known impedance mismatch between object-oriented
programming and the relational model, one that is not trivially
overcome (the view-based example cited earlier in this thread is a
paticularly egregious example of a non-trivial solution).

Polymorphic associations is a practical solution that compromises
relational purity for performance and ease of implementation, and it
could be argued that it's a "good enough" solution for many
developers, who are ultimately interested in getting things done, even
if they "do not understand what a shared data store is".

ActiveRecord's polymorphism can be explained on a paper napkin; I
haven't encountered a purely relational solution in this thread that
fits this description.

Alexander.

pgsql-general by date:

Previous
From: "Dmitry Koterov"
Date:
Subject: Update a single row without firing its triggers?
Next
From: "Dann Corbit"
Date:
Subject: Re: ISO TESTS for a Pg lexer+parser