Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f6KCVsa67998 for ; Fri, 20 Jul 2001 08:31:54 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6KA1Fa04406 for ; Fri, 20 Jul 2001 06:01:15 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f6K9gLY16091 for pgsql-sql@postgresql.org; Fri, 20 Jul 2001 05:42:21 -0400 (EDT) (envelope-from news) From: "Mattis Jiderhamn" X-Newsgroups: comp.databases.postgresql.sql Subject: Cast '' (blank) to null date Date: Fri, 20 Jul 2001 11:44:08 +0200 Organization: Expert Systems Lines: 15 Message-ID: <9j8udq$fmo$1@news.tht.net> Reply-To: "Mattis Jiderhamn" X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 To: pgsql-sql@postgresql.org X-Archive-Number: 200107/269 X-Sequence-Number: 4066 Hi there everyone. I'm trying to create a trigger so that, if I try to insert blank, that is '', into a date field it will be converted to null so that I don't get ERROR: Bad date external representation '' I believe my ploblem is that I don't know the type of blank (''), and therefore do not know what to cast from. It seems it is not unknown. Any other suggestions? Thanks, Mattias Jiderhamn mattias@expertsystem.se