Skip site navigation (1) Skip section navigation (2)

RE: [INTERFACES] (libpq question) Holy cow, what's all this fluff?!

From: Michael Davis <michael(dot)davis(at)prevuenet(dot)com>
To: pgsql-interfaces(at)postgreSQL(dot)org
Subject: RE: [INTERFACES] (libpq question) Holy cow, what's all this fluff?!
Date: 1999-02-14 00:09:53
Message-ID: (view raw or whole thread)
Lists: pgsql-interfaces
You could trim(field).

	-----Original Message-----
	From:	Matthew Hagerty [SMTP:matthew(at)venux(dot)net]
	Sent:	Saturday, February 13, 1999 4:35 PM
	To:	pgsql-interfaces(at)postgreSQL(dot)org
	Subject:	[INTERFACES] (libpq question) Holy cow, what's all
this fluff?!


	When using the PQgetvalue() function of libpq, the results, at least
	fields, return the value in full, i.e. a char(20) field with the
	"Matthew" for example returns "Matthew             " (all 20
	padded with spaces).

	I'm sure there is a good reason for this?  But, none the less, I
would like
	to turn it off if I can, otherwise I'm off to writing a small
function to
	strip the spaces off.  This is kind of a pain though because I don't
	to modify the values, just display them, or fill a browser's form
	with values from the database (which is my biggest need to strip the
	fluff).  The docs say that I should not access the structure holding
	results, so I will have to malloc each value, copy it, strip the
	send it out on its way, and release the memory.  More housekeeping,
	Not to mention more processing time.  Please tell me there is a way
to get
	field values with libpq that are exact to the content length and not
	field length.


pgsql-interfaces by date

Next:From: Thomas G. LockhartDate: 1999-02-14 04:26:57
Subject: Re: [INTERFACES] NT Port
Previous:From: Michael DavisDate: 1999-02-14 00:06:08
Subject: Access 97 and datatypes

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group