Обсуждение: VERY basic

Поиск
Список
Период
Сортировка

VERY basic

От
paul
Дата:
I want to do some psq1 work and am setting it up on RH 7.2.  I installed
Postgres while installing.  I also had apache, php, perl and some
postgres gui interface (can't remember what it was).   The problem . . .
I guess just installing something doesn't mean it is operational.   I
looked at a tutorial and also the documentation and they both contain
about the same information.  They are about downloading the files and
then doing the configure and make.  This doesn't really apply since I
have already gotten it downloaded, etc.
Also, the directories mine is in is different than what is listed in the
documentation.  I found a /usr/include/pgsql/lib instead of the
/usr/local. . .   and also found a data library in
/usr/lib/pgsql/local.  There is also /usr/bin/psql.    These all seem to
be different than what the documentation talks about.  They didn't
actually go in to how to get things set up.  I tried '/usr/bin/psql' and
get the msg asking if the postmaster is running locally.
There was a 'short version' of the setup :

adduser postgres                               -- postgres is already a
user
su - postgres                                           -- I did this
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data     -- this does
not work, it tries to create the data directory and

--  get a 'Permission   denied' message

-- I went back to root and chmod to 777 and  still get

-- permission message.  Do I need to have 777 permission

-- all the way down to /usr?

-- So this is how far I got. But am hopeful with this.

/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &

/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test






-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

Re: VERY basic

От
paul simdars
Дата:
paul wrote:

> I want to do some psq1 work and am setting it up on RH 7.2.  I installed
> Postgres while installing.  I also had apache, php, perl and some
> postgres gui interface (can't remember what it was).   The problem . . .
> I guess just installing something doesn't mean it is operational.   I
> looked at a tutorial and also the documentation and they both contain
> about the same information.  They are about downloading the files and
> then doing the configure and make.  This doesn't really apply since I
> have already gotten it downloaded, etc.
> Also, the directories mine is in is different than what is listed in the
> documentation.  I found a /usr/include/pgsql/lib instead of the
> /usr/local. . .   and also found a data library in
> /usr/lib/pgsql/local.  There is also /usr/bin/psql.    These all seem to
> be different than what the documentation talks about.  They didn't
> actually go in to how to get things set up.  I tried '/usr/bin/psql' and
> get the msg asking if the postmaster is running locally.
> There was a 'short version' of the setup :
>
> adduser postgres                               -- postgres is already a
> user
> su - postgres                                           -- I did this
> /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data     -- this does
> not work, it tries to create the data directory and
>
> --  get a 'Permission   denied' message
>
> -- I went back to root and chmod to 777 and  still get
>
> -- permission message.  Do I need to have 777 permission
>
> -- all the way down to /usr?
>
> -- So this is how far I got. But am hopeful with this.
>
> /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
>
> /usr/local/pgsql/bin/createdb test
> /usr/local/pgsql/bin/psql test
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

So, I found the answer.

root# mkdir /usr/lib/pgsql/data
root# chown postgres /usr/lib/pgsql/data
root# su postgres
postgres> initdb -D /usr/lib/pgsql/data

Also, in the .bash_profile

PGLIB=/usr/lib/pgsql
PGDATA=/var/lib/pgsql/data
[ -f $PGDATA/../initdb.i18n ] &&  source $PGDATA/../initdb.i18n
export PGLIB PGDATA
PATH=$PATH:/usr/lib/pgsql/bin


This seems to make everyone happy.



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

Re: VERY basic

От
Doug McNaught
Дата:
To use the Red Hat packages, all you have to do is:

# /etc/init.d/postgresql start
[this will initialize the database for you]
# chkconfig postgresql on
[this will make sure it comes up at the next reboot]

# su - postgres
$ psql template1
> ...

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863