Re: Application written in pure pgsql, good idea?

From: BladeOfLight16 <bladeoflight16(at)gmail(dot)com>
To: inspector morse <inspectormorse86(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Application written in pure pgsql, good idea?
Date: 2015-03-01 04:08:26
Message-ID: CA+=1U=WorWw8fD8XPoEzj5qiDLm1+5tT50N=-MT5HkLP6va-rA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Feb 28, 2015 at 3:39 PM, inspector morse <inspectormorse86(at)gmail(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message inspector morse 2015-03-01 14:45:24 Re: Application written in pure pgsql, good idea?
Previous Message tpham 2015-03-01 02:07:19 Re: [postgresql 9.3.5] autovacuums stuck on non-existent pg_toast tables