agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
tab delimiter in output
6+ messages / 4 participants
[nested] [flat]

* tab delimiter in output
@ 2013-11-25 11:14  Marcin Krawczyk <jankes.mk@gmail.com>
  0 siblings, 3 replies; 6+ messages in thread

From: Marcin Krawczyk @ 2013-11-25 11:14 UTC (permalink / raw)
  To: pgsql-sql

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 ?


regards
mk

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: tab delimiter in output
@ 2013-11-25 11:26  Ian Lawrence Barwick <barwick@gmail.com>
  parent: Marcin Krawczyk <jankes.mk@gmail.com>
  2 siblings, 1 reply; 6+ messages in thread

From: Ian Lawrence Barwick @ 2013-11-25 11:26 UTC (permalink / raw)
  To: Marcin Krawczyk <jankes.mk@gmail.com>; +Cc: pgsql-sql

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


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: tab delimiter in output
@ 2013-11-25 11:42  Thomas Kellerer <spam_eater@gmx.net>
  parent: Marcin Krawczyk <jankes.mk@gmail.com>
  2 siblings, 1 reply; 6+ messages in thread

From: Thomas Kellerer @ 2013-11-25 11:42 UTC (permalink / raw)
  To: pgsql-sql

Marcin Krawczyk, 25.11.2013 12:14:
> 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 ?
> 

Which SQL tool do you use? 
Maybe your SQL client simply doesn't display the tab character? 






-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: tab delimiter in output
@ 2013-11-25 12:00  Marcin Krawczyk <jankes.mk@gmail.com>
  parent: Ian Lawrence Barwick <barwick@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Marcin Krawczyk @ 2013-11-25 12:00 UTC (permalink / raw)
  To: Ian Lawrence Barwick <barwick@gmail.com>; +Cc: 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
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: tab delimiter in output
@ 2013-11-25 12:01  Marcin Krawczyk <jankes.mk@gmail.com>
  parent: Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Marcin Krawczyk @ 2013-11-25 12:01 UTC (permalink / raw)
  To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-sql

This might be the case. I'm using pgAdmin but I can't find anything in it's
configuration.




2013/11/25 Thomas Kellerer <spam_eater@gmx.net>

> Marcin Krawczyk, 25.11.2013 12:14:
> > 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 ?
> >
>
> Which SQL tool do you use?
> Maybe your SQL client simply doesn't display the tab character?
>
>
>
>
>
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: tab delimiter in output
@ 2013-12-02 09:49  seikath <seikath@gmail.com>
  parent: Marcin Krawczyk <jankes.mk@gmail.com>
  2 siblings, 0 replies; 6+ messages in thread

From: seikath @ 2013-12-02 09:49 UTC (permalink / raw)
  To: pgsql-sql

hi Marcin,

try that for two tabs :
select concat('===[' , E'\t\t',']===');
select '===['|| E'\t\t'||']===';

cheers


On 11/25/2013 12:14 PM, Marcin Krawczyk wrote:
> 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 ?
>
>
> regards
> mk



-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2013-12-02 09:49 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-11-25 11:14 tab delimiter in output Marcin Krawczyk <jankes.mk@gmail.com>
2013-11-25 11:26 ` Ian Lawrence Barwick <barwick@gmail.com>
2013-11-25 12:00   ` Marcin Krawczyk <jankes.mk@gmail.com>
2013-11-25 11:42 ` Thomas Kellerer <spam_eater@gmx.net>
2013-11-25 12:01   ` Marcin Krawczyk <jankes.mk@gmail.com>
2013-12-02 09:49 ` seikath <seikath@gmail.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox