X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id BEAA1476368 for ; Fri, 18 Apr 2003 17:07:57 -0400 (EDT) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id 9927847636C for ; Fri, 18 Apr 2003 17:07:56 -0400 (EDT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 2971788 for pgsql-sql@postgresql.org; Fri, 18 Apr 2003 14:07:49 -0700 Content-Type: text/plain; charset="us-ascii" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: pgsql-sql@postgresql.org Subject: Suggestion: Need conversion-testing functions. Date: Fri, 18 Apr 2003 14:07:33 -0700 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200304181407.33083.josh@agliodbs.com> X-Spam-Status: No, hits=-13.0 required=5.0 tests=BAYES_01,USER_AGENT_KMAIL autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/290 X-Sequence-Number: 12991 Folks, A current issue that I am struggling with is that there is no way to test= =20 whether a data type can be cast within a PL/pgSQL function. If, for=20 example, I want to test whether a string can be cast into a timestamp, I=20 cannot do it without raising an exception, which will then abort my=20 function. One would think that isfinite() would allow testing of dates in this way, b= ut=20 isfinite() returns an exception instead of False if the value passed is an= =20 invalid date. This makes isfinite(), IMHO, completely useless as a functi= on=20 -- it doesn't do anything CAST( AS DATE) wouldn't do. We need "testing functions" for, at a minimum: text --> date text --> timestamp text --> ip address text --> interval text --> integer While I am happy to pay someone to do the necessary coding, I feel strongly= =20 that once these functions are built they should be included in the main set= =20 of builtins. Comments? Volunteers? --=20 -Josh Berkus Aglio Database Solutions San Francisco