Re: using copy from in function

From: Steve Midgley <public(at)misuse(dot)org>
To: pgsql-sql-owner(at)postgresql(dot)org,pgsql-sql(at)postgresql(dot)org
Subject: Re: using copy from in function
Date: 2008-03-05 17:38:20
Message-ID: 20080305174512.567452E006A@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At 03:20 AM 3/5/2008, pgsql-sql-owner(at)postgresql(dot)org wrote:
>Date: Wed, 5 Mar 2008 01:51:19 +0300
>From: "Yura Gal" <yuragal(at)gmail(dot)com>
>To: pgsql-sql(at)postgresql(dot)org
>Subject: using copy from in function
>Message-ID:
><3b6c69d80803041451i6d4d358dk53e9b789bfacd40e(at)mail(dot)gmail(dot)com>
>
>I'm trying to automate import data using CORY FROM. For this purpose I
>wrote plpgsql function. As my postgres works on windows vista I need
>to use E'' syntax for path-to-file. This syntax works fine in SQL
>queries like:
>COPY table FROM E'path_to_file_with_double_backslashes';
[snip]
> _file := $$c:\folder1\folder2\$$ || _chrom || '.txt';

Hi,

I'm not sure if this is related, but I have had terrible trouble using
"\" marks for paths in WinXP.. I have found surprisingly that "/" work
and don't cause any parsing problems. Also, I believe that if you use
syntax like:

'/folder1/folder2/' || _chrom || '.txt'

(i.e. leaving off the "c:" part too), you may find that everything just
works a little cleaner / fewer unexpected surprises.

Like I said, I don't know if this is your issue (and Vista), but it's
been my experience with WinXP and file paths in Postgresql.

Best,

Steve

Browse pgsql-sql by date

  From Date Subject
Next Message Colin Wetherbee 2008-03-05 17:56:01 Re: finding columns that have three or fewer distinct characters
Previous Message Jeff Frost 2008-03-05 17:33:53 finding columns that have three or fewer distinct characters