Re: PG rules! (RULES being the word ;->) - Mailing list pgsql-general

From Nils Zonneveld
Subject Re: PG rules! (RULES being the word ;->)
Date
Msg-id 3B555781.9E02AB36@mbit.nl
Whole thread Raw
In response to Re: PG rules! (RULES being the word ;->)  (Janning Vygen <vygen@planwerk6.de>)
Responses Re: Re: PG rules! (RULES being the word ;->)  (Janning Vygen <vygen@planwerk6.de>)
List pgsql-general

Janning Vygen wrote:
>
> But watch out the discussion "Application Design and PostgreSQL"
> these Days in the list. I thought your way. Thought it is pretty cool
> to have all logic inside the database, but it seems it isnt!
>
> How do you do your error checking?
> You won't be vendor independent!
> How do you check if your php sends a '1' instead of 'true' to the
> database. I think you can only catch this error with a midllerware.
> switching the databse is impossible.
>
> im just thinking about the same problem at this time and i am
> convinced by others to put the business logic in the middleware and
> just use SQL to store simple tables.
>

Putting business logic in the database doesn't mean you don't have to
check for bussiness rules in the middle tier. There are a few things
that a database can do without interference from the middle tier. For
instance I have a database where depending which client orders stuff
(flowers) and depending on the quantity, different percentages are
substracted from the price. All those percentages and conditions are
listed in tables, so PostgreSQL can handle that itself, you don't need a
middle tier for that. But integrity checks that raise an error need to
be handled in the middle tier. On first sight that looks like more work
to be done in the middle tier. On second sight though, its a guarantee
that it doesn't matter if you have 23 different middle ware programs or
just one large one, your data integrity will always be upheld by the
database itself. That doesn't mean you don't have to handle those
exceptions in the middle tier however.

Regards,

Nils Zonneveld
--
Alles van waarde is weerloos
Lucebert

pgsql-general by date:

Previous
From: Jan Wieck
Date:
Subject: Re: undeleteable records
Next
From: "Steve Werby"
Date:
Subject: Program to convert from PostgreSQL to Access or view table relationships