dbTalk Databases Forums  

[NOVICE] postgresql on Fedora 16

mailing.database.pgsql-novice mailing.database.pgsql-novice


Discuss [NOVICE] postgresql on Fedora 16 in the mailing.database.pgsql-novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kevin Duffy
 
Posts: n/a

Default [NOVICE] postgresql on Fedora 16 - 02-02-2012 , 09:08 PM






Hello All:

I am attempting to set up Postgresql under Fedora 16.
And I think I did not do too bad for a first try for a novice.

I am pretty sure I was logged in as root when I ran yum install
postgresql-server.
And I also used yum to install pgAdmin.
Then I followed various postings to set the postgres account password and
to
get the /usr/local/pgsql/data directory set up and permissioned correctly.

I have been able to do the following:
su postgres

start the server with the command:
/usr/bin/pg_ctl -D /usr/local/pgsql/data -l /tmp/pgsql.log start
this returns:
could not change directory to "/home/kbd"
server starting

createdb testdb
returns:
could not change directory to "/home/kbd"

psql testdb
returns: ( again )
could not change directory to "/home/kbd"

testdb=# select * from pg_language
returns the expected stuff.

pgAdmin is able to connect to Postgresql. Yipee

OK so what is causing this message:
could not change directory to "/home/kbd"
I looked in the log file but it is empty.


Is it OK that postgresql is in /usr/local/bin? I though it should be in
/usr/local/pgsql/bin. Least that it was where when I installed postgresql
years ago.


And what do I have to do to get postgresql to start auto on start up.

Many thanks for your assistance.

Best Regards

KD

Reply With Quote
  #2  
Old   
Devrim GÜNDÜZ
 
Posts: n/a

Default Re: [NOVICE] postgresql on Fedora 16 - 02-03-2012 , 04:32 AM






Hi,

On Thu, 2012-02-02 at 22:08 -0500, Kevin Duffy wrote:

Quote:
I am attempting to set up Postgresql under Fedora 16.
I believe I need to write a blog post about this soon...1

Quote:
And I think I did not do too bad for a first try for a novice.

I am pretty sure I was logged in as root when I ran yum install
postgresql-server.
And I also used yum to install pgAdmin.
Then I followed various postings to set the postgres account password and
to
get the /usr/local/pgsql/data directory set up and permissioned correctly..

I have been able to do the following:
su postgres
This is the main cause of the problems. You would use

su - postgres

That said, there is

/usr/bin/postgresql-setup

which you can use for initdb, or such. It will initdb
to /var/lib/pgsql/data directory, and it will be compatible with the
init script.

Quote:
Is it OK that postgresql is in /usr/local/bin?
I'd stick with the RPM layout, which is /usr/bin. RPMs use that
directory.

Quote:
I though it should be in /usr/local/pgsql/bin. Least that it was wherewhen I installed postgresql
years ago.
It was years ago, but now we have the prebuilt packages, which will make
you lives easier.

Quote:
And what do I have to do to get postgresql to start auto on start up.
For RPMs, it is

systemctl enable postgresql.service

Then, you can use

systemctl start postgresql.service

to start the service.

-HTH.
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEABECAAYFAk8rt6EACgkQtl86P3SPfQ5uXgCgs89d30AaTs YgqgEZlxZrUBC4
xsIAoKNbg5tktFoqbvih5uIaZtlQBcww
=Wt3r
-----END PGP SIGNATURE-----

Reply With Quote
  #3  
Old   
Kevin Duffy
 
Posts: n/a

Default Re: [NOVICE] postgresql on Fedora 16 - 02-03-2012 , 09:41 AM



Hello:

OK now I do not know what to do.
Is there a simple way to uninstall and do it right?

What is the difference between su postgres and su - postgres?
The - (dash) makes it a login shell?

I am will to star over, if I had a clue.

KD



2012/2/3 Devrim GÜNDÜZ <devrim (AT) gunduz (DOT) org>

Quote:
Hi,

On Thu, 2012-02-02 at 22:08 -0500, Kevin Duffy wrote:

I am attempting to set up Postgresql under Fedora 16.

I believe I need to write a blog post about this soon...1

And I think I did not do too bad for a first try for a novice.

I am pretty sure I was logged in as root when I ran yum install
postgresql-server.
And I also used yum to install pgAdmin.
Then I followed various postings to set the postgres account password and
to
get the /usr/local/pgsql/data directory set up and permissioned
correctly.

I have been able to do the following:
su postgres

This is the main cause of the problems. You would use

su - postgres

That said, there is

/usr/bin/postgresql-setup

which you can use for initdb, or such. It will initdb
to /var/lib/pgsql/data directory, and it will be compatible with the
init script.

Is it OK that postgresql is in /usr/local/bin?

I'd stick with the RPM layout, which is /usr/bin. RPMs use that
directory.

I though it should be in /usr/local/pgsql/bin. Least that it was
where when I installed postgresql
years ago.

It was years ago, but now we have the prebuilt packages, which will make
you lives easier.

And what do I have to do to get postgresql to start auto on start up.

For RPMs, it is

systemctl enable postgresql.service

Then, you can use

systemctl start postgresql.service

to start the service.

-HTH.
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.