Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA23397; Wed, 7 Apr 93 07:14:56 -0700
Date: Wed, 7 Apr 93 07:14:56 -0700
Message-Id: <9304071414.AA23397@postgres.Berkeley.EDU>
From: rodrigo@cmf.nrl.navy.mil
Subject: Get char value using PQgetvalue
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu


I am using libpq and have a char attribute in a relation, call it "aband". 

If I do on the monitor 

	retrieve (p.all) from p in table where p.aband = "A"\g

all works well. The query also works fine within the C program. 

However, in my application, I am trying to get the value of the character 
when I retrieved all the tuples using as usual 
	PQgetvalue(portalbuf, tupno, number)

I have tried: dereference to char, printf with %c, sprintf, and a 
bunch of other stuff. I know I am doing something really stupid, but 
could somebody tell how I get the character in question. 

I tried the obvious :

	char *str;

	str = (char *) PQgetvalue(portalbuf, tupno, number);

	printf("%c\n", str[0]);

and that didnt work. 

Any help will be greatly appreciated. 

rodrigo@cmsun.cmf.nrl.navy.mil
