X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 60B7BD1B4EF for ; Sun, 9 Nov 2003 15:38:46 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 01027-02 for ; Sun, 9 Nov 2003 11:38:19 -0400 (AST) Received: from arktis.luxadmin.org (arktis.luxadmin.org [195.206.105.1]) by svr1.postgresql.org (Postfix) with ESMTP id D3FABD1B52F for ; Sun, 9 Nov 2003 11:38:14 -0400 (AST) Received: from samara.atlantis.local (unknown [195.218.21.232]) by arktis.luxadmin.org (Postfix) with SMTP id 7AA291605BA; Sun, 9 Nov 2003 16:38:01 +0100 (CET) Date: Sun, 9 Nov 2003 16:37:16 +0100 From: Daniel Struck To: Michael Glaesemann Cc: pgsql-php@postgresql.org Subject: Re: Reducing duplicated business rules Message-Id: <20031109163716.08fed5de.struck.d@retrovirology.lu> In-Reply-To: <714126A2-1082-11D8-B410-0005029FC1A7@myrealbox.com> References: <20031106165210.6b46bbb7.struck.d@retrovirology.lu> <714126A2-1082-11D8-B410-0005029FC1A7@myrealbox.com> X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/22 X-Sequence-Number: 2415 > Interesting idea. Then you can include more specific information rather= =20 > than just the PostgreSQL error. I wonder if there wouldn't be a way to=20 > use COMMENT information on the constraint as well_grab the COMMENT for=20 > whatever named constraint caused it to fail. I think for normal purposes, the name you can give a constraint should be s= ufficient. Else one can think of giving an error number as a name for the constraint a= nd keep the description of the error number in a different table. > I don't know if this is the best way to do this, but it might be=20 > workable in the short term. It would be nice to be able to ask the=20 > database, in effect "Okay, yeah, that's not a good piece of data. But=20 > let's assume that part were okay. Any other problems? Besides that?"=20 > Then you could possibly get more feedback from the database. True, that would be nice. Maybe a mode where the database would should all the constraints and not on= e be one. By the, this way of handling the format of the data makes your database mor= e independent from a script language. In fact you could use it in perl, jav= a, asp, etc. and don't have to rewrite the whole constraints for submitting= data again. Daniel --=20 Retrovirology Laboratory Luxembourg Centre Hospitalier de Luxembourg 4, rue E. Barbl=E9 L-1210 Luxembourg phone: +352-44116105 fax: +352-44116113 web: http://www.retrovirology.lu e-mail: struck.d@retrovirology.lu