Re: question about HTTP API

From: Andrew Tipton <andrew(at)kiwidrew(dot)com>
To: Szymon Guz <mabewlun(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: question about HTTP API
Date: 2013-08-09 08:21:52
Message-ID: CA+M2pVUFv=3QfDP63j_XjuECKF4JyxoTRJONZD7-p3xs6gcQSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 9, 2013 at 2:44 AM, Szymon Guz <mabewlun(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Tipton 2013-08-09 08:49:15 Re: question about HTTP API
Previous Message Fabien COELHO 2013-08-09 08:04:11 Re: [PATCH] Statistics collection for CLUSTER command