pg.ddx.io pgsql-sql@postgresql.org mailing list archivehelp / color / mirror / Atom feed
bpchar compares (was Re: Case Insensitive Queries) 2+ messages / 2 participants [nested] [flat]
* bpchar compares (was Re: Case Insensitive Queries) @ 2001-05-30 14:59 Mark <mark@zserve.com> 2001-05-30 17:34 ` Re: bpchar compares (was Re: Case Insensitive Queries) Richard Huxton <dev@archonet.com> 0 siblings, 1 reply; 2+ messages in thread From: Mark @ 2001-05-30 14:59 UTC (permalink / raw) To: pgsql-sql It appears that the behavior of a bpchar compare with a string literal is not implicitly trimming the bpchar before the compare, which IMHO is incorrect behavior. Is my opinion valid? If so, how difficult of a fix would this be in terms of time and effort? Should I submit a bug report to another list, or is a developer receiving this? Is this a feature? This is an important issue for me, because I am converting a db from MS SQL to postgresql. The MS SQL database uses bpchar (or just char in MS SQL terms) because performance is slightly better; the compares automatically trim the blanks off of the char at compare time. I have over 150 tables to work with, and I would rather not have to change them from bpchar to varchar, not to mention the performance decrease this might incur. You might be thinking, 'just use trim(username) everywhere you compare'. Yes, that is a solution, but not a practical one in my case. If this is a bug, I don't want to hack around it: I'd rather wait for the fix. Varchars would incur performance penalties I want to try to avoid if at all possible. Thanks, Mark ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: bpchar compares (was Re: Case Insensitive Queries) 2001-05-30 14:59 bpchar compares (was Re: Case Insensitive Queries) Mark <mark@zserve.com> @ 2001-05-30 17:34 ` Richard Huxton <dev@archonet.com> 0 siblings, 0 replies; 2+ messages in thread From: Richard Huxton @ 2001-05-30 17:34 UTC (permalink / raw) To: Mark <mark@zserve.com>; pgsql-sql From: "Mark" <mark@zserve.com> > It appears that the behavior of a bpchar compare with a string literal > is not implicitly trimming the bpchar before the compare, which IMHO is > incorrect behavior. Is my opinion valid? If so, how difficult of a fix > would this be in terms of time and effort? Should I submit a bug report > to another list, or is a developer receiving this? Is this a feature? bpchar==char==fixed, space padded AFAIK which means correct behaviour > This is an important issue for me, because I am converting a db from MS > SQL to postgresql. The MS SQL database uses bpchar (or just char in MS > SQL terms) because performance is slightly better; the compares > automatically trim the blanks off of the char at compare time. I have > over 150 tables to work with, and I would rather not have to change them > from bpchar to varchar, not to mention the performance decrease this > might incur. Surely it's just a search & replace. No noticable performance issues with char vs varchar that I've found. > You might be thinking, 'just use trim(username) everywhere you compare'. > Yes, that is a solution, but not a practical one in my case. If this is > a bug, I don't want to hack around it: I'd rather wait for the fix. > Varchars would incur performance penalties I want to try to avoid if at > all possible. Try some testing with varchar - I'm not sure you are going to suffer much. - Richard Huxton ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-05-30 17:34 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2001-05-30 14:59 bpchar compares (was Re: Case Insensitive Queries) Mark <mark@zserve.com> 2001-05-30 17:34 ` Richard Huxton <dev@archonet.com>
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