2013/11/25 Marcin Krawczyk <jankes(dot)mk(at)gmail(dot)com>:
> Hi,
>
> I need to return concatenated columns separated by tab character and I can't
> get it to work. Here's what I tried:
>
> SELECT concat('aa', '\t', 'bb');
> SELECT concat('aa', CHR(9), 'bb');
> SELECT 'aa' || CHR(9) || 'bb';
> SELECT 'aa' || '\t' || 'bb';
>
> I get "aabb" instead of "aa bb" in all cases. Is this a configuration
> issue ?
Try:
SELECT 'aa' || E'\t' || 'bb';
http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS-ESCAPE
Regards
Ian Barwick