pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Volker Paul <vpaul@dohle.com>
To: pgsql-sql@postgresql.org
Subject: C/C++ interface
Date: Tue, 13 Feb 2001 13:10:27 +0100
Message-ID: <3A892433.879F40A0@dohle.com> (raw)

Hello,

in the C interface documentation there is an example using:

    res = PQexec(conn, "DECLARE mycursor CURSOR FOR select * from
pg_database");
    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");

...etc. So the statements are:

DECLARE mycursor CURSOR FOR select * from pg_database;
FETCH ALL in mycursor;

What's the difference between this and simply doing:
select * from pg_database;

I tried this in psql, the result seemed the same.

What I'm really using, however, is the C++ interface.
Its documentation is not yet complete.
There, too, I tried a version with and without cursor.
The result seems to be the same, but returned int is always 0
for the version without cursor, so I get no information whether
the query succeeded. 

Is someone maintaining the C++ interface and its documentation?


Thanks,

Volker Paul



view thread (6+ messages)  latest in thread

Message-ID: <3A892433.879F40A0@dohle.com>
Permalink:  ../3A892433.879F40A0@dohle.com/
Also on:    postgresql.org/message-id/3A892433.879F40A0@dohle.com

 · 

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: vpaul@dohle.com, pgsql-sql@postgresql.org
  Subject: Re: C/C++ interface
  In-Reply-To: <3A892433.879F40A0@dohle.com>

* 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