Re: How to concat strings so that trailing spaces remain

From: "Andrus" <eetasoft(at)online(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to concat strings so that trailing spaces remain
Date: 2006-03-31 09:29:43
Message-ID: e0isv9$24hf$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> If you think that trailing spaces are significant data, you should
> probably be using VARCHAR not CHAR datatype.

I have existing database where there are only CHAR columns, no any VARCHAR
column.
I'm not sure will my appl work if I change all char columns to varchar
columns .
Is it reasonable to change all occurences of CHAR to VARCHAR in database ?

Are the following clauses exactly same for fields of type CHAR(10):

WHERE r1.c1::VARCHAR(10) || r1.c2::VARCHAR(10) || r1.c3::VARCHAR(10) >=
r2.c1::VARCHAR(10) || r2.c2::VARCHAR(10) ||
r2.c3::VARCHAR(10)

and

WHERE r1.c1>=r2.c1 and r1.c2>=r2.c2 and r1.c3>=r2.c3

and

WHERE (r1.c1, r1.c2,r1.c3) >= (r2.c1, r2.c2,r2.c3)

Andrus.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martin Pohl 2006-03-31 10:17:39 How to delete all operators
Previous Message Dave Page 2006-03-31 09:17:58 Re: FAQ 1.1