Problem scenario
You want a REST call to invoke some SQL code on a Postgres database. How do you do this?
Solution
Install Apache web server, PHP, and the PHP-pgsql package on your Postgresql database server. This example assumes you have PHP, Apache web server, Postgres, and the php-pgsql package installed on your server. Assuming the web server is running and the default directory for web pages is still /var/www/html/ do the following.
…
Continue reading “How Do You Get a Web Page to Invoke a Postgres Command (e.g., for a RESTful API)?”