Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Installation

Status
Not open for further replies.

Dragonfish

Programmer
Apr 25, 2001
62
UG
BIG!!! problems getting started with PostgreSQL. Sorry I'm not an MIT Super-Intellectual but a below average intelligence ICT-ler in Uganda with a bad intrenet-connection.

I'm trying to get PostgreSQL up and running using Debian. I have downloaded nearly all the documentation available.

I have installed PostgreSQL using apt-get install postgres (this worked !!!)
I know where the files are (thanks to Gerhard Mourani ( Simply run the following command before installing the software:
[root@deep /root]# find /* > PostgreSQL1
 And the following one after you install the software:
[root@deep /root]# find /* > PostgreSQL2
 Then use the following command to get a list of what changed:
[root@deep /root]# diff PostgreSQL1 PostgreSQL2 > PostgreSQL-Installed

PostgreSQL starts on reboot (starting postgresql 8.3.0 database server main)... what does this mean ??? The database server is starting in an uninitialised state and this is not the postmaster deamon - or is it ???
ps shows that ps is running
I have created a user for Postgres (adduser pgadmin - this worked!!!)

I realise that the default user for the postmaster deamon is postgres but that this user name can be freely choosen - if you know how !!!

Now everything gets difficult. The Postgres manuel tells me (page 274) the following...

16.1. The PostgreSQL User Account
As with any other server daemon that is accessible to the outside world, it is advisable to run PostgreSQL under a separate user account. This user account should only own the data that is managed by the server, and should not be shared with other daemons. (For example, using the user nobody is a bad idea.) It is not advisable to install executables owned by this user because compromised systems could then modify their own binaries. To add a Unix user account to your system, look for a command useradd or adduser. The user name postgres is often used, and is assumed throughout this book, but you can use another name if you like.

But I cannot find a config-file or command that tells postgres who the su (pgadmin) is for the database and besides postmaster starts at boot, presumably without a su-user - can't find documentation.

And getting ahead of myself - there is talk of initialising the database with a folder for data

The Postgres manuel tells me the following...

In file system terms, a database cluster will be a single directory under which all data will be stored. We call this the data directory or data area. It is completely up to you where you choose to store your data. There is no default, although locations such as /usr/local/pgsql/data or /var/lib/pgsql/data are popular. To initialize a database cluster, use the command initdb, which is installed with PostgreSQL. The desired file system location of your database cluster is indicated by the -D option, for example
$ initdb -D /usr/local/pgsql/data
Note that you must execute this command while logged into the PostgreSQL user account, which is described in the previous section (which as I have already said I have not been able to do).

But I would expect something like ...
/data
/data/project1
/data/project2
/data/project3
.
.
.

But there is no mention of this and how to do it (of course I know how to create directories but dont know how to supply this infomation to postgreSQL for separate projects) - am totally confused !!!

Appreciate help aimed at a low grade moron or DAA (German = Dummster Anzunehmender Anwender) - thanks
Dragonfish

----------------------------------------------------------
Meddle not in the affarirs of Dragons
for you are chrunchy and good with Mustard
----------------------------------------------------------
 
Hi

Dragonfish said:
But I cannot find a config-file or command that tells postgres who the su (pgadmin) is for the database and besides postmaster starts at boot, presumably without a su-user - can't find documentation.
You have to edit the /etc/init.d/postgresql init script to have the daemon run as user pgadmin. At a moment you will probably have to edit the pg_hba.conf and/or pg_ident.conf files too, but not sure when. ( Both can found in the data directory, either as symlink or as copy of their originals from /etc/postgresql/ . ) I am not aware of more places to change, however, I never tried such wizardry.
Dragonfish said:
But I would expect something like ...
/data
/data/project1
/data/project2
/data/project3
No way. What and how is inside the data directory is none of your business. PostgreSQL organizes the files according to his needs, not your or your project's.
Dragonfish said:
But there is no mention of this and how to do it (of course I know how to create directories but dont know how to supply this infomation to postgreSQL for separate projects)
Both [tt]pg_ctl[/tt] and [tt]initdb[/tt] expect a single data directory specified with -D , so you can not specify more.

Feherke.
 
Thanks Feherke.

am working on it.

Dragonfish

----------------------------------------------------------
Meddle not in the affarirs of Dragons
for you are chrunchy and good with Mustard
----------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top