Hubert depesz Lubaczewski writes:
> i belive this kind of information - given from command line - should be
> parsed again in psql itself - just like it is parsed when you enter
> something at psql prompt.
The command line parser inside psql works pretty much like a Unix shell.
That means quoting and escaping is resolved *before* the arguments are
passed to the command. So when you enter
\f '\t'
then the parser resolves this as two tokens: the first is <backslash><f>
and the second is <tab character>. The \f command and ultimately the
routine that sets the field separator have nothing to do with that.
I believe this design is ok, even though it creates apparent
inconsistencies. If you make it behave like you appear to imagine, then
you need to double-escape certain characters in situations where other
users might not expect it.
--
Peter Eisentraut peter_e@gmx.net