Обсуждение: Windows psql -f load of files with tabs changing to escape sequences

Поиск
Список
Период
Сортировка

Windows psql -f load of files with tabs changing to escape sequences

От
Doug Knight
Дата:
All,
I am having a problem loading functions from a text file into postgres on the Windows platform. If the source code stored in the file contains tabs, they get changed to \x09, which causes problems when the function is executed. As an example see attached, which preserves the tabs in the original input file, and shows a condensed version of the \df+ output. Is there a way to force postgres to load the file exactly as is? The command I used to load the function was similar to "psql -U postgres -d test -f func.sql" (func.sql was the name of the original file containing only the CREATE FUNCTION section).

Doug Knight
WSI Corp
Andover, MA USA

Вложения

Re: Windows psql -f load of files with tabs changing to escape sequences

От
Martijn van Oosterhout
Дата:
On Tue, Nov 13, 2007 at 01:59:15PM -0500, Doug Knight wrote:
> All,
> I am having a problem loading functions from a text file into postgres
> on the Windows platform. If the source code stored in the file contains
> tabs, they get changed to \x09, which causes problems when the function
> is executed.

What kind of problems? The encoding is done by psql, just before
display. They're not stored like that in the DB. Can you be more
specific as to the problems?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy