Re: PG rules! (RULES being the word ;->)
От | Janning Vygen |
---|---|
Тема | Re: PG rules! (RULES being the word ;->) |
Дата | |
Msg-id | 01071810214701.32508@janning обсуждение исходный текст |
Ответ на | Re: PG rules! (RULES being the word ;->) ("Dr. Evil" <drevil@sidereal.kz>) |
Ответы |
Re: PG rules! (RULES being the word ;->)
|
Список | pgsql-general |
Am Mittwoch, 18. Juli 2001 09:01 schrieb Dr. Evil: > That's pretty cool. I may look into those. I just like being able > to define that the data stay in a self-consistent format. Other > programming languages would do well to follow this method. I'm > programming my front-end in PHP. I should be able to say > > INT i CHECK (i > 0); > > when I declare it in PHP, for instance, but this isn't possible; > they don't even have strong typing! > > Anyway, I was just writing a table which holds credit card payment > data. I put in a constraint: > > cardnumber VARCHAR(20) CHECK (luhn10(cardnumber)), > > right in the table, so no matter how screwed up anything is, only > valid card numbers can go in the table. 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. janning -- Planwerk 6 /websolutions Herzogstraße 86 40215 Düsseldorf fon 0211-6015919 fax 0211-6015917 http://www.planwerk6.de
В списке pgsql-general по дате отправления: