Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 56CC12E00BF for ; Wed, 5 Mar 2008 13:45:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 81157-02 for ; Wed, 5 Mar 2008 13:45:11 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from starfish.geekisp.com (mail.geekisp.com [216.168.135.169]) by postgresql.org (Postfix) with ESMTP id 567452E006A for ; Wed, 5 Mar 2008 13:45:12 -0400 (AST) Received: (qmail 7266 invoked by uid 1003); 5 Mar 2008 17:38:31 -0000 Received: from adsl-76-253-94-54.dsl.pltn13.sbcglobal.net (HELO dino-1.misuse.org) (public@misuse.org@76.253.94.54) by mail.geekisp.com with (DHE-RSA-AES256-SHA encrypted) SMTP; 5 Mar 2008 17:38:31 -0000 X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Wed, 05 Mar 2008 09:38:20 -0800 To: pgsql-sql-owner@postgresql.org,pgsql-sql@postgresql.org From: Steve Midgley Subject: Re: using copy from in function In-Reply-To: <20080305112312.47C162E01CB@postgresql.org> References: <20080305112312.47C162E01CB@postgresql.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Message-Id: <20080305174512.567452E006A@postgresql.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200803/17 X-Sequence-Number: 30345 At 03:20 AM 3/5/2008, pgsql-sql-owner@postgresql.org wrote: >Date: Wed, 5 Mar 2008 01:51:19 +0300 >From: "Yura Gal" >To: pgsql-sql@postgresql.org >Subject: using copy from in function >Message-ID: ><3b6c69d80803041451i6d4d358dk53e9b789bfacd40e@mail.gmail.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