Return-Path: mer
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA20848; Fri, 10 Jan 92 16:24:19 -0800
Message-Id: <9201110024.AA20848@postgres.Berkeley.EDU>
From: mer@postgres.berkeley.edu (Jeff Meredith)
Subject: clarification on PQgetvalue()
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
Date: Fri, 10 Jan 92 16:21:55 PST


In response to a question about PQexec and PQparray i said the following:

> Second, because the tuple groups and tuples are indexed starting from 0 not 1,
> PQgetvalue() will return NULL and you will die in atoi().
>
> 	*uid = atoi(PQgetvalue(portalbuff,1,1));

However, the last two arguments to PQgetvalue() determine the tuple, and
the attribute.  For example:
	
	pname++ = PQexec("retrieve (foo.oid, foo.a, foo.b)");
	pbuf = PQparray(pname);
	value = PQgetvalue(pbuf, 2, 1);
	
gets attribute b of the third returned tuple.

Sorry for any confusion.


Jeff Meredith
mer@postgres.berkeley.edu
