Re: PG SQL and LIKE clause - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: PG SQL and LIKE clause
Date
Msg-id 48e3d88a-3d17-4704-b515-c748e2cebc0a@gmx.net
Whole thread Raw
In response to PG SQL and LIKE clause  (Matthias Apitz <guru@unixarea.de>)
List pgsql-general
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
thosecolumns 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




pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: PG SQL and LIKE clause
Next
From: Ayub M
Date:
Subject: Re: pgbouncer with ldap