Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eBCEfEm77958 for ; Tue, 12 Dec 2000 09:41:14 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from erm1.u-strasbg.fr (erm1.u-strasbg.fr [130.79.74.61]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eB6Host43679 for ; Wed, 6 Dec 2000 12:50:54 -0500 (EST) (envelope-from bboett@erm1.u-strasbg.fr) Received: (qmail 18968 invoked by uid 501); 6 Dec 2000 18:10:40 -0000 Date: Wed, 6 Dec 2000 19:10:40 +0100 From: Bruno Boettcher To: pgsql-sql@postgresql.org Subject: HELP: can i have a trigger before postgres tries to check data types? Message-ID: <20001206191040.B17226@erm1.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i X-Archive-Number: 200012/86 X-Sequence-Number: 417 hello, now that i finally managed to write some functions and triggers in perl, i get the following error: insert into journal (plus,minus,description,currency,amount) VALUES (101,420,'a test....','EUR','1.000.000'); ERROR: pg_atoi: error in "1.000.000": can't parse ".000.000" normal since the value was declared as beeing an int4.... and i would like to keep that this way..... the purpose of the trigger is exactly to strip the prettyprinted number that's incoming of eventual '.' and ',' ..... but the pg_atoi comes before even my trigger has a chance to get a grip onto that line.... anything i can do? (besides declaring the field as of type text...) any way i can tell the DB to use my function instead of pg_atoi when parsing lines for a certain table? -- ciao bboett ============================================================== bboett@earthling.net http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett =============================================================== the total amount of intelligence on earth is constant. human population is growing....