Re: embedded postgresql

From: jini us <jiniusuk(at)yahoo(dot)co(dot)uk>
To: Christopher Browne <cbbrowne(at)acm(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: embedded postgresql
Date: 2003-11-14 22:13:14
Message-ID: 20031114221314.40028.qmail@web86108.mail.ukl.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I would class your solution as a work around
rather than a "natural solution".

Anyway I am using MS windows and to implement
postgres as embedded, using your approach, would
probably become complicated.
.It would probably introduce unwanted bugs in my
software.

--- Christopher Browne <cbbrowne(at)acm(dot)org> wrote: >
jiniusuk(at)yahoo(dot)co(dot)uk (jini us) writes:
> > So when the user starts my application I would
> start the database
> > server, then stop it programmatically when the
> user stops using the
> > application.
>
> > I would obviously need some functionality so that
> I can programmatically
> > configure which disk I would use to create the
> database.
>
> It is not necessary for PostgreSQL to be a "DLL" in
> order to all of do
> these things.
>
> Your application can configure where the database
> server is supposed
> to find its data, and spawn the database server.
>
> This came up a while back on the GnuCash discussion
> list, and I
> described how you'd start up a 'pseudo-embedded'
> instance of
> PostgreSQL:
>
>
<http://www.gnucash.org/pipermail/gnucash-devel/2003-June/009418.html>
>
> Code to initialize and start up the database:
>
-----------------------------------------------------------------------
> mkdir("~/GnuCash/DB");
> system("initdb -d ~/GnuCash/DB");
> [dribble a few changes into
> ~/GnuCash/DB/{pg_hba|postgres}.conf,
> notably turning on TCP/IP, picking a port #,
> probably not too
> much else...]
> system("pg_ctl -D ~/GnuCash/DB start");
>
-----------------------------------------------------------------------
>
> Code to stop it upon exiting the application:
>
-----------------------------------------------------------------------
> system("pg_ctl -D ~/GnuCash/DB stop");
>
-----------------------------------------------------------------------
>
> I daresay I was a just little bit dogmatic about it,
> and the approach
> was not accepted particularly graciously...
>
>
<http://www.gnucash.org/pipermail/gnucash-devel/2003-June/009449.html>
>
>
-------------------------------------------------------------------
> Derek Atkins wrote:
> > Christopher Browne <gnucash at cbbrowne.com>
> writes:
> >
> > > It seems no more reasonable to expect that
> casual home users have to:
> > >
> > > - Run mke2fs, or whatever else is involved in
> setting up filesystems;
> > > - Run whatever frightening incantations are
> involved in getting X
> > > working.
> >
> > If this is how you feel then you are grossly
> over-estimating the
> > competence and skillset of the average user. Most
> users grab the
> > Red Hat install media and click "go". They have
> no clue what mke2fs
> > is. They have no clue how to set up X.
>
> It nonetheless happens, does it not? They _do_ have
> to cope with it,
> in some manner, because X and ext2 don't get there
> by magic.
>
> Reciting some mantra of "embedded database, embedded
> database" will
> also not lead to the system being simpler just
> because it gets
> repeated enough times.
>
> ... much elided ...
>
> But none of that changes the vital points, that
> - The "embedded" process belongs to the user;
> - So do the files;
> - It does NOT forcibly require a sysadmin's
> attentions.
>
-------------------------------------------------------------------
>
> > I am hoping to be able to create the database on a
> virtual drive /
> > network drive programmatically from my
> application.
>
> So long as you can run the program:
>
> pg_ctl -D X:\WHEREVER_THE_DATA_IS start
>
> there oughtn't be a problem with doing this.
>
> It is a little bit disappointing that people
> _haven't_ documented the
> use of this sort of approach to have PostgreSQL be
> 'quasi-embedded' in
> such a manner that the database instance is not made
> manifestly
> visible.
> --
> "aa454","@","freenet.carleton.ca"
> http://cbbrowne.com/info/rdbms.html
> Why are there flotation devices under plane
> seats instead of
> parachutes?
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
> (send "unregister YourEmailAddressHere" to
majordomo(at)postgresql(dot)org)

________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jini us 2003-11-14 22:18:27 Re: Can Postgresql run under Windows?
Previous Message jini us 2003-11-14 22:06:55 Re: embedded postgresql + C++ IDE