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

From inspector morse
Subject Re: Application written in pure pgsql, good idea?
Date
Msg-id CAHYn==7NpwNuo=ktqbTYog+zAq-F2i2-Y8TJdVLqqoRvkbwq8Q@mail.gmail.com
Whole thread Raw
In response to Re: Application written in pure pgsql, good idea?  (BladeOfLight16 <bladeoflight16@gmail.com>)
Responses Re: Application written in pure pgsql, good idea?  (Jan de Visser <jan@de-visser.net>)
Re: Application written in pure pgsql, good idea?  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-general
This is just for fun/research, I don't need a web framework because PHP is actually picking up the incoming requests and sending it to a pgsql stored function. The pgsql will concatenate all the html that is required for the page and send it back to PHP to write out to the response.

My main concern is, since there will be a lot of concatenation in pgsql to generate the HTML, would it affect performance?

On Sat, Feb 28, 2015 at 11:08 PM, BladeOfLight16 <bladeoflight16@gmail.com> wrote:
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: BladeOfLight16
Date:
Subject: Re: Application written in pure pgsql, good idea?
Next
From: Jan de Visser
Date:
Subject: Re: Application written in pure pgsql, good idea?