pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Richard Huxton <dev@archonet.com>
To: Josh Berkus <josh@agliodbs.com>
To: pgsql-sql@postgresql.org
Subject: Re: Date Validation?
Date: Fri, 13 Jul 2001 10:44:39 -0700
Message-ID: <web-85443@davinci.ethosmedia.com> (raw)
In-Reply-To: <006401c10bbd$effc5320$1001a8c0@archonet.com>

Richard,

> Out of curiosity Josh, why aren't you validating in PHP? - only takes
> a
> couple of lines there.

We are.  It's just that all other validation takes place inside the
PL/pgSQL functions in order to keep all the business logic in the
database.  Having one form of validation in the interface (PHP) and the
rest in the function can cause the user to go through multiple
validation errors, which is especially frustrating if the second
validation error is fatal.  Example:

USER: '2001-06-31'

PHP Validation: '2001-06-31 is not a valid date.'

USER: '2001-06-30'

PL/pgSQL FUNCTION: 'Your session has timed out.  Please log back in.'

USER: '%^#$&*&#!!!'

See what I mean?  Not a showstopper, but it mars our otherwise
user-friendly validation formula.

-Josh


______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco



view thread (8+ messages)  latest in thread

Message-ID: <web-85443@davinci.ethosmedia.com>
Permalink:  ../web-85443@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-85443@davinci.ethosmedia.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, dev@archonet.com
  Subject: Re: Date Validation?
  In-Reply-To: <web-85443@davinci.ethosmedia.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox