Thread: Bundling PostgreSQL with an application

Bundling PostgreSQL with an application

From
Paul Vercellotti
Date:

Hi there,

I hope this hasn't been covered in FAQ's; I couldn't find it specifically mentioned.   So we'd like to build a single-user application that uses PostgreSQL as a database back end because of so many of the unique things that it offers:  customizable index formats (GIST - it's going to be a pattern matching database that requires some clever indexing tricks), customizable data types, full text search, temp tables, and importantly: its license model.   MySQL or Firebird don't do what we need.  It'll run on Mac & Windows.    I'm wondering if anyone's consolidated documentation of all the little pieces needed to get PostgreSQL to play nicely next to an app like this?

Most of the FAQ's in this vein state something like "PostgreSQL isn't an embedded server..."  But we specifically don't want an embedded server in our process, even if it were possible, since it would increase the potential for database corruption, increase our process' memory footprint, etc. 

Mainly we want our app's installer to manage the installation of postgresql, the app's process to nicely start and stop the postgres server with our application (would be nice to do so via library calls rather than having to shell out to other commands), only enable local connections, not interfere with other postgres versions installed on the system, minimize the presence of config files for users to mess with, make sure the data store is easily removable by the user, and other things that will make the user blissfully unaware of its presence.  Many of these things are clearly documented (I've found those already), but some are a bit more hidden.  And I'm sure there's quite a few that I haven't thought of yet that we'll encounter once we start testing on different systems - those are the ones that I'm worried about.

Anyway, has anyone documented these types of things in a single place?  If it hasn't been done yet, we'll be taking our own notes as we progress and would be happy to post those somewhere (like perhaps the proposed postgresql cookbook wiki), if others would find this useful.

Cheers,
Paul


Re: Bundling PostgreSQL with an application

From
Scott Marlowe
Date:
On Mon, Mar 9, 2009 at 2:55 PM, Paul Vercellotti <pvercello@yahoo.com> wrote:
>
> Hi there,
> I hope this hasn't been covered in FAQ's; I couldn't find it specifically
> mentioned.   So we'd like to build a single-user application that uses
> PostgreSQL as a database back end because of so many of the unique things

Assuming you're running windows, there's a silent install mode switch
in there somewhere made just for this purpose.  Search the archives or
wait an hour or so for someone to say what it is. :)

Re: Bundling PostgreSQL with an application

From
Grant Allen
Date:
Scott Marlowe wrote:
> On Mon, Mar 9, 2009 at 2:55 PM, Paul Vercellotti <pvercello@yahoo.com> wrote:
>> Hi there,
>> I hope this hasn't been covered in FAQ's; I couldn't find it specifically
>> mentioned.   So we'd like to build a single-user application that uses
>> PostgreSQL as a database back end because of so many of the unique things
>
> Assuming you're running windows, there's a silent install mode switch
> in there somewhere made just for this purpose.  Search the archives or
> wait an hour or so for someone to say what it is. :)
>

The /qn switch for the msi is the "really silent" option.  You need to pass in values for the SERVICEDOMAIN,
SERVICEUSER,SUPERPASSWORD, INTERNALLAUNCH and BASEDIR parameters.  The documentation is pretty good on this, and I'd
recommendtesting it quite a bit, as there were a few quirks for me to get it to work consistently. 

Ciao
Fuzzy
:-)

------------------------------------------------
Dazed and confused about technology for 20 years
http://fuzzydata.wordpress.com/