Re: Question about SQL statement error - Mailing list pgsql-general

From Marco Colombo
Subject Re: Question about SQL statement error
Date
Msg-id Pine.LNX.4.61.0408251652350.2465@Megathlon.ESI
Whole thread Raw
In response to Question about SQL statement error  (Mário Gamito <gamito@netual.pt>)
List pgsql-general
On Wed, 25 Aug 2004, [ISO-8859-1] Mário Gamito wrote:

> Hi,
>
> I'm a newbie at postgreSQL, although i have years of experience with MySQL.
>
> My question is (and i tried to found the answer):
> why this gives an error ?
>
> SELECT url_negado INTO OUTFILE '/tmp/urls_negados.txt' FROM urls_negados;
>
> Any help would be appreciated.
>
> Sorry for the basic answer :(
>
> Warm Regards,
> Mário Gamito
>

Check out COPY and \copy. COPY is server-side, thus it's executed on
the host the server runs on, with the permissions of the user the server
is running as. \copy is a psql command, thus client-side. It's executed
on the client host and with the permissions of the user running psql (you).
If you are writing your own client application, you can use
COPY ... FROM STDIN and COPY ... TO STDOUT (which is what psql does).

http://www.postgresql.org/docs/7.4/interactive/sql-copy.html
http://www.postgresql.org/docs/7.4/interactive/app-psql.html

.TM.
--
       ____/  ____/   /
      /      /       /            Marco Colombo
     ___/  ___  /   /              Technical Manager
    /          /   /             ESI s.r.l.
  _____/ _____/  _/               Colombo@ESI.it

pgsql-general by date:

Previous
From: Chris Travers
Date:
Subject: Re: copy a database
Next
From: Jon Lapham
Date:
Subject: EXPLAIN ANALYZE total runtime != walltime