Can not get large cursor for PGLIB ???

From: "TONY J(dot)Y(dot)" <tjiang(at)mrf(dot)com>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: Can not get large cursor for PGLIB ???
Date: 2001-12-05 22:48:52
Message-ID: 006901c17ddf$03318300$7a01a8c0@Aqua.MRF
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-interfaces pgsql-patches

Hi all,

I am using the PGLIB C lib to connect to PgSql to finish the query of
the GEOMETRY of a table.

At first, everything was OK. I could insert, update, delete and select of
whatever I wanted while the geometry data was small one.

So I wanted to try a bigger one. I uploaded a ESRI shape file into database
which was in the attachment --- Canada.sql. Then I tried the query.

res = PQexec(conn, "DECLARE mycursor BINARY CURSOR FOR select gid, name,
asbinary(the_geom) from canada");

if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
{
fprintf(stderr, "DECLARE CURSOR command failed\n");
PQclear(res);
exit_nicely(conn);
}
PQclear(res);

res = PQexec(conn, "FETCH ALL in mycursor");
if (!res || PQresultStatus(res) != PGRES_TUPLES_OK)
{
fprintf(stderr, "FETCH ALL command didn't return tuples
properly\n");
PQclear(res);
exit_nicely(conn);
}

Then I got the error when try to "FETCH ALL in mycursor".

Could you help me to figure out the problem? Thanks. I have attached
the files needed for you.

Best regards,
Tony

---
Tony Jiang, MSc
Research & Development Programmer/Analyst
MRF Geosystems Corp (www.mrf.com)
Suite 700, 665 8th Street SW,
Calgary, AB T2P 3K7
(403) 216-5515 ext:226

Attachment Content-Type Size
main.cpp application/octet-stream 4.5 KB
canada.sql application/octet-stream 613.2 KB

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2001-12-05 23:09:26 Re: <application> vs <command>
Previous Message Jan Wieck 2001-12-05 21:44:07 Re: Cant load pgtclsh library into application

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tim Barnard 2001-12-06 15:51:42 Re: C interface libpq.so.2 problem
Previous Message Jan Wieck 2001-12-05 21:44:07 Re: Cant load pgtclsh library into application

Browse pgsql-patches by date

  From Date Subject
Next Message Karel Zak 2001-12-06 09:03:22 Re: date formatting and tab-complete patch
Previous Message Jan Wieck 2001-12-05 21:44:07 Re: Cant load pgtclsh library into application