Re: PG rules! (RULES being the word ;->)

From: "Dr(dot) Evil" <drevil(at)sidereal(dot)kz>
To: justin(at)postgresql(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PG rules! (RULES being the word ;->)
Date: 2001-07-18 07:01:28
Message-ID: 20010718070128.24749.qmail@sidereal.kz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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. I put foreign key constraints
in so that none of the domain names can ever be without an owner (it's
a domain registry project). This is how programming should be.

Compare this to PHP or perl, where all variables are strings, or C
where there are memory leaks all over the place unless the programmer
is very skilled and careful.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2001-07-18 07:23:53 Errors in logs
Previous Message Ryan Mahoney 2001-07-18 04:17:53 Re: undeleteable records