Re: embedded postgresql - Mailing list pgsql-general

From Christopher Browne
Subject Re: embedded postgresql
Date
Msg-id m34qx8q2p3.fsf@wolfe.cbbrowne.com
Whole thread Raw
In response to Re: embedded postgresql  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-general
In the last exciting episode, jiniusuk@yahoo.co.uk (jini us) wrote:
> It is a shame that postgres is not available as an embedded server
> unlike mysql database server which comes in the form of a dll.

When the postmaster runs as a separate process, this has three major
merits:

 1.  It takes advantage of the fact that modern operating systems are
     quite GOOD at spawning multiple processes.  VMS and MVS are
     historically _atrociously_ slow at this, but on Windows NT, the
     cost of spawning one process can't be _too_ dramatic.

 2.  It improves reliability since processes using data can't
     accidentally corrupt the database process(es).

 3.  As soon as there is more than one process using data, there is
     a savings in memory consumption since the overhead of
     establishing dynamic parts of database context only need be paid
     once.

That you regard it as a vital "doctrine" that it should be preferable
to embed databases using DLLs does not establish either that:

 a) The doctrine is actually valid, or

 b) The architecture of PostgreSQL is likely to be changed to conform
    to that doctrine.

You might instead investigate the notion of running PostgreSQL as a
separate process, and see if you can find a way to use it, despite the
apparent misfit of expectations.  If you fight with PostgreSQL, things
will doubtless go badly.  If you try to find a way of cooperating with
its architecture, you might find some pleasant surprises...

> However with mysql licence I would have to pay $10,000 if I wish to
> include it in mysql as an embedded server in my app.

Wow, that is rather expensive.  I thought MySQL was supposed to be
"free software," what with being licensed under the GPL and all...
--
wm(X,Y):-write(X),write('@'),write(Y). wm('cbbrowne','cbbrowne.com').
http://www3.sympatico.ca/cbbrowne/postgresql.html
"I'm sorry, the teleportation booth you have reached is not in service
at this  time.   Please  hand-reassemble  your molecules or   call  an
operator to help you...."

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Loggin SQL Statements from JBOSS/JDBC
Next
From: Shridhar Daithankar
Date:
Subject: Re: PL/PGSQL functions suddenly not working