Re: [GENERAL] Regrding:- Arduino-Postgresql Direct Connection - Mailing list pgsql-general

From John R Pierce
Subject Re: [GENERAL] Regrding:- Arduino-Postgresql Direct Connection
Date
Msg-id 88fdb597-3d75-49f9-626c-eb9a80456180@hogranch.com
Whole thread Raw
In response to [GENERAL] Regrding:- Arduino-Postgresql Direct Connection  (Roshan Jha <roshan.jha.srm@gmail.com>)
Responses Re: [GENERAL] Regrding:- Arduino-Postgresql Direct Connection
List pgsql-general
On 12/8/2016 8:56 PM, Roshan Jha wrote:
> In my project ,I have  to send the data from the arduino to the direct
> postgresql for storing .So i want know that is it possible to make
> direct connection between arduino to postgresql ,If yes, then let me
> know, how should i do.

arduinos don't even have native networking, do they?  so you'll need an
ethernet adapter, and someone's tcp/ip libraries to even get data off it...

it might be easier to do this on a raspberry pi...  they run a small
linux system natively, and have ethernet built in, the pi3 has
integrated wifi, too.

To talk to postgresql directly, you would need a libpq compiled for
arduino, this compilation, while theoretically possible quite likely
would be rather tricky.

instead, I'd suggest implementing a front end, perhaps RESTful, that
runs on an application server, either on the postgres database server or
another nearby server, and have the arduino send the data to it, this
front end would format the data and insert it into the postgres
database.   keep the app server API at a simple application-oriented
level ('GET record', 'PUT record' kind of thing...) so the arduino code
can be kept quite simple.


--
john r pierce, recycling bits in santa cruz



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Out of memory error
Next
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] Windows installation - could not connect to server:Connection refused (0x0000274D/10061)