Re: Why not install pgstattuple by default?

Greg Smith <greg@2ndquadrant.com>

From: Greg Smith <greg@2ndquadrant.com>
To:
Cc: pgsql-hackers@postgresql.org
Date: 2011-05-18T14:25:10Z
Lists: pgsql-hackers

Attachments

Attached is a second patch to move a number of extensions from contrib/ 
to src/test/.  Extensions there are built by the default built target, 
making installation of the postgresql-XX-contrib package unnecessary for 
them to be available.

This request--making some of these additions available without the 
"contrib" name/package being involved--has popped up many times before, 
and it turys out to be really easy to resolve with the new extensions 
infrastructure.  I think it's even a reasonable change to consider 
applying now, between 9.1 Beta 1 and Beta 2.  The documentation 
adjustments are the only serious bit left here that I've been able to 
find, the code changes here are all internal to the build process and easy.

I moved the following extensions:

auto_explain pageinspect pg_buffercache pg_freespacemap pgrowlocks 
pg_stat_statements pgstattuple

My criteria was picking extensions that:

1) Don't have any special dependencies
2) Are in contrib mainly because they don't need to be internal 
functions, not because their code quality is demo/early
3) Tend to be installed on a production server for troubleshooting 
problems, rather than being required by development.
4) Regularly pop up as necessary/helpful in production deployment

Some of my personal discussions of this topic have suggested that some 
other popular extensions like pgcrypto and hstore get converted too.  I 
think those all fail test (3), and I'm not actually sure where pgcrypto 
adds any special dependency/distribution issues were it to be moved to 
the main database package.  If this general idea catches on, a wider 
discussion of what else should get "promoted" to this extensions area 
would be appropriate.  The ones I picked seemed the easiest to justify 
by this criteria set.

Any packager who grabs the shared/postgresql/extension directory in 9.1, 
which I expect to be all of them, shouldn't need any changes to pick up 
this adjustment.  For example, pgstattuple installs these files:

share/postgresql/extension/pgstattuple--1.0.sql
share/postgresql/extension/pgstattuple--unpackaged--1.0.sql
share/postgresql/extension/pgstattuple.control

And these are the same locations they were already at.  The location of 
the source and which target built it is the change here, the result 
isn't any different.  This means that this change won't even break 
extensions already installed.

Once the basic directory plumbing is in place, conversion of a single 
extension from contrib/ to src/test/ is, trivial.  The diff view

I did five of them in an hour once I figured out what was needed.  
Easiest to view the changes at 
https://github.com/greg2ndQuadrant/postgres/commits/move-contrib , the 
patch file is huge because of all the renames. 
https://github.com/greg2ndQuadrant/postgres/commit/d647091b18c4448c5a582d423f8839ef0c717e91 
show a good example of one convert, that changes pg_freespacemap.  There 
are more changes to the comments listing the name of the file than to 
any code.  (Yes, I know there are some whitespace issues I introduced in 
the new Makefile, they should be fixed by a later commit in the series)

-- 
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us