Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 2F93D9FB507 for ; Sun, 11 Feb 2007 20:10:17 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 13591-07 for ; Sun, 11 Feb 2007 20:10:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from rrmailscan3.safenetbox.biz (unknown [203.25.40.75]) by postgresql.org (Postfix) with ESMTP id 8D4C29FB505 for ; Sun, 11 Feb 2007 20:10:11 -0400 (AST) Received: from rrmailscan3.safenetbox.biz (rrmailscan3.safenetbox.biz [127.0.0.1]) by rrmailscan3.safenetbox.biz (Postfix) with ESMTP id E67491D4846D; Mon, 12 Feb 2007 11:10:24 +1100 (EST) Received: from [172.17.2.14] (online4-new.lnk.telstra.net [139.130.169.227]) (Authenticated sender: remote) by rrmailscan3.safenetbox.biz (Postfix) with ESMTP id 012471D48439; Mon, 12 Feb 2007 11:10:23 +1100 (EST) Message-ID: <45CFB024.7040207@autoledgers.com.au> Date: Mon, 12 Feb 2007 09:09:08 +0900 From: Paul Lambert User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: Joe CC: pgsql-sql@postgresql.org Subject: Re: COPY FROM query. References: <45CFA478.5020505@autoledgers.com.au> <1171238135.783.2.camel@pampa> In-Reply-To: <1171238135.783.2.camel@pampa> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.12 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200702/133 X-Sequence-Number: 27467 Joe wrote: > Hi Paul, > > On Mon, 2007-02-12 at 08:19 +0900, Paul Lambert wrote: >> I'm attempting to copy from a table into a file using a select query >> inside the copy. >> >> The following is my command: >> >> COPY (SELECT DISTINCT ON (dealer_id,appraisal_id) * FROM >> appraisals_temp) TO 'c:\autodrs_appraisal_new.txt' WITH DELIMITER AS '^' >> CSV HEADER; >> >> I get the following returned: >> >> WARNING: nonstandard use of escape in a string literal >> LINE 1: ...ealer_id,appraisal_id) * FROM appraisals_temp) TO 'C:\autodr... >> ^ >> HINT: Use the escape string syntax for escapes, e.g., E'\r\n'. >> >> ERROR: relative path not allowed for COPY to file >> SQL state: 42602 >> >> >> (The caret character is pointing to the M in FROM) > > I believe that on Windows you need to use double backslashes, i.e., 'c:\ > \autodrs_appraisal_new.txt', although the regular slash may also work, > i.e., 'c:/autodrs_appraisal_new.txt'. > > Joe > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings > > If this is the case, it is strange that the first copy statement works as that is also only using a single backslash. Having said that, if I switch it to a forward slash it works without error... odd, given that weenblows standard is backslash. Thanks for the help though. -- Paul Lambert Database Administrator AutoLedgers