Subject: Get char value using PQgetvalue

From: [email-masked]
Date: Wed, 7 Apr 93 07:14:56 -0700

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. 

[email-masked]