pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe <dev@freedomcircle.net>
To: Paul Lambert <paul.lambert@autoledgers.com.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: COPY FROM query.
Date: Sun, 11 Feb 2007 18:55:35 -0500
Message-ID: <1171238135.783.2.camel@pampa> (raw)
In-Reply-To: <45CFA478.5020505@autoledgers.com.au>
References: <45CFA478.5020505@autoledgers.com.au>

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




view thread (8+ messages)  latest in thread

Message-ID: <1171238135.783.2.camel@pampa>
Permalink:  ../1171238135.783.2.camel@pampa/
Also on:    postgresql.org/message-id/1171238135.783.2.camel@pampa

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@freedomcircle.net, paul.lambert@autoledgers.com.au
  Subject: Re: COPY FROM query.
  In-Reply-To: <1171238135.783.2.camel@pampa>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox