Should there be a charcat?

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Should there be a charcat?
Date: 2006-10-06 19:28:26
Message-ID: 20061006192826.GV72517@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Column | Type | Modifiers
--------+---------------+-----------
c | character(20) |

decibel=# select c, c || ('x'::char) from c;
c | ?column?
----------------------+----------
x | xx

I would think that c || 'x' would result in 'x x', but it doesn't because the only text concatenation function we have is textcat(text,
text). As soon as you cast a char to text, you lose all the trailing spaces.

Is this what the spec says should happen?
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-10-06 20:10:42 Re: Should there be a charcat?
Previous Message Oleg Bartunov 2006-10-06 19:23:23 Re: Backbranch releases