Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 214438 - The dev-db/postgresql-8.2.6 ebuild does not respect config set in /etc/conf.d/postgresql when doing pkg_configure
Summary: The dev-db/postgresql-8.2.6 ebuild does not respect config set in /etc/conf.d...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-23 21:17 UTC by Max Hacking
Modified: 2010-03-16 22:59 UTC (History)
0 users

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


Attachments
Patch to resolve my complaint. (pg.ebuild.patch,3.09 KB, patch)
2008-03-23 21:19 UTC, Max Hacking
Details | Diff
This patch isn't garbled ;-) (pg.ebuild.patch,3.10 KB, patch)
2008-03-23 21:22 UTC, Max Hacking
Details | Diff
This one works in the non kernel_linux case too (postgresql-8.2.6.ebuild.patch,3.10 KB, patch)
2008-03-24 15:59 UTC, Max Hacking
Details | Diff
Final version - a complete, non-garbled, patch (postgresql-8.2.6.ebuild.patch,3.11 KB, patch)
2008-03-24 16:08 UTC, Max Hacking
Details | Diff
Patch so the init.d script looks for things in the right place (postgresql.init-8.2.patch,1.57 KB, text/plain)
2008-03-24 19:56 UTC, Max Hacking
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Max Hacking 2008-03-23 21:17:33 UTC
When installing the dev-db/postgresql-8.2.6 (or lower) ebuild certain values are assumed.  These include PGDATA, PGUSER and PGGROUP which can all be set in /etc/conf.d/postgresql



Reproducible: Always

Steps to Reproduce:
1. Install postgresql
2. Modify PGDATA in /etc/conf.d/postgresql
3. Run emerge --configure postgresql

Actual Results:  
Data directory is configured in /var/lib/postgresql/data/ owned by postgres:postgres regardless of settings in /etc/conf.d/postgresql

Expected Results:  
Settings in /etc/conf.d/postgresql should be respected.

Patch to resolve about to be attached...  ;-)
Comment 1 Max Hacking 2008-03-23 21:19:09 UTC
Created attachment 147051 [details, diff]
Patch to resolve my complaint.
Comment 2 Max Hacking 2008-03-23 21:22:49 UTC
Created attachment 147053 [details, diff]
This patch isn't garbled   ;-)
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2008-03-23 22:06:17 UTC

