From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: Bryan White <bryan@arcamax.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] Determine data type of columns
Date: Wed, 11 Nov 1998 11:56:29 +0200
Message-ID: <l03110701b26f0f0c4c43@[147.233.159.109]> (raw)
In-Reply-To: <012001be0cf0$131ffb60$a3f0f6ce@bryan.arcamax.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-interfaces@postgresql.org
Cc: herouth@oumail.openu.ac.il, bryan@arcamax.com
Subject: Re: [INTERFACES] Determine data type of columns
In-Reply-To: <l03110701b26f0f0c4c43@[147.233.159.109]>
References: <012001be0cf0$131ffb60$a3f0f6ce@bryan.arcamax.com> <l03110701b26f0f0c4c43@[147.233.159.109]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox