473,405 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

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
3 3028
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Flash | last post by:
I have been playing with postgresql at home. This is on a fedora core 2 linux box. Here are the packages yum installed: $ rpm -qa | grep postgres postgresql-libs-7.4.2-1...
3
by: Philip Yale | last post by:
A colleague of mine has a query which fails to run under SQLAgent batch with the following error: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime...
0
by: Bill J. | last post by:
I have to update a PostgreSQL linked server through MSSQL2K. I first configured the connection with ODBC as follows and I can do queries with no problem: EXEC sp_droplinkedsrvlogin @rmtsrvname...
0
by: Bill J. | last post by:
I have to update a PostgreSQL linked server through MSSQL2K. I first configured the connection with ODBC as follows and I can do queries with no problem: EXEC sp_droplinkedsrvlogin @rmtsrvname...
19
by: Alex Madon | last post by:
Hello, I am testing a web application (using the DBX PHP function to call a Postgresql backend). I have 375Mb RAM on my test home box. I ran ab (apache benchmark) to test the behaviour of the...
1
by: Robert Morgan | last post by:
|I'm trying to run a query on a database using php and postgres functions ||<?php db_connect(); $stat = pg_exec($connstr,"SELECT WSID from tblWorkstation "); while ($row = pg_fetch_rows($stat))...
2
by: agus liem | last post by:
Hai.. I introduce myself, my name : Agus, from Indonesia. Im develop application using POwerbuilder 7 and postgresql 7.3. I have serveral error, and cannot solve yet. Anybody help me? This is...
3
by: Glen Parker | last post by:
First things first: Postgresql 8.4.2 on Fedora Core 2 X86. Something seems to have happened to my pg_xlog and pg_clog directories after (I believe) a power outage. In the course of trying to...
6
by: rich | last post by:
I am running this SQL statement in php 4.39 to Postgresql 7.3.4 and I keep getting this error Warning: pg_query(): Query failed: ERROR: syntax error at or near "WITHOUT" at character 29 in...
2
by: webhead74 | last post by:
Hi, I'm having intermittent problems with queries from my php script to a postgresql database. I have a form where I can enter a search query - for instance a last name. This leads to a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.