Thread: pgsql setup
Hello, I am runing pgsql with suse linux v.6.4 I have installed pgsql with rpm. When I start initdb as user postgres I get the following error: /usr/lib/pgsql/bin/initdb: pg_id: command not found Unable to determine a valid username. If you are running initdb without an explicit username specified, then there may be a problem with finding the Postgres shared library and/or the pg_id utility. What can I do do fix this? TIA C. -- Carsten Huettl - <http://www.ahorn-Net.de> pgp-key on request
Carsten, Try adding these to your environment: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/pgsql/lib PGLIB=/usr/lib/pgsql/lib initdb is having trouble finding the library files. HTH, Jacques Williams On Thu, Jul 13, 2000 at 12:45:16AM +0200, Carsten Huettl wrote: > Hello, > > I am runing pgsql with suse linux v.6.4 > > I have installed pgsql with rpm. > When I start initdb as user postgres I get the following error: > > /usr/lib/pgsql/bin/initdb: pg_id: command not found > Unable to determine a valid username. If you are running > initdb without an explicit username specified, then there > may be a problem with finding the Postgres shared library > and/or the pg_id utility. > > What can I do do fix this? > > TIA > C. > > > -- > Carsten Huettl - <http://www.ahorn-Net.de> > pgp-key on request
Here's some documentation that I wrote while trying to install the binary version of postgres. See if it helps. The > denotes your shell prompt. --------------Begin Documentation---------------- Installing PGSQL As root > useradd postgres > mkdir /usr/local/pgsql > chown postgres:postgres /usr/local/pgsql > tar -xvf postgresxxx.tar > cd postgres* > cd /src >./configure > gmake > gmake install > LD_LIBRARY_PATH=/usr/local/pgsql/lib > export LD_LIBRARY_PATH > cd /etc > pico etc.so.conf (ADD: /usr/local/pgsql/lib) > /sbin/ldconfig > mkdir /usr/local/pgsql/data > chown postgres /usr/local/pgsql/data > su - postgres > /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data End message: Success. You can now start the database server using: /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data or /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start > nohup /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data \ </dev/null >> server.log 2>>1 & > su > password > cd /etc > pico profile ADD: PATH=$PATH:/usr/local/pgsql/bin ADD: MANPATH=$MANPATH:/usr/local/pgsql/man > cd /usr/local/pgsql/doc > gmake install > cd /usr/local/pgsql/contrib/linux > sh postgres.init.sh install > /sbin/ldconfig REGRESSION: (http://www.postgresql.org/docs/admin/regress.htm) > exit (to go back to postgres account) > cd /usr/local/pgsql/src/test > gmake clean > gmake all > cd regress > gmake runtest > gmake runcheck > make bigcheck > gmake clean > dropdb regression > createdb testdb > psql testdb > ps -x to verify postmaster still running. -----Original Message----- From: Carsten Huettl [mailto:CHUETTL@ahorn-Net.de] Sent: Wednesday, July 12, 2000 3:45 PM To: pgsql-novice@postgresql.org; pgsql-general@postgresql.org Subject: [NOVICE] pgsql setup Hello, I am runing pgsql with suse linux v.6.4 I have installed pgsql with rpm. When I start initdb as user postgres I get the following error: /usr/lib/pgsql/bin/initdb: pg_id: command not found Unable to determine a valid username. If you are running initdb without an explicit username specified, then there may be a problem with finding the Postgres shared library and/or the pg_id utility. What can I do do fix this? TIA C. -- Carsten Huettl - <http://www.ahorn-Net.de> pgp-key on request
Hello Jacque, > Try adding these to your environment: > > LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/pgsql/lib > PGLIB=/usr/lib/pgsql/lib > > initdb is having trouble finding the library files. I am new to linux and pgsql too. How do I add this to my enviroment using bash? Simply: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/pgsql/lib PGLIB=/usr/lib/pgsql/lib export LD_LIBRARY_PATH export PGLIB ? echo $PG_LIBRARY_PATH is empty Do I have to do this as root or postgres? tia C. -- Carsten Huettl - <http://www.ahorn-Net.de> pgp-key on request
On Wed, 2 Aug 2000, Carsten Huettl wrote: > > Try adding these to your environment: > > LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/pgsql/lib > > PGLIB=/usr/lib/pgsql/lib > > initdb is having trouble finding the library files. > I am new to linux and pgsql too. > How do I add this to my enviroment using bash? When you hit the enter key to submit one (or more, if you have multiple commands separated by semicolons on a single line), your "shell" (whether it is the original Bourne shell, the Korn shell, csh, bash, tcsh, ...) does a number of special things. One of the first things it does is look to see if the user is submitting an environment variable definition for the life of that single command. I.e.: % FOO='bar' echo $FOO bar % Here the shell parsed the environment definition setting the value of the variable FOO to equal 'bar', and then the shell ran the echo command with the argument of the contents (that is what the $ asks for) of the FOO variable. Once any leading environment variable definitions are handled, the shell then looks at the first word (or token) left on the line, to see if an alias substitution is to be made. Quite often people will alias 'rm -i' for 'rm', to keep from accidentally deleting files they don't want. Once the above is handled, the shell looks for the first token on the line, and interprets that as the name of an executable file. It gets the contents of the PATH variable, and starts to go down the path, appending this first token on the command line to each path element, looking for the first match with a file name. If no match is found, you might get a command not found message. If a match is found, the file is examined to see if it is marked as executable. If the file is not executable, you will get a permission denied message. The action of variables like LD_LIBRARY_PATH happens once the program has started running. > Simply: > LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/pgsql/lib > PGLIB=/usr/lib/pgsql/lib > export LD_LIBRARY_PATH > export PGLIB Okay, you set (appended to LD_LIBRARY_PATH and set PGLIB) 2 variables, and marked them as variables which should be exported to any subshells which are generated (you need this if you are running shell scripts). > echo $PG_LIBRARY_PATH > is empty You never did set a PG_LIBRARY_PATH variable above, so it is not unusual to see it is empty. This is probably a typo of some kind. > Do I have to do this as root or postgres? This has to be done (having these variables set) anytime the program in question (sorry, I missed the beginning of this thread) is run, by whoever is running the program. With PostgreSQL, you probably don't want to be running things as root. Where these variables are usually set, is in each individual users .login or RC file. If any user on your site might want to do this, you would probably be best to edit the skeleton RC files for each user, so that you don't need to manually edit every new users RC files. Is this any clearer? Gord Matter Realisations http://www.materialisations.com/ Gordon Haverland, B.Sc. M.Eng. President 101 9504 182 St. NW Edmonton, AB, CA T5T 3A7 780/481-8019 ghaverla @ freenet.edmonton.ab.ca
On 02 Aug 2000 11:08 Carsten Huettl wrote: >How do I add this to my enviroment using bash? >Simply: >LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/pgsql/lib >PGLIB=/usr/lib/pgsql/lib >export LD_LIBRARY_PATH >export PGLIB >? > >echo $PG_LIBRARY_PATH >is empty Try this: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/pgsql/lib export PGLIB=/usr/lib/pgsql/lib -- Anthony E. Greene <agreene@pobox.com> <http://www.pobox.com/~agreene/> PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D Linux. The choice of a GNU Generation. <http://www.linux.org/>