Re: [Fwd: Re: [JDBC] Using char fields with 7.1.3 driver]

2001-09-06 Thread Tom Lane

<[EMAIL PROTECTED]> writes:
> Just I usually prefer using fixed field lengths as queries tend to be
> significantly faster. Also, you can use them in indexes.

You are making assumptions based on other databases that are not
relevant to Postgres.

> And it leads me to wonder how you would represent an ending  "space" in a
> field,

In varchar or text fields, trailing spaces are real data.  In
fixed-width char fields, trailing spaces are pads.  AFAIK this is
consistent with the SQL92 specification.

regards, tom lane

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[Fwd: Re: [JDBC] Using char fields with 7.1.3 driver]

2001-09-06 Thread jeffdavey

Hmm.. ok.

Just I usually prefer using fixed field lengths as queries tend to be
significantly faster. Also, you can use them in indexes.

I find it strange that that would be the case...

And it leads me to wonder how you would represent an ending  "space" in a
field,


for example
insert into names values(1,'This is a space');

for perhaps some sort of formatting or something otherwise.

I'll try and find something in the postgres documentation to disable this
then I guess.


-Jeff

 Original Message 
Subject: Re: [JDBC] Using char fields with 7.1.3 driver
From: "David Wall" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>

I'm not a JDBC expert, but this is pretty much the way I'd expect it to
work.  If you a have fixed length field, then the field should return
that many characters.  The varchar implies it's variable length, so
trailing spaces would then not be included.

David


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly




---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]