Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 517006 - dev-db/pg_repack - Reorganize tables in PostgreSQL databases with minimal locks
Summary: dev-db/pg_repack - Reorganize tables in PostgreSQL databases with minimal locks
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Default Assignee for New Packages
URL: http://reorg.github.io/pg_repack/
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2014-07-12 22:27 UTC by Vincent de Phily
Modified: 2014-12-06 15:22 UTC (History)
3 users (show)

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


Attachments
pg_repack-1.2.1.ebuild (pg_repack-1.2.1.ebuild,1.01 KB, text/plain)
2014-07-12 22:31 UTC, Vincent de Phily
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent de Phily 2014-07-12 22:27:52 UTC
Pg_repack is a very usefull postgresql extension that ought to be packaged in Gentoo. http://reorg.github.io/pg_repack/



Reproducible: Always
Comment 1 Vincent de Phily 2014-07-12 22:31:04 UTC
Created attachment 380656 [details]
pg_repack-1.2.1.ebuild

While the ebuild itself is very simple, there's some trickery involved to make it istall for every postgresql slot instead of just the active one. I'm not sure it's the right approach, but it's simple and works.
Comment 2 Vincent de Phily 2014-07-12 22:31:48 UTC
See also bug #496894 for the pg slot issue.
Comment 3 Aaron W. Swenson gentoo-dev 2014-07-24 11:52:12 UTC
Thank you for your work. Unfortunately, I cannot accept this ebuild as it is.

* src_prepare() won't fail
As the sed statements are there to fix a bug, it would be unfortunate if they failed and the ebuild continued building for each slot incorrectly.

* Eselect Module
Use "eselect --brief postgresql list" to get the installed PostgreSQL slot. It's a good deal more foolproof than your solution, and can handle the situation where $ROOT is not /.

* Compile in src_compile()
We can't break the rules. Take a look at dev-db/pgtap for a solution to this. I'm also actively working on an eclass[1] that'd replace most of the work here.

* Assumes postgresql-server installed for slot
dev-db/postgresql-base installs pg_config. Its existence does not imply dev-db/postgresql-server has been installed for that slot. Instead, use:
    find "${EROOT}/usr/bin" -name "postgres${slot//./}"

I apologize for the delayed response. It's great that you started this and is appreciated. I look forward to the next iteration.

[1] https://github.com/titanofold/titanofold-gentoo-x86/tree/pgsql-eclass/eclass
Comment 4 Aaron W. Swenson gentoo-dev 2014-07-24 19:13:00 UTC
(In reply to Aaron W. Swenson from comment #3)
> * Assumes postgresql-server installed for slot
> dev-db/postgresql-base installs pg_config. Its existence does not imply
> dev-db/postgresql-server has been installed for that slot. Instead, use:
>     find "${EROOT}/usr/bin" -name "postgres${slot//./}"

Actually, I forgot we have a function specifically meant to perform the task. You want to use:
    has_version "dev-db/postgresql-server:${slot}"
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-05 16:44:45 UTC
Please don't reassign it. Just close it when the package is in the tree.