X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AEF2C476285 for ; Thu, 24 Apr 2003 18:02:26 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 04C1947622E for ; Thu, 24 Apr 2003 18:02:26 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h3OM2LU6024275; Thu, 24 Apr 2003 18:02:21 -0400 (EDT) To: Robert Treat Cc: gearond@cvc.net, Josh Berkus , "pgsql-general@postgresql.org" , pgsql-sql@postgresql.org Subject: Re: [SQL] rewriting values with before trigger In-reply-to: <1051213745.4752.572.camel@camel> References: <1051201544.4753.522.camel@camel> <200304240939.54070.josh@agliodbs.com> <1051209495.7747.544.camel@camel> <3EA836AF.8060704@cvc.net> <1051212144.4752.558.camel@camel> <3EA83C95.8070404@cvc.net> <1051213745.4752.572.camel@camel> Comments: In-reply-to Robert Treat message dated "24 Apr 2003 15:49:05 -0400" Date: Thu, 24 Apr 2003 18:02:21 -0400 Message-ID: <24274.1051221741@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-32.5 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,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/1288 X-Sequence-Number: 41353 Robert Treat writes: > yeah, I've thought of some other crazy ways to get around this, but the > problem is due to a bug in the application side. I was hoping I could > write a quick hack (like adding a rule/trigger) to get around this until > the app was fixed, but I'm not going to make my side a kludge when it > isn't one now. The only way I can see to do it is to make a view that has 'text' datatypes in place of real ones, with an ON INSERT rule that invokes your conversion functions and then inserts the result to the real table. Dunno if that's too high on your kluge meter. regards, tom lane