X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 39966475AE4; Fri, 25 Apr 2003 00:48:06 -0400 (EDT) Received: from svr-ganmtc-appserv-mgmt.ncf.coxexpress.com (svr-ganmtc-appserv-mgmt.ncf.coxexpress.com [24.136.46.5]) by postgresql.org (Postfix) with ESMTP id 5EC2E474E42; Fri, 25 Apr 2003 00:48:05 -0400 (EDT) Received: from linuxbox.ncf.coxexpress.com (ip24-136-37-175.ga.at.cox.net [24.136.37.175]) by svr-ganmtc-appserv-mgmt.ncf.coxexpress.com (8.11.4/8.11.4) with ESMTP id h3P4lsH10926; Fri, 25 Apr 2003 00:47:55 -0400 Content-Type: text/plain; charset="iso-8859-1" From: Robert Treat To: elein@varlena.com, elein Subject: Re: [SQL] rewriting values with before trigger Date: Fri, 25 Apr 2003 00:03:24 -0400 User-Agent: KMail/1.4.2 Cc: Josh Berkus , "pgsql-general@postgresql.org" , pgsql-sql@postgresql.org References: <1051201544.4753.522.camel@camel> <1051213745.4752.572.camel@camel> <200304250033.h3P0XuDl088102@pimout1-ext.prodigy.net> In-Reply-To: <200304250033.h3P0XuDl088102@pimout1-ext.prodigy.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200304250003.24506.xzilla@users.sourceforge.net> X-Spam-Status: No, hits=-38.1 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,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/1313 X-Sequence-Number: 41378 On Thursday 24 April 2003 08:28 pm, elein wrote: > I don't think this is a bug at all. > Argument creation has to come before the execution > of the function. That in this case the argument is a row type > doesn't matter. It has nothing to do with the content of the > function and everything to do with creating the row NEW. > How can you possibly assign a value to NEW.bar if NEW as > a whole does not exist? > You misunderstood. I don't think it's a bug in postgresql, it's a bug in t= he=20 application that is hitting against my database. When it doesn't have a val= ue=20 for the timestamp field, it either needs to drop it from the insert statmen= t=20 or convert it to null; not send a '' > What are you really trying to do here? Maybe setting the > table column's default to NULL will achieve what you want. > I have an application that is inserting information into a table periodical= ly.=20 Sometimes it passes in timestamps for certain fields, but sometimes it=20 doesn't have any timestamp information. When it doesn't have information, i= t=20 should send NULL. Unfortunatly the app writers wrote it to send ''. Default= 's=20 don't work because the app is trying to post data, it's just not a valid=20 datatype. Luckily in this instance I can tell the app guys they have to fi= x=20 thier app instead of having to muck up the database. Robert Treat