Re: question about HTTP API - Mailing list pgsql-hackers

From Andrew Tipton
Subject Re: question about HTTP API
Date
Msg-id CA+M2pVUFv=3QfDP63j_XjuECKF4JyxoTRJONZD7-p3xs6gcQSA@mail.gmail.com
Whole thread Raw
In response to question about HTTP API  (Szymon Guz <mabewlun@gmail.com>)
Responses Re: question about HTTP API  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
On Fri, Aug 9, 2013 at 2:44 AM, Szymon Guz <mabewlun@gmail.com> wrote:

Do we have any attempts of implementation the HTTP server described at http://wiki.postgresql.org/wiki/HTTP_API?

It seems like there are design ideas only. Are there any ideas about implementation like using some existing http servers or writing everything from scratch?

I recently threw together a quick-and-dirty prototype of this idea.  It was an external tool which used the libmicrohttpd library to accept incoming requests, convert them to a SQL query (which called a stored procedure), and return the query results.  (It allowed *any* content-type to be returned, not just JSON.)  I only got as far as handling GET requests.  The code is available here:

  http://code.malloclabs.com/pghttpd.v1

I'm also aware of an nginx module (ngx_postgres) that lets you transform requests into queries against a Postgres database, but it isn't "generic" -- you have to configure it for each URL that should be handled.


Regards,
Andrew Tipton

pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: [PATCH] Statistics collection for CLUSTER command
Next
From: Andrew Tipton
Date:
Subject: Re: question about HTTP API