On Fri, 2004-01-16 at 06:58, Harald Fuchs wrote: > In article <[EMAIL PROTECTED]>, > "LitelWang" <[EMAIL PROTECTED]> writes: > > I need this function : > > CheckDate('2002-02-29') return false > > CheckDate('2002-02-28') return true > > Why would you want to do that? Just try to insert '2002-02-29' into > your DATE column, and PostgreSQL will complain.
But it won't complain usefully. It will just abort the transaction. It's difficult to determine what went wrong when Postgres craps out, which is at least in part why many on this list recommend duplicating all the database validation logic in your application for EVERY type. To me, this seems like a waste of effort, since both the application and the DB server have to confirm that every date (for example, but applies to every other type as well) is valid. But I can't see how to do it any other way, since the prevailing consensus among the PG devs seems to be that any problem with the values of data is an application problem, not a database problem, so don't expect to get any help from the server other than "Sorry, that transaction is now gone. Hope you can reproduce the work! Have a nice day." Thanks, b.g. ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]