Re: psql -P doesn't honor backslash escapes

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: mhh(at)mindspring(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: psql -P doesn't honor backslash escapes
Date: 2000-10-06 15:58:07
Message-ID: Pine.LNX.4.21.0010061753010.949-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

pgsql-bugs(at)postgresql(dot)org writes:

> The interactive command psql command:
> \pset fieldsep '\t'
> can be used to set the field separator to a tab character.
>
> The equivalent commandline option:
> psql -P fieldsep='\t'
> sets it to the literal '\t'

The expansion of \t to tab is done by the parser that processes the input
lines. If you pass arguments on the command line, it doesn't apply.
That might seem odd, but it's consistent with behaviour of regular shells.
E.g.,

$ sh -c "echo $FOO" # The $FOO is expanded by the current shell.

$ sh
$ echo $FOO # The $FOO is expanded by the subshell.

So, to pass a tab via the psql command line, you have to convince your
shell to do it.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Vince Vielhaber 2000-10-06 16:03:07 Re: email addresses at http://www.postgresql.org/bugs/index.php
Previous Message Mikhail Teterin 2000-10-06 15:37:24 email addresses at http://www.postgresql.org/bugs/index.php