Skip site navigation (1) Skip section navigation (2)

Re: pgsql setup

From: ghaverla(at)freenet(dot)edmonton(dot)ab(dot)ca
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: pgsql setup
Date: 2000-08-02 12:21:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
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
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 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).

> 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?


Matter Realisations
Gordon Haverland, B.Sc. M.Eng. President
101  9504 182 St. NW    Edmonton, AB, CA  T5T 3A7
780/481-8019            ghaverla @

In response to

pgsql-novice by date

Next:From: Anthony E . GreeneDate: 2000-08-02 14:03:51
Subject: Re: pgsql setup
Previous:From: Luis Tito de MoraisDate: 2000-08-02 11:36:03
Subject: Upgrade in the wrong way

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group