From: Murray Cumming <murrayc@murrayc.com>
To: Jeroen T. Vermeulen <jtv@xs4all.nl>
Cc: pgsql-interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: Embedding postgresql in my application
Date: Sat, 16 Dec 2006 12:47:53 +0100
Message-ID: <1166269673.5923.17.camel@localhost.localdomain> (raw)
In-Reply-To: <9856.125.24.243.222.1166268615.squirrel@webmail.xs4all.nl>
References: <1166225144.12609.2.camel@localhost.localdomain>
<20058.125.24.243.222.1166249768.squirrel@webmail.xs4all.nl>
<1166267606.5923.11.camel@localhost.localdomain>
<9856.125.24.243.222.1166268615.squirrel@webmail.xs4all.nl>
On Sat, 2006-12-16 at 18:30 +0700, Jeroen T. Vermeulen wrote:
> There is no issue of ports, really. The way I've described it, you do
> *not* need a TCP port. Every instance of postgres is running on its own
> socket, which appears in the filesystem in a place of your choosing.
Well, I want multiple users, from multiple networked computers to be
able to use the database simultaneously. TCP/IP seems the logical way to
do this.
> > In this case, I'd actually like the location of the database data to be
> > different every time. The idea would be that it would all be contained
> > in a directory (or even a tarball archive, but that's another issue),
> > along with the .glom file. And opening the .glom file would start a
> > postgres instance with the database that's in that directory.
>
> That should work fine, but yes, then you do need a separate postgres
> instance running for each of those directories.
>
>
> > In my each-database-in-its-directory idea, I guess that I'd do both an
> > initdb (to create the cluster) and a createdb (to create the database,
> > in the cluster, after a createuser) once.
>
> Yes. Except for the createuser: if user X owns these directories and
> postgres is started under user identity X, then X is automatically (well,
> by default) the superuser for that database. No need to create it.
Are we talking about a Linux user or Postgres user as "user X"? I
thought they were separate lists of users.
> > Or do initdb and createdb change anything outside of the specified
> > directory? I mean, can I really move that directory around and just
> > start a postgres instance on it after it's moved, without changes. Are
> > there any absolute filepaths I should watch out for, for instance?
>
> There's the configuration files, of course, in /etc/postgresql*. You'll
> have to look up the necessary options to replace those with local
> versions.
Is there no way to put the configuration file in the directory too?
> > Actually, I want passwords. This is not just for the internal use of the
> > application. I want Glom systems to be usable by multiple users
> > simultaneously. That's a big reason why I'm not using sqllite for this.
>
> That doesn't mean that you have to have passwords, though. With "ident
> sameuser" you simply rely on the system's authentication--if the system
> says you're user X, then the database accepts you as X, but if the system
> says you're not X, then the database will not accept you as X either.
> Overall that's probably safer, not less safe, than requiring the user to
> enter a password to log into the database. And it's lots safer than
> keeping a password stored in a file somewhere.
I don't want to require all users to be using the same Linux user
system, and I even want to allow Windows users to connect when I port
Glom to Windows.
--
Murray Cumming
murrayc@murrayc.com
www.murrayc.com
www.openismus.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: murrayc@murrayc.com, jtv@xs4all.nl
Subject: Re: Embedding postgresql in my application
In-Reply-To: <1166269673.5923.17.camel@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox