pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthias Apitz <guru@unixarea.de>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: PG SQL and LIKE clause
Date: Fri, 13 Sep 2019 08:48:59 +0200
Message-ID: <20190913064859.GA252643@sh4-5.1blu.de> (raw)
In-Reply-To: <CAFj8pRAeL8CyY9bsjVL=4yw5mUAtDkJu6NdTdVSMXQxEsdqspg@mail.gmail.com>
References: <20190913052846.GA3070@c720-r342378>
	<CAFj8pRAeL8CyY9bsjVL=4yw5mUAtDkJu6NdTdVSMXQxEsdqspg@mail.gmail.com>

El día Friday, September 13, 2019 a las 07:33:10AM +0200, Pavel Stehule escribió:

> > We got to know that in CHAR columns with trailing blanks a
> >
> > SELECT ... FROM ... WHERE name LIKE 'Ali'
> >
> > does not match in 'name' having 'Ali '.
> >
> > I glanced through our code with grep pipelines and found some hundred
> > places which would be affected by this problem. I'm not interested in a
> > religious discussion if or if not this behaviour of PG is correcter or
> > better than in Sybase. It's just different to Sybase.
> >
> > Any hints to address this problem? Or is there any compile time option
> > for the PG server to address this?
> >
> 
> There is not simple solution - you should to write own patch and used
> patched postgres.

Hello,

As we compiled our own PG 11.4 and as we're alone on the server with
our software plus PG, this could be an option to consider.

Do you have an idea where to look for this in the PG source. Maybe it's
just deleting the trailing blanks from the column content before applying
the string compare with regular expressions.

Thanks

	matthias
-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
May, 9: Спаси́бо освободители! Thank you very much, Russian liberators!





view thread (11+ messages)  latest in thread

Message-ID: <20190913064859.GA252643@sh4-5.1blu.de>
Permalink:  ../20190913064859.GA252643@sh4-5.1blu.de/
Also on:    postgresql.org/message-id/20190913064859.GA252643@sh4-5.1blu.de

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: guru@unixarea.de, pavel.stehule@gmail.com
  Subject: Re: PG SQL and LIKE clause
  In-Reply-To: <20190913064859.GA252643@sh4-5.1blu.de>
  References: <20190913052846.GA3070@c720-r342378> <CAFj8pRAeL8CyY9bsjVL=4yw5mUAtDkJu6NdTdVSMXQxEsdqspg@mail.gmail.com> <20190913064859.GA252643@sh4-5.1blu.de>

* 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