pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: TONY J.Y. <tjiang@mrf.com>
To: pgsql-interfaces@postgresql.org
Subject: Can not get large cursor  for PGLIB ???
Date: Wed, 5 Dec 2001 15:48:52 -0700
Message-ID: <006901c17ddf$03318300$7a01a8c0@Aqua.MRF> (raw)
References: <200112052144.fB5Li7e02083@saturn.jw.home>

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

Attachments:

  main.cpp (application/octet-stream, 4.5K) download

  canada.sql (application/octet-stream, 613.2K) download

Message-ID: <006901c17ddf$03318300$7a01a8c0@Aqua.MRF>
Permalink:  ../006901c17ddf$03318300$7a01a8c0@Aqua.MRF/
Also on:    postgresql.org/message-id/006901c17ddf$03318300$7a01a8c0@Aqua.MRF

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: tjiang@mrf.com, pgsql-interfaces@postgresql.org
  Subject: Re: Can not get large cursor  for PGLIB ???
  In-Reply-To: <006901c17ddf$03318300$7a01a8c0@Aqua.MRF>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox