How to concat strings so that trailing spaces remain

From: "Andrus" <eetasoft(at)online(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: How to concat strings so that trailing spaces remain
Date: 2006-03-30 18:30:58
Message-ID: e0h85d$u49$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have where clause where all fields are CHAR(10) type and may have trailing
spaces.

SELECT ...

FROM r1, r2

WHERE r1.c1 || r1.c2 || r1.c3 >= r2.c1 || r2.c2 || r2.c3;

This WHERE clause produces wrong result since || operator removes trailing
spaces.

Correct result is produced if || operator does not remove trailing spaces.

How to concat strings in this expression so that trailing spaces are
significiant or how to re-write this join condition so that trailing spaces
are used for comparison?

Andrus.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Don Y 2006-03-30 18:51:41 User defined data type
Previous Message Christopher Condit 2006-03-30 17:26:58 Re: pgsql and streams