Received: from redbox.venux.net (redbox.venux.net [216.47.238.10]) by hub.org (8.9.2/8.9.1) with ESMTP id SAA60281 for ; Sat, 13 Feb 1999 18:33:56 -0500 (EST) (envelope-from matthew@venux.net) Received: from thunder (net177138.hcv.com [209.153.177.138]) by redbox.venux.net (Postfix) with SMTP for id 718412E210; Sat, 13 Feb 1999 18:34:13 -0500 (EST) Message-Id: <4.1.19990213182304.0095d400@mail.venux.net> X-Sender: mhagerty@mail.venux.net X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1 Date: Sat, 13 Feb 1999 18:35:20 -0500 To: pgsql-interfaces@postgreSQL.org From: Matthew Hagerty Subject: (libpq question) Holy cow, what's all this fluff?! Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Greetings, When using the PQgetvalue() function of libpq, the results, at least char fields, return the value in full, i.e. a char(20) field with the text "Matthew" for example returns "Matthew " (all 20 characters, 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 need to modify the values, just display them, or fill a browser's form fields 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 query results, so I will have to malloc each value, copy it, strip the fluff, send it out on its way, and release the memory. More housekeeping, yuck! 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 the field length. Thanks, Matthew