are cursors necessary?

From: Mark Harrison <mh(at)pixar(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: are cursors necessary?
Date: 2003-12-04 22:46:32
Message-ID: 3FCFB948.90100@pixar.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In the program testlibpq.c, these five SQL statements are executed:

res = PQexec(conn, "BEGIN");
res = PQexec(conn, "DECLARE myportal CURSOR FOR select * from pg_database");
res = PQexec(conn, "FETCH ALL in myportal");
res = PQexec(conn, "CLOSE myportal");
res = PQexec(conn, "END");

Is this just to illustrate how to create transactions and cursors, or is there
some material difference between trimming the program down to just:

res = PQexec(conn, "select * from pg_database");

Is there any value in my own query-only programs to declaring the cursor
for each search?

Many TIA,
Mark

--
Mark Harrison
Pixar Animation Studios

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Browne 2003-12-04 23:27:57 Re: are cursors necessary?
Previous Message Arjen van der Meijden 2003-12-04 22:44:07 Re: Making a tree with "millions and millions" of dynamic nodes