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

From: "Bobi Ivanov" <bobi(at)exsisto(dot)com>
To: "Michael Fuhr" <mike(at)fuhr(dot)org>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: row number -1 is out of range 0..-1
Date: 2005-06-28 13:07:33
Message-ID: 014c01c57be2$60b97780$3202a8c0@pi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


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

> 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
>
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Fuhr 2005-06-28 13:35:33 Re: row number -1 is out of range 0..-1
Previous Message Szűcs Gábor 2005-06-28 13:05:12 Select on pkey returned more than one row