dbTalk Databases Forums  

Re: [BUGS] row number -1 is out of range 0..-1

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] row number -1 is out of range 0..-1 in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: [BUGS] row number -1 is out of range 0..-1 - 06-28-2005 , 08:00 AM






On Tue, Jun 28, 2005 at 03:11:03PM +0300, Bobi Ivanov wrote:
Quote:
I get this message 'row number -1 is out of range 0..-1' sometimes.
I say sometimes, because this happens unexpected when I submit absolutely
correct query. Query succeeds, but it returns no resul although there should be.
The above error happens if a program calls PQgetvalue(), PQgetlength(),
or PQgetisnull() with a row number of -1 and if there were no rows
in the result. Are you calling those libpq functions directly, or
are you using an interface that sits on top of libpq? If the latter,
what interface and version are you using? What version of PostgreSQL?
What does your code look like?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
  #2  
Old   
Bobi Ivanov
 
Posts: n/a

Default Re: [BUGS] row number -1 is out of range 0..-1 - 06-28-2005 , 08:09 AM







Thank you for your quick responce! I don't call them directly. I use pgsql
8.0.3 under
Fedora Core and I'm writing queries through pgAdminIII. This is the query
that produces it:

select
billingplans_freetalktime.id, billingplans_freetalktime.seconds,
billingplans_freetalktime.accumulate, billingplans_freetalktime.period
from (billingplans_freetalktime inner join tariffs
on billingplans_freetalktime.tariff_id = tariffs.id_tariff)
where billingplans_freetalktime.plan_id = 5
and '3597' like tariffs.prefix||'%'
order by length(tariffs.prefix) desc;

and I get this:


row number -1 is out of range 0..-1
Total query runtime: 40 ms.
Data retrieval runtime: 60 ms.
0 rows retrieved.

I'll be glad if you can tell me how can I fix it. Do you know patch or
something?

-Bobi Ivanov


----- Original Message -----
From: "Michael Fuhr" <mike (AT) fuhr (DOT) org>
To: "Bobi Ivanov" <bobi (AT) exsisto (DOT) com>
Cc: <pgsql-bugs (AT) postgresql (DOT) org>
Sent: Tuesday, June 28, 2005 3:58 PM
Subject: Re: [BUGS] row number -1 is out of range 0..-1


Quote:
On Tue, Jun 28, 2005 at 03:11:03PM +0300, Bobi Ivanov wrote:

I get this message 'row number -1 is out of range 0..-1' sometimes.
I say sometimes, because this happens unexpected when I submit absolutely
correct query. Query succeeds, but it returns no resul although there
should be.

The above error happens if a program calls PQgetvalue(), PQgetlength(),
or PQgetisnull() with a row number of -1 and if there were no rows
in the result. Are you calling those libpq functions directly, or
are you using an interface that sits on top of libpq? If the latter,
what interface and version are you using? What version of PostgreSQL?
What does your code look like?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/


__________ NOD32 1.1155 (20050626) Information __________

This message was checked by NOD32 antivirus system.
http://www.nod32.com



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #3  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: [BUGS] row number -1 is out of range 0..-1 - 06-28-2005 , 08:40 AM



On Tue, Jun 28, 2005 at 04:07:33PM +0300, Bobi Ivanov wrote:
Quote:
Thank you for your quick responce! I don't call them directly. I use pgsql
8.0.3 under Fedora Core and I'm writing queries through pgAdminIII.
How consistently do you get the error? What happens if you run the
query in psql?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
  #4  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] row number -1 is out of range 0..-1 - 06-28-2005 , 10:40 AM



"Bobi Ivanov" <bobi (AT) exsisto (DOT) com> writes:
Quote:
Thank you for your quick responce! I don't call them directly. I use pgsql
8.0.3 under
Fedora Core and I'm writing queries through pgAdminIII.
I would say then that this is a pgAdmin bug, and should be reported on
the pgAdmin mailing lists --- I'm not sure that any of the pgAdmin
hackers read this list.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
  #5  
Old   
Andreas Pflug
 
Posts: n/a

Default Re: [BUGS] row number -1 is out of range 0..-1 - 06-28-2005 , 12:24 PM



Tom Lane wrote:
Quote:
"Bobi Ivanov" <bobi (AT) exsisto (DOT) com> writes:

Thank you for your quick responce! I don't call them directly. I use pgsql
8.0.3 under
Fedora Core and I'm writing queries through pgAdminIII.


I would say then that this is a pgAdmin bug, and should be reported on
the pgAdmin mailing lists --- I'm not sure that any of the pgAdmin
hackers read this list.
I do read the list, though I missed it initially.
I doubt it's a pgadmin bug, but let's see the query first.

Regards,
Andreas

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.