[SQL] COPY FROM query.

2007-02-11 Thread Paul Lambert
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: WAR

Re: [SQL] COPY FROM query.

2007-02-11 Thread Paul Lambert
An INSERT INTO will fix my problem with needing the extra copy from and copy to. I'm still curious as to why i was being told I couldn't specify a relative path though. P. -- Paul Lambert Database Administrator AutoLedgers ---(end of broadcast)--

Re: [SQL] COPY FROM query.

2007-02-11 Thread Joe
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_ne

Re: [SQL] COPY FROM query.

2007-02-11 Thread Paul Lambert
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_ne

Re: [SQL] COPY FROM query.

2007-02-11 Thread Phillip Smith
"Having said that, if I switch it to a forward slash it works without error... odd, given that weenblows standard is backslash." Yes, but PostgreSQL uses a back-slash as an escape character, which needs to be used to escape itself at an application level before the O/S gets to deal with it :) -p

Re: [SQL] COPY FROM query.

2007-02-11 Thread Paul Lambert
Phillip Smith wrote: "Having said that, if I switch it to a forward slash it works without error... odd, given that weenblows standard is backslash." Yes, but PostgreSQL uses a back-slash as an escape character, which needs to be used to escape itself at an application level before the O/S gets