RE: libpqeasy cursor error after multiple calls

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: libpqeasy cursor error after multiple calls
Date: 2001-03-21 06:54:00
Message-ID: ECEHIKNFIMMECLEBJFIGIEACCAAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

I don't know but it may be that you're trying to insert a number larger than
maxint?

ie: 2147483648

???

Chris

-----Original Message-----
From: pgsql-hackers-owner(at)postgresql(dot)org
[mailto:pgsql-hackers-owner(at)postgresql(dot)org]On Behalf Of Justin Clift
Sent: Tuesday, 20 March 2001 5:54 PM
To: pgsql-hackers(at)postgresql(dot)org
Subject: [HACKERS] libpqeasy cursor error after multiple calls

Hi all,

I'm just wondering if this is an error on my part, or a bug. I have the
same trouble with PG 7.1beta6 and PG7.1 snapshot (March 8th) on Solaris
8 INTEL, Solaris 8 SPARC and Linux Mandrake 7.2.

When using the libpqeasy library in a C function, I have the following
section of code :

// Get the sequence number for the next directory entry (PostgreSQL
commands)
doquery("BEGIN WORK");
doquery("DECLARE c_getdirid BINARY CURSOR FOR SELECT
nextval('prescan_directories_idnum_seq'::text)");
doquery("FETCH ALL IN c_getdirid");
fetch(&enumdirstruc_p->presentdirid);
doquery("CLOSE c_getdirid");
doquery("COMMIT WORK");

This is called once per entry in a filesystem (this is a filesystem
scanning utility) but after about 1000 or so calls, it errors out and
won't work again. I have to actually DROP the database and re-create it
again before the code will work again at all. Just vacumming doesn't
help, nor does just shutting down the database and starting it again
(doing both and vacuum and restarting the database doesn't help either).

The error message is :

<list of files correctly inserted so far, then>
/archive/install/kde/kdeadmin-2.1/ksysctrl/.cvsignore
NOTICE: PerformPortalFetch: portal "c_getdirid" not found
NOTICE: PerformPortalClose: portal "c_getdirid" not found
Directory query failed, trying again...New directory idnum = -2147483648
(This is my error message from the program)
query error:
failed request: insert into prescan_files(filename, dirent, ownername,
owenerid, groupname, groupid, filesize, os, os_version, package_id)
values ('/archive/install/kde/kdeadmin-2.1/add-on/.cvsignore',
2147483648, 'jclift', 100, 'staff', 10, 21, 1, '8 INTEL', 16777216)
$

I can include the database schema and complete source code if needed,
but I'm just not sure where to start debugging... is it my app or is it
PostgreSQL?

Regards and best wishes,

Justin Clift

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2001-03-21 09:00:01 Encoding problem
Previous Message Bruce Momjian 2001-03-21 05:34:56 Re: libpqeasy cursor error after multiple calls

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2001-03-21 07:30:33 Re: Call for platforms
Previous Message Adriaan Joubert 2001-03-21 06:46:48 Re: Call for platforms