[JDBC] Using char fields with 7.1.3 driver

2001-09-06 Thread jeffdavey
I've found after using a CMP J2EE entity bean, along with the 7.1.3 jdbc driver, queries return the entire char field back while using char(), but varchar returns just the value of the field back. for example, create table test_table( id integer primary key not null, name varchar(255) ); vs.

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

2001-09-06 Thread jeffdavey
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

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

2001-09-06 Thread jeffdavey
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

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

Re: [JDBC] Using char fields with 7.1.3 driver

2001-09-06 Thread David Wall
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

Re: [JDBC] Using char fields with 7.1.3 driver

2001-09-06 Thread Bruce Momjian
I can easily get around this using .trim(), but I'm wondering if that should be in the jdbc driver itself (as I'll have to go through a bit of code looking for string values being returned). char() is fixed length, varchar isn't. Or is this something in the database software itself that