*** This bug has been marked as a duplicate of bug 49864 ***
Comment 4 Max Hacking 2008-03-23 23:43:37 UTC
(In reply to comment #3)
> 
> *** This bug has been marked as a duplicate of bug 49864 ***
> 

Sorry...  Forgive me if I am being particularly dense, although I doubt it.

Bug 49864 relates to a user who wishes to be able to set the admin password when configuring pgsql using some weird emerge <package> --configure variant which is apparently not even possible.

My bug, and patch, relates to the problem that filesystem paths and user/group settings are not taken from /etc/conf.d/postgresql when upgrading and thus the new default databases are potentially created in the wrong location and with the wrong filesystem permissions.

As I say forgive me if I am being dense but I fail to see how the two are related.  

Also, while we are on the subject, bugs 114988 and 154638 (which have also been marked as duplicates of 49864) relate to another issue entirely which is that the default database encoding is SQL_ASCII not SQL_UTF8, again not even slightly relevant to bug 49864 as far as I can tell but something I wish to see addressed nonetheless.
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2008-03-23 23:53:02 UTC
(In reply to comment #4)
> new default databases are potentially created in the wrong location and with
> the wrong filesystem permissions.

The new databases are not created at all, since they already exist. emerge --config is totally pointless for any existing install. Anything else is a duplicate of the original bug.



*** This bug has been marked as a duplicate of bug 49864 ***
Comment 6 Max Hacking 2008-03-24 00:21:34 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > new default databases are potentially created in the wrong location and with
> > the wrong filesystem permissions.
> 
> The new databases are not created at all, since they already exist. emerge
> --config is totally pointless for any existing install. Anything else is a
> duplicate of the original bug.
> 
> 
> 
> *** This bug has been marked as a duplicate of bug 49864 ***
> 

I see...  So when the ebuild maintainers wrote this I suppose they were smoking crack were they?

eerror "PostgreSQL ${PV} cannot upgrade your existing databases, you must"
eerror "use pg_dump to export your existing databases to a file, and then"
eerror "pg_restore to import them when you have upgraded completely."
eerror "You must remove your entire database directory to continue."
eerror "(database directory = ${PGDATA})."
die "Remove your database directory to continue"

When upgrading from version 7.x.x to version 8.x.x the default INTERNAL databases used by pgsql change and thus have to be recreated.  All existing databases have to be dumped and restored, hence the big warning in the ebuild.
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2008-03-24 08:05:42 UTC
Could you please finally leave this bug alone, let alone the insults... Having multiple bugs about exact same issue (variables for pkg_config hardcoded in ebuild) will NOT make the bug fixes faster, but merely annoy maintainers.

*** This bug has been marked as a duplicate of bug 49864 ***
Comment 8 Ferris McCormick (RETIRED) gentoo-dev 2008-03-24 13:54:42 UTC
Reporter has asked me to intervene (as a member of either devrel or of userrel, I suppose), claiming that this is not a duplicate.  I can't tell from looking at the bugs whether it is a duplicate or not, so I'm repoening temporarily and assigning it to the postgres people to comment.
Comment 9 Ferris McCormick (RETIRED) gentoo-dev 2008-03-24 14:00:04 UTC
I guess the real alias for this is pgsql-bugs@gentoo.org, not postgresql@.
Comment 10 Max Hacking 2008-03-24 15:59:07 UTC
Created attachment 147133 [details, diff]
This one works in the non kernel_linux case too
Comment 11 Max Hacking 2008-03-24 16:08:33 UTC
Created attachment 147135 [details, diff]
Final version - a complete, non-garbled, patch

Sorry for the needless bug-spam on this one I was attempting, rather foolishly, to patch a patch and submit the result rather than the far more sensible method of just checking out the final patch and submitting that.  Feel free to slap me repeatedly with a wet fish.
Comment 12 Max Hacking 2008-03-24 19:56:32 UTC
Created attachment 147167 [details]
Patch so the init.d script looks for things in the right place

Not being funny but given that the pkg_config function from the ebuild adds /data to the end of the $PGDATA path for no obvious reason, resulting in every Gentoo postgres install to have its databases at /var/lib/postgres/data, would it have been too much work for someone to make the init script look in the right place?

Of course there is a minor problem if this is ever fixed as users have traditionally fixed this themselves by appending /data to the path in /etc/conf.d/postgres so that their installation would run.  If we are going to start respecting those settings the transition from 7.x.x to 8.x.x and beyond could be fun, although arguably no more fun than blindly assuming the default database location.  Of course if we change the pkg_config function to no longer append the /data part to the path it will also break existing installations.  Why is it even there in the first place?  Anyone?
Comment 13 Ferris McCormick (RETIRED) gentoo-dev 2008-03-25 12:58:05 UTC
For completeness, I'm pasting in a comment from the developer, 	Martin Jackson <mjolnir@gentoo.org> rather than asking him to make the same comment on this bug.
==================================

Ferris McCormick wrote:
> I don't know if it's a duplicate or not.  I gave it to the postgres
> people for comment.

I can see why Jakub would mark them as duplicates, though I'm somewhat 
sympathetic to the notion that they're all separate bugs.  They all have 
a common cause (hardcoded values in pkg_config() in the postgresql 
ebuilds) but different symptoms that annoy different people for 
different reasons (in Max's case, where the data directory goes, and in 
the others, what encoding to use for the database itself).

Max, have you looked at the postgresql overlay 
(http://overlays.gentoo.org/proj/postgresql/)?  It seems to have fixed 
the issue you are reporting (see the postgresql-server series of 
ebuilds).  It should be going into the main tree soon - (dev-zero will 
know the exact timeline) - and in any case, it's the future of 
PostgreSQL in Gentoo.

Thanks,
Marty

=====================================================
Comment 14 Tiziano Müller (RETIRED) gentoo-dev 2008-06-04 22:01:46 UTC
Ok, the hardcoded paths are gone with dev-db/postgresql-server. Please upgrade.
Don't hesitate to contact me if you have problems with upgrading.
Comment 15 Max Hacking 2010-02-28 17:07:53 UTC
(In reply to comment #14)
> Ok, the hardcoded paths are gone with dev-db/postgresql-server. Please upgrade.
> Don't hesitate to contact me if you have problems with upgrading.
> 

Just wanted to let you know that this is STILL a problem in the latest ebuilds...  This has been reported already (see bug below) I just thought posting here might encourage something to be done.  

http://bugs.gentoo.org/show_bug.cgi?id=233572

I have been manually patching postgresql ebuilds for nearly two years now.  Please, please fix this.  All it needs is a single line addition to the new ebuilds which is given in the bug report I linked to.
Comment 16 Patrick Lauer gentoo-dev 2010-03-16 22:59:25 UTC
Should be fixed with the last bump.