Re: tab delimiter in output - Mailing list pgsql-sql

From Marcin Krawczyk
Subject Re: tab delimiter in output
Date
Msg-id CABnqL323mnF0UAUo2zw=PSvcF8Z4y_U9bupGsKP0Z7-SKBR51Q@mail.gmail.com
Whole thread Raw
In response to Re: tab delimiter in output  (Ian Lawrence Barwick <barwick@gmail.com>)
List pgsql-sql
Thanks, but it didn't change the output.


2013/11/25 Ian Lawrence Barwick <barwick@gmail.com>
2013/11/25 Marcin Krawczyk <jankes.mk@gmail.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

pgsql-sql by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: tab delimiter in output
Next
From: Marcin Krawczyk
Date:
Subject: Re: tab delimiter in output