[FGS] Postgresql

Tyler Mitchell tylermitchell at shaw.ca
Tue Jul 27 02:03:55 EDT 2004


> I made a first effort to use the Postgresql package you prepared but
> discovered that I get this message:
>
> warmerda at maxine:~$ pg_ctl start
> FATAL:  could not open file "/var/pgsql/data/PG_VERSION": Permission denied
> postmaster successfully started

A production postgresql database is already running on maxine, that's one 
problem.

I think we have a system-wide profile that points to /var/pgsql/data as the 
postgresql data folder.  So when you ran pg_ctl it tried to start the already 
running database for which you have no privileges.

> Does it make any sense for a regular user to start postgres or should I
> take it for granted I need to be root to start it?  

In fact you are "supposed" to run it as an unprivileged user, ie. "postgres".   
But as long as you run initdb as one user, you should be able to also use 
pg_ctl to start that same instance.

> Should we be looking at 
> a way to start postgres in such a way that it keep lock files and the
> database within the FGS package tree?

We definitely should change setenv.sh to point elsewhere during install.  I 
think that it should point to either a personal folder like ~/myfgs/pgdata or 
a group-shared folder like /home/fgs/fgs-pkgs/postgresql/data.

I'd actually like to have it create its instance in a package folder itself, 
so we can actually distribute an initialized data folder with the package.  
Perhaps under /home/fgs/fgs-pkgs/postgresql/share/pgdata might be the best 
place but only during our testing/building phase.  This is helpful so that 
all the bells and whistles like postgis and geos can already be setup in the 
database when a user gets it.  Even some demo data could be included.

The other problem that has surfaced is the fact that a postgresql instance is 
already running on the maxine server (on port 5432) and we can't muck with 
that.  So during the configure of postgresql (and in the 
PGDATA/postgresql.conf file) I've changed the port to 5433 instead.  
Therefore we can run at least two instances on maxine, for testing purposes.  
You can see why a common pgdata location would be favourable.

Thanks for pointing this out.  How do you think we should handle setting the 
PGDATA environment variable to point the folder?  Add it to setenv.sh or 
create another .sh just for postgresql?  I have one on my ~/myfgs/share 
folder now, where my db is also installed.

Tyler


More information about the Foss-gis-suite mailing list