Re: String concatenation operator which keeps trailing spaces in CHAR(n) columns

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Andrus <kobruleht2(at)hot(dot)ee>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: String concatenation operator which keeps trailing spaces in CHAR(n) columns
Date: 2014-07-31 13:17:04
Message-ID: CAHyXU0z3Fj_dk=P9KqHDhpRKn2T3Nwk+cWLttfwO8OESH8Qi-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jul 30, 2014 at 5:43 AM, Andrus <kobruleht2(at)hot(dot)ee> wrote:
> How to create string concatenation operator which preserves trailing spaces
> on CHAR(n) type columns ?

hm, why do that at all? how about avoid the char() type and create
views over tables using rpad when you want space padding:

create view v_foo as
select *, rpad(f, 50, ' ') as f_padded;

merlinm

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2014-07-31 13:18:45 Re: What query currently running within function
Previous Message Kevin Grittner 2014-07-31 13:13:58 Re: Inconsistent results postgresql