pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joshua D. Drake <jd@commandprompt.com>
To: Nigel J. Andrews <nandrews@investsystems.co.uk>
Cc: shreedhar <shreedhar@lucidindia.net>
Cc: Postgre General <pgsql-general@postgresql.org>
Cc: Postgre Admin <pgsql-admin@postgresql.org>
Subject: Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length
Date: Tue, 23 Sep 2003 07:52:02 -0700
Message-ID: <3F705E12.4080603@commandprompt.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0309231227300.22150-100000@ponder.fairway2k.co.uk>
References: <Pine.LNX.4.21.0309231227300.22150-100000@ponder.fairway2k.co.uk>


>Looks like line 73 of your /xxx/database.inc PHP script is submitting a query
>formated with a zero length string instead of a number. Look for the variable
>being formated into the query string being undefined thereby leading to the
>somethat that looks like:
>
>  delete from aaa where id =
>
>instead of a more normal:
>
>  delete from aaa where id = 44
>
>You wouldn't believe the number of times I've explained that error message to a
>PHP developer.
>  
>

Older versions of PostgreSQL would allow a '' to be inserted as an 
integer base value which is illegal. Newer
versions do not allow a '' to be inserted into a integer base value. 
Thus if you have a query that may return
'' as an integer base value, you should run it through a condition to 
make the '' == NULL which is valid.

Sincerely,

Joshua Drake










view thread (4+ messages)

Message-ID: <3F705E12.4080603@commandprompt.com>
Permalink:  ../3F705E12.4080603@commandprompt.com/
Also on:    postgresql.org/message-id/3F705E12.4080603@commandprompt.com

 · 

reply

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-admin@postgresql.org
  Cc: jd@commandprompt.com, nandrews@investsystems.co.uk, shreedhar@lucidindia.net, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length
  In-Reply-To: <3F705E12.4080603@commandprompt.com>
  References: <Pine.LNX.4.21.0309231227300.22150-100000@ponder.fairway2k.co.uk> <3F705E12.4080603@commandprompt.com>

* 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