pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark <mark@zserve.com>
To: pgsql-sql@postgresql.org
Subject: bpchar compares (was Re: Case Insensitive Queries)
Date: 30 May 2001 08:59:26 -0600
Message-ID: <200105301551.f4UFpGW16248@mail.ldssingles.com> (raw)

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




view thread (2+ messages)  latest in thread

Message-ID: <200105301551.f4UFpGW16248@mail.ldssingles.com>
Permalink:  ../200105301551.f4UFpGW16248@mail.ldssingles.com/
Also on:    postgresql.org/message-id/200105301551.f4UFpGW16248@mail.ldssingles.com

 · 

reply

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-sql@postgresql.org
  Cc: mark@zserve.com
  Subject: Re: bpchar compares (was Re: Case Insensitive Queries)
  In-Reply-To: <200105301551.f4UFpGW16248@mail.ldssingles.com>

* 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