Re: psql -F problems - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: psql -F problems
Date
Msg-id Pine.LNX.4.44.0302231728020.1618-100000@peter.localdomain
Whole thread Raw
In response to psql -F problems  (Hubert depesz Lubaczewski <depesz@depesz.pl>)
Responses Re: psql -F problems
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: psql -F problems
Next
From: Josh Berkus
Date:
Subject: Re: [SQL] 7.3 GROUP BY differs from 7.2