From: Tom Lane <tgl@sss.pgh.pa.us>
To: Matthew Hagerty <matthew@venux.net>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] (libpq question) Holy cow, what's all this fluff?!
Date: Sun, 14 Feb 1999 13:45:18 -0500
Message-ID: <7750.919017918@sss.pgh.pa.us> (raw)
In-Reply-To: <4.1.19990214001552.009894c0@mail.venux.net>
Matthew Hagerty <matthew@venux.net> writes:
> At 04:30 AM 2/14/99 +0000, Thomas G. Lockhart wrote:
>>> You want a varchar (or is it bpchar?), not a char. char(x) will always
>>> return x characters, with space padding if necessary.
> Yeah, but the docs say you get a performance hit for using varchar, text,
> and the like. Which is worse, the database performance hit or the extra
> call to trim for every char field?
Whatever docs you are looking at are obsolete. char(n), varchar(n), and
text have essentially interchangeable performance and representation.
They all have a length word and some characters.
(I've griped about that myself --- particularly that plain "char" is
effectively an 8-byte field, not a 1-byte field like you'd expect.
Nobody else seems worried about it though.)
I'd recommend using "text", personally, unless you have a specific
reason for imposing an upper length limit on the string.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, matthew@venux.net
Subject: Re: [INTERFACES] (libpq question) Holy cow, what's all this fluff?!
In-Reply-To: <7750.919017918@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox