On Sunday 12 January 2003 06:17, Bruce Momjian wrote: > Tom Lane wrote: > > Q: Why do I get strange results with a CHAR(n) field? > > > > A. Don't use CHAR(n). VARCHAR(n) has the behavior you are probably > > expecting; on top of which it's more compact and usually faster. > > > > > > I suppose the above needs some fleshing out, but man am I getting tired > > of explaining about significant vs non-significant trailing blanks. > > OK, good point. I was mentioning CHAR() in the FAQ entry first, while > it should have been mentioned later. I also added a specific mention of > the trailing spaces issue. Patch attached.
Err, from the patch: "CHAR(n) stores trailing spaces, while VARCHAR(n) trims them." Surely this should read something like: "CHAR(n) automatically pads strings with trailing blanks to the defined column length." Ian Barwick [EMAIL PROTECTED] ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])