pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PostgreSQL query failed: ERROR: pg_atoi: zero-length string
4+ messages / 4 participants
[nested] [flat]

* PostgreSQL query failed: ERROR: pg_atoi: zero-length string
@ 2003-09-23 10:57 shreedhar <shreedhar@lucidindia.net>
  2003-09-23 11:14 ` Re: PostgreSQL query failed: ERROR: pg_atoi: zero-length Ron Johnson <ron.l.johnson@cox.net>
  2003-09-23 11:30 ` Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length Nigel J. Andrews <nandrews@investsystems.co.uk>
  0 siblings, 2 replies; 4+ messages in thread

From: shreedhar @ 2003-09-23 10:57 UTC (permalink / raw)
  To: Postgre General <pgsql-general@postgresql.org>; pgsql-admin

If I try to delete a record from my table which is giving following error


Warning: PostgreSQL query failed: ERROR: pg_atoi: zero-length string in
/xxx/database.inc on line 73

What might be the problem.

Regards,
Sreedhar Bhaskararaju




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: PostgreSQL query failed: ERROR: pg_atoi: zero-length
  2003-09-23 10:57 PostgreSQL query failed: ERROR: pg_atoi: zero-length string shreedhar <shreedhar@lucidindia.net>
@ 2003-09-23 11:14 ` Ron Johnson <ron.l.johnson@cox.net>
  1 sibling, 0 replies; 4+ messages in thread

From: Ron Johnson @ 2003-09-23 11:14 UTC (permalink / raw)
  To: PgSQL General ML <pgsql-general@postgresql.org>

On Tue, 2003-09-23 at 05:57, shreedhar wrote:
> If I try to delete a record from my table which is giving following error
> 
> 
> Warning: PostgreSQL query failed: ERROR: pg_atoi: zero-length string in
> /xxx/database.inc on line 73
> 
> What might be the problem.

What version are you running?

Could you show us an example using psql?

-- 
-----------------------------------------------------------------
Ron Johnson, Jr. ron.l.johnson@cox.net
Jefferson, LA USA

The purpose of the military isn't to pay your college tuition or 
give you a little extra income; it's to "kill people and break things".
Surprisingly, not everyone understands that.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length
  2003-09-23 10:57 PostgreSQL query failed: ERROR: pg_atoi: zero-length string shreedhar <shreedhar@lucidindia.net>
@ 2003-09-23 11:30 ` Nigel J. Andrews <nandrews@investsystems.co.uk>
  2003-09-23 14:52   ` Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length Joshua D. Drake <jd@commandprompt.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Nigel J. Andrews @ 2003-09-23 11:30 UTC (permalink / raw)
  To: shreedhar <shreedhar@lucidindia.net>; +Cc: Postgre General <pgsql-general@postgresql.org>; pgsql-admin

On Tue, 23 Sep 2003, shreedhar wrote:

> If I try to delete a record from my table which is giving following error
> 
> 
> Warning: PostgreSQL query failed: ERROR: pg_atoi: zero-length string in
> /xxx/database.inc on line 73
> 
> What might be the problem.

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.

-- 
Nigel J. Andrews




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length
  2003-09-23 10:57 PostgreSQL query failed: ERROR: pg_atoi: zero-length string shreedhar <shreedhar@lucidindia.net>
  2003-09-23 11:30 ` Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length Nigel J. Andrews <nandrews@investsystems.co.uk>
@ 2003-09-23 14:52   ` Joshua D. Drake <jd@commandprompt.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Joshua D. Drake @ 2003-09-23 14:52 UTC (permalink / raw)
  To: Nigel J. Andrews <nandrews@investsystems.co.uk>; +Cc: shreedhar <shreedhar@lucidindia.net>; Postgre General <pgsql-general@postgresql.org>; pgsql-admin


>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










^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2003-09-23 14:52 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-09-23 10:57 PostgreSQL query failed: ERROR: pg_atoi: zero-length string shreedhar <shreedhar@lucidindia.net>
2003-09-23 11:14 ` Re: PostgreSQL query failed: ERROR: pg_atoi: zero-length Ron Johnson <ron.l.johnson@cox.net>
2003-09-23 11:30 ` Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length Nigel J. Andrews <nandrews@investsystems.co.uk>
2003-09-23 14:52   ` Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length Joshua D. Drake <jd@commandprompt.com>

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