0

I am wondering if there is a way to import data from an HTTP source from within an pgsql function.

I am porting an old system that harvests data from a website. Rather than maintaining a separate set of files to manage the downloading of the data, I was hoping to put the import routines directly into stored procedures.

I do know how to import data with COPY, but that requires the data to already be available locally. Is there a way to get the download the data with PL/PGSQL? Am I out to lunch?

Related: How to import CSV file data into a PostgreSQL table?

4

2 回答 2

2

根据您所追求的,Postgres 扩展www_fdw可能适合您:http://pgxn.org/dist/www_fdw/

于 2013-07-22T15:18:21.897 回答
1

如果您想通过 HTTP 协议下载自定义数据,那么 PostgreSQL 对不同语言的广泛支持可能会很方便。以下是使用 Python 编写的 Postgres 函数连接到 Google 翻译服务的示例:

https://wiki.postgresql.org/wiki/Google_Translate

于 2013-07-22T18:36:17.250 回答