views:

28

answers:

2

Simple question here.

Quote from the PostgreSQL Getting Started guide:

PostgreSQL can be installed by any unprivileged user; no superuser (root) access is required.

Instructions on the PostgreSQL Installation Procedure:

./configure
gmake
su
gmake install
...

Notice that 'su' in there? It requires superuser access. I rest my case. The install fails without it. I need to be able to install it without superuser access, as it says I'm supposed to be able to do.

A: 

Use fakeroot? But possibly there's a simpler approach, you've already googled for that, I guess?

joni
+2  A: 

Try ./configure --help. It should have a --prefix option to install somewhere that doesn't require superuser access, and then you won't need the su.

Matt Kane
Well, I executed the following commands (in separate comments for readability)
jfm429
jfm429
cd ~/Downloads/postgresql-9.0.1
jfm429
./configure --prefix="Users/Justin/.local/pgsql"
jfm429
jfm429
(add ~/.local/pgsql/bin) to PATH, run source .bash_profile
jfm429
Now if I run postgres, I get "LOG: 00000: could not find a "postgres" to executeLOCATION: find_my_exec, exec.c:200FATAL: XX000: postgres: could not locate my own executable pathLOCATION: getInstallationPaths, postmaster.c:1114"
jfm429
Running 'createdb test' results in: "could not connect to database postgres: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?"
jfm429
Why did you fork make and make install to the background?
Matt Kane
Actually I executed them all on separate lines, I just wrote them like that here to avoid having to wait 15 seconds between even more comment lines. (It's stupid that Stack Overflow doesn't allow new lines in comments... grr...) Anyhow, I ended up installing it from the Admin account. Still though, I'm not familiar with setting up PostgreSQL but do users have to do this just to use a program? We want to be able to use something like this for multiple clients but we also need to be able to run a single client with zero end-user configuration... is that even possible with PostgreSQL?
jfm429
I'm sure it is; this answer seems to apply to you: http://stackoverflow.com/questions/60285/if-possible-how-can-one-embed-postgresql/113326#113326
Matt Kane
Hmmm... it needs to be cross-platform though, and compatible with wxWidgets. I think we'll probably end up making the application run by default as a standalone app using SQLite, but be able to optionally link to the PostgreSQL database on demand. To that end, do you happen to know of any easy ways (frameworks, etc.) to synchronize a remote PostgreSQL database with a local SQLite one? Multiple clients would be connecting to the PostgreSQL database but there would only be a single SQLite database per client. It would be pretty easy to do manually though.
jfm429
For that you should ask a separate question because I have no idea. But I think a cross-platform thing that requires building pgsql from source for each installation needs more thought.
Matt Kane
Well, the only Mac OS X binary for PostgreSQL I could find is unofficial and requires editing your kernel settings, which is absolutely insane. It's easier to build from source, unless there's yet another way to get the binaries that I missed. Give me an actual installer (or at least a sensible installer script) and then I'll be happy. But having to set up the account and compile manually is no real solution.
jfm429
Couldn't you provide binaries for each customer instead?
Matt Kane
(as in you build from source and ship the binaries)
Matt Kane