Thread: Don't know where to begin

Don't know where to begin

From
Mark Cannata
Date:
I've been trying to use Postgresql on Redhat Linux  for a while now with
no success.
I can't get the postmaster to start (I'm trying to start it as postgres)

I can't get initdb or createdb  to run
the directory for pgsql is in /var/lib, is this the right directory?
I've read the postmaster man page and the documentation at the Postgres
site, but I can't seem to get anywhere.

Thanks for your time,
Mark



Re: Don't know where to begin

From
"Oliver Elphick"
Date:
Mark Cannata wrote:
  >I've been trying to use Postgresql on Redhat Linux  for a while now with
  >no success.
  >I can't get the postmaster to start (I'm trying to start it as postgres)
  >
  >I can't get initdb or createdb  to run
  >the directory for pgsql is in /var/lib, is this the right directory?
  >I've read the postmaster man page and the documentation at the Postgres
  >site, but I can't seem to get anywhere.

Create a user `postgres' (or get your sysadmin to do it.)

Become user postgres and run initdb; nothing else will work until that is
done.  initdb creates the basic database structure; read its man page to
check what options you may need.

If you can't make that work, post a copy of initdb's output so that we
can see what the problem is.



--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Let the wicked forsake his way, and the unrighteous
      man his thoughts; and let him return unto the LORD,
      and He will have mercy upon him; and to our God, for
      he will abundantly pardon."          Isaiah 55:7



Re: Don't know where to begin

From
Mark Cannata
Date:
on 9/12/00 9:58 AM, Oliver Elphick at olly@lfix.co.uk wrote:

Oliver Elphick wrote:
>
> Create a user `postgres' (or get your sysadmin to do it.)
>
> Become user postgres and run initdb; nothing else will work until that is
> done.  initdb creates the basic database structure; read its man page to
> check what options you may need.
>
> If you can't make that work, post a copy of initdb's output so that we
> can see what the problem is.
>
>
When I run initdb I get the following message:
initdb does not know where to find the files that make up Postgres (the
PGLIB directory). You must identify the PGLIB directory either with a
--pglib invocation option or by setting the PGLIB environment variable, or
by having a program called 'postconfig' in your search path that outputs an
assignment for PGLIB.

I've read the man page. I guess I don't understand the syntax.

Thanks,
Mark


Re: Don't know where to begin

From
ghaverla@freenet.edmonton.ab.ca
Date:
On Tue, 12 Sep 2000, Mark Cannata wrote:

> When I run initdb I get the following message:
> initdb does not know where to find the files that make up Postgres (the
> PGLIB directory). You must identify the PGLIB directory either with a
> --pglib invocation option or by setting the PGLIB environment variable, or
> by having a program called 'postconfig' in your search path that outputs an
> assignment for PGLIB.
>
> I've read the man page. I guess I don't understand the syntax.

I guess you know something of environment variables, most people
have heard of the PATH variable.  It controls what directories are
searched when it is trying to find a program.  Postgres needs
to other environment variables set: PGDATA and PGLIB.  PGDATA
must be set, as you aren't getting an error about that.  It points
to where the beginning of the directories and files of the
PostgreSQL database is.  PGLIB points to the directory which
contains the main postgres shared object library.

If you
% echo $PGLIB
or
% echo $PGDATA
the echo program will show you what they contain, if anything.
For bash, you can set them via:
% export PGDATA=/path/to/postgres/data/directory

Does that make any more sense?  If you have both of those
variables when you run initdb, you shouldn't get the error
message you did.

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



Re: Don't know where to begin

From
Date:
> Mark Cannata wrote:
>   >I've been trying to use Postgresql on Redhat Linux  for a while now
with
>   >no success.
>   >I can't get the postmaster to start (I'm trying to start it as
postgres)
>   >
>   >I can't get initdb or createdb  to run
>   >the directory for pgsql is in /var/lib, is this the right directory?
>   >I've read the postmaster man page and the documentation at the Postgres
>   >site, but I can't seem to get anywhere.
>

Try this:
become root , then:
/etc/rc.d/init.d/postgresql start

The manual (http://www.postgresql.org/docs/admin/postmaster-start.htm) says
the above script would be "/etc/rc.d/init.d/postgres.init" but the above is
where it lives on my Redhat setup.

You wouldn't need to be root if you know what the postrgres user's password
is.

Peter




Re: Don't know where to begin

From
"Oliver Elphick"
Date:
Mark Cannata wrote:
  >When I run initdb I get the following message:
  >initdb does not know where to find the files that make up Postgres (the
  >PGLIB directory). You must identify the PGLIB directory either with a
  >--pglib invocation option or by setting the PGLIB environment variable, or
  >by having a program called 'postconfig' in your search path that outputs an
  >assignment for PGLIB.
  >
  >I've read the man page. I guess I don't understand the syntax.

initdb is looking for a file called global1.bki.source, which on my (Debian)
system is in /usr/lib/postgresql/lib.  For me, that would be the value to give
to initdb.  You need to find out where the Red Hat package puts that file
and give the appropriate directory name.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "For my thoughts are not your thoughts, neither are
      your ways my ways, saith the LORD. For as the heavens
      are higher than the earth, so are my ways higher than
      your ways, and my thoughts than your thoughts."
                               Isaiah 55:8,9