Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 112400 - PostgreSQL 8.1.0 ebuild pkgsetup don't check correctly previous version
Summary: PostgreSQL 8.1.0 ebuild pkgsetup don't check correctly previous version
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-13 04:14 UTC by Pierre Poissinger
Modified: 2007-09-22 23:43 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed patch against ebuild (postgresql-8.1.0.patch,703 bytes, patch)
2005-11-13 04:15 UTC, Pierre Poissinger
Details | Diff
2nd version of patch (postgresql-8.1.0.patch,1.49 KB, patch)
2005-11-13 09:33 UTC, Pierre Poissinger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Poissinger 2005-11-13 04:14:41 UTC
emerge Postgresql 8.1.0 don't check previously installed version of postgresql
and leave system in a unusable state if PostgreSQL 8.0.x is installed.

Since PostgreSQL 8.1.0 is unable to upgrade from db of 8.0.x, emerge should be
blocked until user perform a full dump of database and unmerge previous version. 
Current ebuild allows the emerge to continue and it results in a unusable
postgres 8.1.0. 

Log of postgresql-8.1 after "upgrade":
FATAL:  database files are incompatible with server
DETAIL:  The data directory was initialized by PostgreSQL version 8.0, which is
not compatible with this version 8.1.0.
Comment 1 Pierre Poissinger 2005-11-13 04:15:40 UTC
Created attachment 72814 [details, diff]
Proposed patch against ebuild

This should check for a 8.1.x before executing upgrade
Comment 2 Pierre Poissinger 2005-11-13 04:43:59 UTC
just a small add to be "clear": unmerge is not enough, deleting the left over
data files is needed as well. The pkg_setup actually checks this directory...so
it's cool... and honestly, this thing should be done by the user...
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2005-11-13 05:53:54 UTC
Honestly, the ebuild should check against ${PGDATA}/PG_VERSION, which is set in
/etc/conf.d/postgresql - not against a patch hardcoded in the ebuild, so that
the check actually works for people that don't use the default location for
pgsql databases.
Comment 4 Pierre Poissinger 2005-11-13 09:33:51 UTC
Created attachment 72835 [details, diff]
2nd version of patch

This one try to figure out the $PG_DIR using the /etc/conf.d/postgres file
(since, at least on my system, the PGDATA is not set)

Side effect: the config part will actually create the data dir on the location
given in /etc/conf.d/postgresql
Comment 5 Pierre Poissinger 2005-11-13 09:38:10 UTC
typo in comment: /etc/conf.d/postgres is /etc/conf.d/postgresql ...
Comment 6 gent_bz 2005-11-22 19:46:18 UTC
Can we get a fix for this?  This is quite clearly a bug in the ebuild
(${PG_MINOR} -lt 0 ?? That'll work well for anyone upgrading from 8.-1 or
earlier...).  

Either fix it or mask it.
Comment 7 Masatomo Nakano (RETIRED) gentoo-dev 2005-11-22 20:12:51 UTC
fixed.

I have not applyed the patch in comment #4 yet.
I'll looking into it later.
Comment 8 Pierre Poissinger 2005-11-22 22:25:13 UTC
Thanks for the fix

Btw, since the check seems fine for me and will work for "most of people
config",   I passed it to "enhancement" severity... 
 
As far as I am concerned, it can be closed too.
Up to Jakub/Masatomo/others to decide
Comment 9 Luca Longinotti (RETIRED) gentoo-dev 2006-12-17 16:37:51 UTC
Closing this, as the actual ebuilds perform the needed check and have PG_DIR correctly defined.
Best regards, CHTEKK.