Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i8foZ-0005aE-FL for pgsql-general@arkaria.postgresql.org; Fri, 13 Sep 2019 07:16:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i8foY-0004X7-AO for pgsql-general@arkaria.postgresql.org; Fri, 13 Sep 2019 07:16:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i8foX-0004Wy-U2 for pgsql-general@lists.postgresql.org; Fri, 13 Sep 2019 07:16:18 +0000 Received: from mout.kundenserver.de ([212.227.126.133]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i8foU-0005uP-SG for pgsql-general@lists.postgresql.org; Fri, 13 Sep 2019 07:16:16 +0000 Received: from [10.8.0.75] ([185.40.248.10]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MWRi7-1haqCO2VbP-00XpKD for ; Fri, 13 Sep 2019 09:16:11 +0200 Subject: Re: PG SQL and LIKE clause References: <20190913052846.GA3070@c720-r342378> From: Thomas Kellerer To: pgsql-general Message-ID: <48e3d88a-3d17-4704-b515-c748e2cebc0a@gmx.net> Date: Fri, 13 Sep 2019 09:16:10 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: <20190913052846.GA3070@c720-r342378> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:nIMQtrPzcQHeddx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C/U+iW BoyGxOsDgKdvG13eYE7V44+YtjvTM9ZPMwwWeoa7i9tsnqF7ONBVLOaEKOWqO5MKRO53t65Bn inwljUgj9s1r9IRoLB6+6nRuNG1JeJNZQepoL9Rqo= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Matthias Apitz schrieb am 13.09.2019 um 07:28: > We're porting a huge Library Management System, written using all kind > of languages one can think of (C, C++, ESQL/C, Perl, Java, ...) on Linux > from the DBS Sybase to PG, millions of lines of code, which works also > with DBS Oracle and in the past with INFORMIX-SE and -ONLINE. > > We got to know that in CHAR columns with trailing blanks a In a nutshell: do not use the CHAR data type (neither in Oracle nor in Postgres) Unless your application actively checks the data type name of columns in a table you can simply change the type of those columns to varchar (or text) and get rid of the annoying (but required) behaviour of the CHAR type. To be honest, I am surprised this didn't show up in Oracle, as I think the CHAR behaviour there is the same as in Postgres. Thomas