X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 14CF4476128 for ; Fri, 25 Apr 2003 15:02:39 -0400 (EDT) Received: from pimout2-ext.prodigy.net (pimout2-ext.prodigy.net [207.115.63.101]) by postgresql.org (Postfix) with ESMTP id 31BB8475C3D for ; Fri, 25 Apr 2003 15:02:38 -0400 (EDT) Received: from there (adsl-64-163-139-196.dsl.snfc21.pacbell.net [64.163.139.196]) by pimout2-ext.prodigy.net (8.12.9/8.12.3) with SMTP id h3PJ2X0Y108326; Fri, 25 Apr 2003 15:02:37 -0400 Message-Id: <200304251902.h3PJ2X0Y108326@pimout2-ext.prodigy.net> Content-Type: text/plain; charset="iso-8859-1" From: elein Reply-To: elein@varlena.com To: Robert Treat , elein@varlena.com Subject: Re: [SQL] rewriting values with before trigger Date: Fri, 25 Apr 2003 11:57:02 -0700 X-Mailer: KMail [version 1.3.2] Cc: Josh Berkus , "pgsql-general@postgresql.org" , pgsql-sql@postgresql.org References: <1051201544.4753.522.camel@camel> <200304250033.h3P0XuDl088102@pimout1-ext.prodigy.net> <200304250003.24506.xzilla@users.sourceforge.net> In-Reply-To: <200304250003.24506.xzilla@users.sourceforge.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-31.6 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,MSG_ID_ADDED_BY_MTA_3, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES 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/1343 X-Sequence-Number: 41408 OK. I understand what you mean. I was really focussing on the engine handling rather than the application behaviour. elein On Thursday 24 April 2003 21:03, Robert Treat wrote: > 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 > the application that is hitting against my database. When it doesn't have= a > value for the timestamp field, it either needs to drop it from the insert > statment 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 > periodically. Sometimes it passes in timestamps for certain fields, but > sometimes it doesn't have any timestamp information. When it doesn't have > information, it should send NULL. Unfortunatly the app writers wrote it to > send ''. Default's don't work because the app is trying to post data, it's > just not a valid datatype. Luckily in this instance I can tell the app > guys they have to fix thier app instead of having to muck up the database. > > Robert Treat --=20 ---------------------------------------------------------------------------= ------------- elein@varlena.com Database Consulting www.varlena.com I have always depended on the [QA] of strangers.