0

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.

jstm88
  • 3,335
  • 4
  • 38
  • 55

2 Answers2

2

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 K
  • 13,370
  • 2
  • 32
  • 51
  • Well, I executed the following commands (in separate comments for readability) – jstm88 Oct 25 '10 at 21:14
  • cd ~/Downloads/postgresql-9.0.1 – jstm88 Oct 25 '10 at 21:16
  • ./configure --prefix="Users/Justin/.local/pgsql" – jstm88 Oct 25 '10 at 21:16
  • Now if I run postgres, I get "LOG: 00000: could not find a "postgres" to execute LOCATION: find_my_exec, exec.c:200 FATAL: XX000: postgres: could not locate my own executable path LOCATION: getInstallationPaths, postmaster.c:1114" – jstm88 Oct 25 '10 at 21:17
  • 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"?" – jstm88 Oct 25 '10 at 21:19
  • Why did you fork make and make install to the background? – Matt K Oct 26 '10 at 00:30
  • 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? – jstm88 Oct 26 '10 at 02:24
  • 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 K Oct 26 '10 at 13:36
  • 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. – jstm88 Oct 26 '10 at 18:42
  • 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 K Oct 26 '10 at 20:16
  • 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. – jstm88 Oct 27 '10 at 20:04
  • Couldn't you provide binaries for each customer instead? – Matt K Oct 27 '10 at 20:52
  • (as in you build from source and ship the binaries) – Matt K Oct 28 '10 at 00:58
0

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

joni
  • 5,402
  • 1
  • 27
  • 40