By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,933 Members | 1,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,933 IT Pros & Developers. It's quick & easy.

PostgreSQL query failed: ERROR: pg_atoi: zero-length string

P: n/a
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
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 11 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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. ro***********@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.
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 11 '05 #2

P: n/a
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
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 11 '05 #3

P: n/a
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


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.