Re: Application written in pure pgsql, good idea? - Mailing list pgsql-general

From BladeOfLight16
Subject Re: Application written in pure pgsql, good idea?
Date
Msg-id CA+=1U=WorWw8fD8XPoEzj5qiDLm1+5tT50N=-MT5HkLP6va-rA@mail.gmail.com
Whole thread Raw
In response to Application written in pure pgsql, good idea?  (inspector morse <inspectormorse86@gmail.com>)
Responses Re: Application written in pure pgsql, good idea?  (inspector morse <inspectormorse86@gmail.com>)
List pgsql-general
On Sat, Feb 28, 2015 at 3:39 PM, inspector morse <inspectormorse86@gmail.com> wrote:

Is it a good idea to write a simple application (consisting of just data entry interfaces) in pure pgsql?

Basically, we would have each page has a stored function in postgresql that is called by php+apache (the http get/post values would be passed into postgrel as an array).

The pgpsql would render HTML and return back to the front end for display.

I'm going to go ahead and say this is a bad idea for one primary reason: there is no PL/pgSQL framework or library to help you with the development tasks you'll need to perform. For example, there's no web framework to help interpret incoming requests. There's no templating library to help render pages. There won't be many other programming libraries to help with more specific data processing tasks.

On the other hand, if all you want is a simple "RESTful" (by which I mean "leverages the HTTP standard") CRUD interface, there are tools that will actually auto-generate these kind of applications for your front end to consume.

Bottom line: this isn't what PL/pgSQL was designed for or how it's commonly used, and that's more likely to bite you than the benefits you're hoping for are to help. Unless this is purely an experiment for fun or research, go with a more trodden path for your sanity and those who follow you.

pgsql-general by date:

Previous
From: tpham
Date:
Subject: Re: [postgresql 9.3.5] autovacuums stuck on non-existent pg_toast tables
Next
From: inspector morse
Date:
Subject: Re: Application written in pure pgsql, good idea?