Re: PG Admin - Import from URL? - Mailing list pgsql-novice

From Andreas Kretschmer
Subject Re: PG Admin - Import from URL?
Date
Msg-id 20120315160443.GA19151@tux
Whole thread Raw
In response to PG Admin - Import from URL?  (James David Smith <james.david.smith@gmail.com>)
List pgsql-novice
James David Smith <james.david.smith@gmail.com> wrote:
> I then import the data as below:
>
> COPY busroutes_raw from 'C:/Program Files
> (x86)/PostgreSQL/8.4/data/BusRoutes.csv' DELIMITERS ',' CSV;
>
> But I wonder whether it is possible to put a URL as the origin of the
> file rather than a path?

Sure, use tools like wget or other to fetch the file from internet and
raise it to stdout, pipe that to psql -c "\copy ... from 'stdin'"

(something like that, untestet)


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

pgsql-novice by date:

Previous
From: James David Smith
Date:
Subject: PG Admin - Import from URL?
Next
From: Binand Sethumadhavan
Date:
Subject: SEQUENCE data type (was: Re: PG Admin - Import from URL?)