Received: from trends.net (root@clio.trends.ca [209.47.148.2]) by hub.org (8.9.1/8.9.1) with ESMTP id KAA02354 for ; Wed, 11 Nov 1998 10:14:15 -0500 (EST) (envelope-from herouth@oumail.openu.ac.il) Received: from shaked.cc.openu.ac.il (shaked.cc.openu.ac.il [147.233.145.65]) by trends.net (8.8.8/8.8.8) with ESMTP id FAA08358 for ; Wed, 11 Nov 1998 05:41:32 -0500 (EST) Received: from [147.233.159.109] (herouth@mac-herouth.pc.openu.ac.il [147.233.159.109]) by shaked.cc.openu.ac.il (8.8.8/8.8.8) with ESMTP id LAA26185; Wed, 11 Nov 1998 11:56:22 +0200 (IST) X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: <012001be0cf0$131ffb60$a3f0f6ce@bryan.arcamax.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Wed, 11 Nov 1998 11:56:29 +0200 To: "Bryan White" From: Herouth Maoz Subject: Re: [INTERFACES] Determine data type of columns Cc: pgsql-interfaces@postgresql.org At 23:21 +0200 on 10/11/98, Bryan White wrote: > I have a general purpose utilty for entering data into web based forms. The > function that parses the data and inserts the record into a table is largely > unaware of the structure of the table it is operating on. I am currenly > having problems with integer fields. If I blindly quote all fields the back > end will complain about casting on integer fields. Also I would like to do > some primitive field validation based on type before submitting to the back > end. It may be worth noticing that if you use COPY rather than INSERT, you don't have to quote neither numbers nor other data types. You do have to quote delimiter characters (tab, newline, backslash - or whatever you chose as your copy delimiters) with a backslash. That can be easily done even with the most "blind" front end, which knows nothing about the fields. I know, I know. You want to do updates and some type-based data checking as well. But this may be the answer in cases you don't, and be faster at that. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma