Skip site navigation (1) Skip section navigation (2)

Re: Question about inserts

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: mike <mike(at)redtux1(dot)uklinux(dot)net>
Cc: "pgsql-general (at) postgresql (dot) org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Question about inserts
Date: 2004-04-23 12:44:10
Message-ID: 20040423134410.A27748@bacon (view raw or flat)
Thread:
Lists: pgsql-general
On 23/04/2004 11:36 mike wrote:
> Is it possible to to the following
> 
> I have tables which are updated via webpage (perl) with fields of type
> int and date (all nullable). If the values are blank the entire insert
> fails, with a wrong type error.
> 
> Is there any way to stop this behaviour so that the valid information is
> allowed,but the blank values get ignored.


By blank, I assume you mean a zero-length string or the request parameter 
being absent? I think you need to detect these conditions in your perl 
program anf construct the SQL accordingly.

-- 
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for 
Business             |
| Computer Consultants         | 
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+

In response to

pgsql-general by date

Next:From: Anton NikiforovDate: 2004-04-23 13:48:21
Subject: Insert Or update
Previous:From: Stijn VanroyeDate: 2004-04-23 11:07:43
Subject: Re: Question about inserts

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group