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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-general by date

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