Re: Insert path fails

From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: Steven Sluter <loverman(at)sidehack(dot)gweep(dot)net>, pgsql-odbc(at)postgresql(dot)org
Subject: Re: Insert path fails
Date: 2003-01-12 17:36:47
Message-ID: 20030112173647.62594.qmail@web20809.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

--- Steven Sluter <loverman(at)sidehack(dot)gweep(dot)net> wrote:
> Hello-
>
> I am running PostgreSQL 7.2.1 on
> i386-portbld-freebsd4.6. I'm connecting
> from a program on windows nt 4.0, using the
> 7.02.00.05 ver. of PGSQL-ODBC
> drivers.
>
> When I try to insert a windows UNC path:
>
> \\RAID\Raid\control tiffs\50_gray.tif
>
>
> into the database, I end up with this:
>
> \RAIDRaidcontrol tiffs(_gray.tif

The backslash is an escape character in PostgreSQL,
and is stripped off at parsing time. Your
alternatives are:
* Double every backslash you want to preserve, i.e.
\\\\RAID\\Raid\\control tiffs\\50_gray.tif
* Add extra quotes (a mess, don't even try it)
* Use the quote_literal() function, which causes
PostgreSQL to accept the text as-is: e.g.
INSERT INTO <table> (<field>) VALUES
quote_literal('text goes here')

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Christina 2003-01-13 05:13:15
Previous Message Hiroshi Inoue 2003-01-12 13:33:16 Re: Insert path fails