Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVEDemerge --config =dev-db/postgresql-server-9.0.3-fails
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2716
Location: Edmonton, AB

PostPosted: Wed Feb 16, 2011 2:53 pm    Post subject: [SOLVEDemerge --config =dev-db/postgresql-server-9.0.3-fails Reply with quote

When I try to emerge postgresql-server-9.0.3 it fails:
Code:
...
creating configuration files ... ok
creating template1 database in /var/lib/postgresql/9.0/data/base/1 ... initdb: input file "/usr/share/postgresql-8.4/postgres.bki" does not belong to PostgreSQL 9.0.3

There was a similar bug posted about 8.4
https://bugs.gentoo.org/show_bug.cgi?id=284437
but when I tried to follow that solution it doesn't work
Code:
...
2. eselect postgresql set-all 9.0
3. emerge dev-db/postgresql-server:9.0
4. strings /usr/lib/postgresql-9.0/bin/*|grep 'postgresql-8\.4'

The last command lists the references to directories from 8.4. This list should
be empty, otherwise, e.g. as in this bug report,

It lists bunch of files that shouldn't be there (I think)
Code:
strings /usr/lib/postgresql-9.0/bin/*|grep 'postgresql-8\.4'
/usr/lib/postgresql-8.4/bin
/usr/share/postgresql-8.4
/etc/postgresql-8.4
/usr/include/postgresql-8.4
/usr/lib/postgresql-8.4/lib
/usr/share/doc/postgresql-8.4
/usr/share/postgresql-8.4/man
...


Last edited by Joseph_sys on Wed Feb 16, 2011 8:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2716
Location: Edmonton, AB

PostPosted: Wed Feb 16, 2011 7:48 pm    Post subject: Reply with quote

It seems to me it is looking for the file postgres.bki in a wrong directory it should be in directory.
"/usr/share/postgresql-9.0

Anybody knows how to correct it.
I've filed a bug:
https://bugs.gentoo.org/show_bug.cgi?id=355245
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2716
Location: Edmonton, AB

PostPosted: Wed Feb 16, 2011 8:15 pm    Post subject: Reply with quote

SOLVED

user has to run:
eselect postgresql set 9.0

before emerging "postgresql-server-9.0.3" so the links get correctly
configured.
I wish there was some note about it before emerging postgresql-server
Back to top
View user's profile Send private message
mansuetus
n00b
n00b


Joined: 13 Sep 2004
Posts: 26

PostPosted: Sat Feb 19, 2011 3:48 pm    Post subject: Reply with quote

I had the same trouble : to upgrade postgresql from 8.4 --> 9.0 : upgrade did not work...

So, I ran (after "emerge -Du world" and several tests)

Code:

# eselect postgresql set 9.0
# emerge -1 postgresql-server
# emerge --config =dev-db/postgresql-server-9.0.3
(enter when << Are you ready to continue? (Y/n) >>)
# chmod 777 /var/lib
(pg_upgrade needs to write /var/lib/pg_upgrade_dump_all.sql)
# su postgres -
$ cd
(important to leave /root)
$ pg_upgrade -d /var/lib/postgresql/8.4/data/ -D /var/lib/postgresql/9.0/data/ -b /usr/lib64/postgresql-8.4/bin/ -B /usr/lib64/postgresql-9.0/bin/
$ exit
#  rc-update del postgresql-8.4
#  rc-update add postgresql-9.0 default
# /etc/init.d/postgresql-9.0 start
# chmod 755 /var/lib/

Your DB now works fine again... But still, you can :
# su postgres -
$ vacuumdb --all --analyze-only
$ /var/lib/delete_old_cluster.sh


Hope this help !
_________________
http://www.spontex.org -> inutilité ou futilité ?
Back to top
View user's profile Send private message
sam_i_am
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2003
Posts: 131

PostPosted: Tue Mar 01, 2011 6:59 pm    Post subject: Reply with quote

Thank you so much. This worked and saved me a lot of time.
_________________
Sam
Back to top
View user's profile Send private message
theBlackDragon
l33t
l33t


Joined: 23 Nov 2002
Posts: 768
Location: Belgium

PostPosted: Tue Mar 29, 2011 8:49 am    Post subject: Reply with quote

mansuetus wrote:
I had the same trouble : to upgrade postgresql from 8.4 --> 9.0 : upgrade did not work...

So, I ran (after "emerge -Du world" and several tests)

Code:

# eselect postgresql set 9.0
# emerge -1 postgresql-server
# emerge --config =dev-db/postgresql-server-9.0.3
(enter when << Are you ready to continue? (Y/n) >>)
# chmod 777 /var/lib
(pg_upgrade needs to write /var/lib/pg_upgrade_dump_all.sql)
# su postgres -
$ cd
(important to leave /root)
$ pg_upgrade -d /var/lib/postgresql/8.4/data/ -D /var/lib/postgresql/9.0/data/ -b /usr/lib64/postgresql-8.4/bin/ -B /usr/lib64/postgresql-9.0/bin/
$ exit
#  rc-update del postgresql-8.4
#  rc-update add postgresql-9.0 default
# /etc/init.d/postgresql-9.0 start
# chmod 755 /var/lib/

Your DB now works fine again... But still, you can :
# su postgres -
$ vacuumdb --all --analyze-only
$ /var/lib/delete_old_cluster.sh


Hope this help !


How do you manage to get pg_update past the part where it tries to launch the servers?

Code:
% su -l postgres -c "pg_upgrade -d /var/lib/postgresql/8.4/data -D /var/lib/postgresql/9.0/data -b /usr/lib64/postgresql-8.4/bin -B /usr/lib64/postgresql-9.0/bin"
Password:
Performing Consistency Checks
-----------------------------
Checking old data directory (/var/lib/postgresql/8.4/data)  ok
Checking old bin directory (/usr/lib64/postgresql-8.4/bin)  ok
Checking new data directory (/var/lib/postgresql/9.0/data)  ok
Checking new bin directory (/usr/lib64/postgresql-9.0/bin)  ok
Checking for reg* system oid user data types                ok
Checking for /contrib/isn with bigint-passing mismatch      ok
Checking for large objects                                  ok
Creating catalog dump                                       ok
Trying to start new server                                  .................ok

 Unable to start new postmaster with the command: "/usr/lib64/postgresql-9.0/bin/pg_ctl" -l "/dev/null" -D "/var/lib/postgresql/9.0/data" -o "-p 5432 -c autovacuum=off -c autovacuum_freeze_max_age=2000000000" start >> "/dev/null" 2>&1
Perhaps pg_hba.conf was not set to "trust".%


pg_hba.conf is just the default ending with these lines (which are correct I think):

Code:
# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust


On a semi related note, the postgres 9 init script seems stuck thinking it's been started now, there's no locks in /var/run and no socket in the data dir either and no running postgres processes (of course). Any idea how to convince it to reset? There used to be an init switch for that but it seems to have gone the way of the dodo somewhere over the past years.
_________________
Fvwm|Fvwm forum
Back to top
View user's profile Send private message
titanofold
Developer
Developer


Joined: 30 Dec 2003
Posts: 235
Location: Bryson City, NC USA

PostPosted: Wed Mar 30, 2011 3:13 am    Post subject: Reply with quote

Try with the latest revision of the 9.0.3 ebuilds.

And don't forget to look at /var/log/postgresql/9.0/data/postmaster.log for a hint as to why it isn't starting properly.
_________________
The best things in life are free.
Guy-1: Surely, you will fold with me...
Guy-2: Alright, but don't call me Shirley
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum