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

Started by Doug Knightabout 18 years ago2 messages
#1Doug Knight
dknight@wsi.com
1 attachment(s)

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

Attachments:

example.txttext/plain; charset=UTF-8; name=example.txtDownload
#2Martijn van Oosterhout
kleptog@svana.org
In reply to: Doug Knight (#1)
Re: Windows psql -f load of files with tabs changing to escape sequences

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/

Show quoted text

Those who make peaceful revolution impossible will make violent revolution inevitable.
-- John F Kennedy