diff --git a/cookbooks/main/recipes/default.rb b/cookbooks/main/recipes/default.rb index fceb24f49..a0ebd6e66 100644 --- a/cookbooks/main/recipes/default.rb +++ b/cookbooks/main/recipes/default.rb @@ -38,7 +38,7 @@ #uncomment to run the exim::auth recipe #require_recipe "exim::auth" -require_recipe "mongodb" +#require_recipe "mongodb" #uncomment to run the resque recipe # require_recipe "resque" @@ -93,7 +93,7 @@ #enable Extension modules for a given Postgresql database # if ['solo','db_master', 'db_slave'].include?(node[:instance_role]) - # Extensions that support both Postgres 9.0 and 9.1 + # Extensions that support both Postgres 9.0, 9.1 and 9.2 # postgresql9_autoexplain "dbname" # postgresql9_btree_gin "dbname" # postgresql9_btree_gist "dbname" @@ -110,25 +110,26 @@ # postgresql9_isn "dbname" # postgresql9_lo "dbname" # postgresql9_ltree "dbname" - # postgresql9_pg_trgm "dbname" + # postgresql9_pg_trgm "dbname" # postgresql9_pgcrypto "dbname" # postgresql9_pgrowlocks "dbname" - # postgresql9_postgis "dbname" + # postgresql9_postgis "dbname" - Only works for 9.0 and 9.1 atm # postgresql9_seg "dbname" # postgresql9_sslinfo "dbname" # postgresql9_tablefunc "dbname" # postgresql9_test_parser "dbname" # postgresql9_unaccent "dbname" # postgresql9_uuid_ossp "dbname" - - - # 9.1 Extensions - # postgresql9_file_fdw "dbname" + + + # 9.1 and 9.2 Extensions + # postgresql9_file_fdw "dbname" # postgresql9_xml2 "dbname" - + + # 9.2 Extensions + # postgresql9_pg_stat_statements "dbname" + #Admin-Level Contribs # postgresql9_pg_buffercache "postgres" # postgresql9_pg_freespacemap "postgres" - # postgresql9_pg_stat_statements "todo" - Not done - -# end +#end diff --git a/cookbooks/postgresql9_extensions/README.md b/cookbooks/postgresql9_extensions/README.md index c01cfcf69..937f0edd9 100644 --- a/cookbooks/postgresql9_extensions/README.md +++ b/cookbooks/postgresql9_extensions/README.md @@ -1,39 +1,39 @@ ey-cloud-recipes/postgresql9_extensions ------------------------------------------------------------------------------ -A chef recipe for enabling Postgres extensions (contribs on Postgres 9.0) packages on Engine Yard AppCloud. This recipe defines multiple methods that +A chef recipe for enabling Postgres extensions (contribs on Postgres 9.0) packages on Engine Yard Cloud. This recipe defines multiple methods that can be called from main/recipes/default.rb to enable extensions for a given database. Dependencies -------------------------- -You need to have a running Postgres 9.0.x or Postgres 9.1.x instance to apply these recipes. +You need to have an instance running Postgres 9.0 or above to apply these recipes. -Available Extensions +Available Extensions -------------------------- -At the moment the following extensions are available. +At the moment the following extensions are available. ##auto_explain -###supported versions: 9.0, 9.1 -This extension provides a means for logging execution plans of slow statements automatically, without having to run EXPLAIN by hand. -This is especially helpful for tracking down un-optimized queries in large applications. -WARNING: Enabling this extension will restart your Postgres service. +###supported versions: 9.0, 9.1, 9.2 +This extension provides a means for logging execution plans of slow statements automatically, without having to run EXPLAIN by hand. +This is especially helpful for tracking down un-optimized queries in large applications. +WARNING: Enabling this extension will restart your Postgres service. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this -extension applied to. +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +extension applied to. -``postgresql9_autoexplain "dbname""`` +``postgresql9_autoexplain "dbname""`` ##btree_gin -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 This extension provides support for indexing common datatypes in GIN -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_btree_gin "dbname""`` @@ -42,179 +42,179 @@ extension applied to. ###supported versions: 9.0, 9.1 The intarray module provides a number of useful functions and operators for manipulating null-free arrays of integers. There is also support for indexed searches using some of the operators. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_intarray "dbname""`` ##btree_gist -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 This extension provides support for indexing common datatypes in GiST -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_btree_gist "dbname""`` ##chkpass -###supported versions: 9.0, 9.1 -This extension implements a data type chkpass that is designed for storing encrypted passwords. Each password is automatically converted +###supported versions: 9.0, 9.1, 9.2 +This extension implements a data type chkpass that is designed for storing encrypted passwords. Each password is automatically converted to encrypted form upon entry, and is always stored encrypted. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_chkpass "dbname""`` ##citext -###supported versions: 9.0, 9.1 -The citext module provides a case-insensitive character string type, citext. Essentially, it internally calls lower when comparing values. +###supported versions: 9.0, 9.1, 9.2 +The citext module provides a case-insensitive character string type, citext. Essentially, it internally calls lower when comparing values. Otherwise, it behaves almost exactly like text. (This is great for MySQL compatibility which does text comparisons case-insensitive, by default) -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_citext "dbname""`` ##cube -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 This module implements a data type cube for representing multidimensional cubes. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_cube "dbname""`` ##dblink -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 dblink is a module which supports connections to other PostgreSQL databases from within a database session. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_dblink "dbname""`` ##dict_int -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 dict_int is an example of an add-on dictionary template for full-text search. The motivation for this example dictionary is to control the indexing of integers (signed and unsigned), allowing such numbers to be indexed while preventing excessive growth in the number of unique words, which greatly affects the performance of searching. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_dict_int "dbname""`` ##dict_xsyn -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 dict_xsyn (Extended Synonym Dictionary) is an example of an add-on dictionary template for full-text search. This dictionary type replaces words with groups of their synonyms, and so makes it possible to search for a word using any of its synonyms. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_dict_xsyn "dbname""`` ##earthdistance -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 The earthdistance module provides two different approaches to calculating great circle distances on the surface of the Earth. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_earthdistance "dbname""`` ##file_fdw -###supported versions: 9.1 -The file fdw module provides the foreign-data wrapper, which can be used to access data files in the server's file system. Data files must be in a format that can be read by COPY FROM; +###supported versions: 9.1, 9.2 +The file fdw module provides the foreign-data wrapper, which can be used to access data files in the server's file system. Data files must be in a format that can be read by COPY FROM; -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_file_fdw "dbname""`` ##fuzzystrmatch -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 The fuzzystrmatch module provides several functions to determine similarities and distance between strings. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_fuzzystrmatch "dbname""`` ##hstore -###supported versions: 9.0, 9.1 -This module implements the hstore data type for storing sets of key/value pairs within a single PostgreSQL value. This can be useful -in various scenarios, such as rows with many attributes that are rarely examined, or semi-structured data. Keys and values are simply -text strings. +###supported versions: 9.0, 9.1, 9.2 +This module implements the hstore data type for storing sets of key/value pairs within a single PostgreSQL value. This can be useful +in various scenarios, such as rows with many attributes that are rarely examined, or semi-structured data. Keys and values are simply +text strings. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_hstore "dbname""`` ##intarray -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 The intarray module provides a number of useful functions and operators for manipulating null-free arrays of integers. There is also support for indexed searches using some of the operators. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_intarray "dbname""`` ##isn -###supported versions: 9.0, 9.1 -The isn module provides data types for the following international product numbering standards: EAN13, UPC, ISBN (books), ISMN (music), +###supported versions: 9.0, 9.1, 9.2 +The isn module provides data types for the following international product numbering standards: EAN13, UPC, ISBN (books), ISMN (music), and ISSN (serials). Numbers are validated on input, and correctly hyphenated on output. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_isn "dbname""`` ##lo -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 The lo module provides support for managing Large Objects (also called LOs or BLOBs). This includes a data type lo and a trigger lo_manage. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_lo "dbname""`` @@ -222,72 +222,82 @@ extension applied to. ##ltree ###supported versions: 9.0, 9.1 -This module implements a data type ltree for representing labels of data stored in a hierarchical tree-like structure. Extensive facilities +This module implements a data type ltree for representing labels of data stored in a hierarchical tree-like structure. Extensive facilities for searching through label trees are provided. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_ltree "dbname""`` ##pg_trgm -###supported versions: 9.0, 9.1 -The pg_trgm module provides GiST and GIN index operator classes that allow you to create an index over a text column for the purpose of very fast similarity searches. These index types support the above-described similarity operators, and additionally support trigram-based index searches for LIKE and ILIKE queries. (These indexes do not support equality nor simple comparison operators, so you may need a regular B-tree index too.). +###supported versions: 9.0, 9.1, 9.2 +The pg_trgm module provides GiST and GIN index operator classes that allow you to create an index over a text column for the purpose of very fast similarity searches. These index types support the above-described similarity operators, and additionally support trigram-based index searches for LIKE and ILIKE queries. (These indexes do not support equality nor simple comparison operators, so you may need a regular B-tree index too.). -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_pg_trgm "dbname""`` ##pgcrypto -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 The pgcrypto module provides cryptographic functions for PostgreSQL. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_pgcrypto "dbname""`` ##pgrowlocks -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 The pgrowlocks module provides a function to show row locking information for a specified table. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_pgrowlocks "dbname""`` +##pg_stat_statements +###supported versions: 9.2 +The pg_stat_statements module provides a means for tracking execution statistics of all SQL statements executed by a server. + +Enabling this extension: + +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +extension applied to. + +``postgresql9_pg_stat_statements "dbname""`` ##PostGIS ###supported versions: 9.0, 9.1 -This extension adds support for geographic objects. PostGIS "spatially enables" the PostgreSQL server, allowing it to be used as a backend +This extension adds support for geographic objects. PostGIS "spatially enables" the PostgreSQL server, allowing it to be used as a backend spatial database for geographic information systems (GIS). -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_postgis "dbname""`` ##seg -###supported versions: 9.0, 9.1 -This module implements a data type seg for representing line segments, or floating point intervals. seg can represent uncertainty in the +###supported versions: 9.0, 9.1, 9.2 +This module implements a data type seg for representing line segments, or floating point intervals. seg can represent uncertainty in the interval endpoints, making it especially useful for representing laboratory measurements. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_seg "dbname""`` @@ -297,33 +307,33 @@ extension applied to. ###supported versions: 9.0, 9.1 The sslinfo module provides information about the SSL certificate that the current client provided when connecting to PostgreSQL. The module is useless (most functions will return NULL) if the current connection does not use SSL. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_sslinfo "dbname""`` ##tablefunc -###supported versions: 9.0, 9.1 -The tablefunc module includes various functions that return tables (that is, multiple rows). These functions are useful both in their own +###supported versions: 9.0, 9.1, 9.2 +The tablefunc module includes various functions that return tables (that is, multiple rows). These functions are useful both in their own right and as examples of how to write C functions that return multiple rows. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_tablefunc "dbname""`` ##test_parser -###supported versions: 9.0, 9.1 +###supported versions: 9.0, 9.1, 9.2 test_parser is an example of a custom parser for full-text search. It doesn't do anything especially useful, but can serve as a starting point for developing your own parser. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_test_parser "dbname""`` @@ -331,69 +341,69 @@ extension applied to. ##unaccent ###supported versions: 9.0, 9.1 -unaccent is a text search dictionary that removes accents (diacritic signs) from lexemes. It's a filtering dictionary, which means its output -is always passed to the next dictionary (if any), unlike the normal behavior of dictionaries. This allows accent-insensitive processing for +unaccent is a text search dictionary that removes accents (diacritic signs) from lexemes. It's a filtering dictionary, which means its output +is always passed to the next dictionary (if any), unlike the normal behavior of dictionaries. This allows accent-insensitive processing for full text search. -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_unaccent "dbname""`` ##uuid-ossp -###supported versions: 9.0, 9.1 -The uuid-ossp module provides functions to generate universally unique identifiers (UUIDs) using one of several standard algorithms. There are -also functions to produce certain special UUID constants. (This also requires a separate USE flag when building the postgres binaries that pulls +###supported versions: 9.0, 9.1, 9.2 +The uuid-ossp module provides functions to generate universally unique identifiers (UUIDs) using one of several standard algorithms. There are +also functions to produce certain special UUID constants. (This also requires a separate USE flag when building the postgres binaries that pulls in another package.) -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_uuid_ossp "dbname""`` ##xml2 -###supported versions: 9.1 -The uuid-ossp module provides functions to generate universally unique identifiers (UUIDs) using one of several standard algorithms. There are -also functions to produce certain special UUID constants. (This also requires a separate USE flag when building the postgres binaries that pulls +###supported versions: 9.1, 9.2 +The uuid-ossp module provides functions to generate universally unique identifiers (UUIDs) using one of several standard algorithms. There are +also functions to produce certain special UUID constants. (This also requires a separate USE flag when building the postgres binaries that pulls in another package.) -Enabling this extension: +Enabling this extension: -* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this extension applied to. ``postgresql9_xml2 "dbname""`` -Admin-level Contrib packages +Admin-level Contrib packages --------------------------------------------- Notes: This module requires a privileged user. Please log in as the postgres user to use the extension ##pg_buffercache -###supported versions: 9.0 -The pg_buffercache module provides a means for examining what's happening in the shared buffer cache in real time. +###supported versions: 9.0, 9.2 +The pg_buffercache module provides a means for examining what's happening in the shared buffer cache in real time. -Enabling this Module: +Enabling this Module: -* Edit main/recipes/default.rb and comment out the line shown below. +* Edit main/recipes/default.rb and comment out the line shown below. ``postgresql9_pg_buffercache "postgres""`` ##pg_freespacemap -###supported versions: 9.0 -The pg_freespacemap module provides a means for examining the free space map (FSM). It provides a function called pg_freespace, -or two overloaded functions, to be precise. The functions show the value recorded in the free space map for a given page, or for all -pages in the relation. +###supported versions: 9.0, 9.2 +The pg_freespacemap module provides a means for examining the free space map (FSM). It provides a function called pg_freespace, +or two overloaded functions, to be precise. The functions show the value recorded in the free space map for a given page, or for all +pages in the relation. -Enabling this Module: +Enabling this Module: -* Edit main/recipes/default.rb and comment out the line shown below. +* Edit main/recipes/default.rb and comment out the line shown below. ``postgresql9_pg_freespacemap "postgres""`` @@ -404,11 +414,11 @@ Note: This module requires a priviledged user. Please log in as the postgres use Uploading this recipe -------------------------- -1. Edit main/recipes/default.rb to enable or disable extensions as shown above. +1. Edit main/recipes/default.rb to enable or disable extensions as shown above. 2. Upload recipes to your environment -``ey recipes upload -e `` +``ey recipes upload -e `` 3. Apply recipes to your environment @@ -422,21 +432,14 @@ This cookbook is work in progress and will be expanded to incorporate additional Caveats -------- -None so far. +None so far. Known Bugs -------- -None so far. - - -Warranty --------- -This cookbook is provided as is, there is no offer of support for this -recipe by Engine Yard in any capacity. If you find bugs, please open an -issue and submit a pull request. +None so far. Credits -------- -Thanks to Erik Jones, Scott Likens, Joel Watson, Edward Muller, and Jayson Vantuyl for their help. +Thanks to Erik Jones, Scott Likens, Joel Watson, Edward Muller, and Jayson Vantuyl for their help. diff --git a/cookbooks/postgresql9_extensions/attributes/recipe.rb b/cookbooks/postgresql9_extensions/attributes/recipe.rb index 8cb8d70b5..f2933a1f5 100644 --- a/cookbooks/postgresql9_extensions/attributes/recipe.rb +++ b/cookbooks/postgresql9_extensions/attributes/recipe.rb @@ -4,5 +4,7 @@ postgres_version("9.0") elsif db_stack == "postgres9_1" postgres_version("9.1") +elsif db_stack == "postgres9_2" + postgres_version("9.2") end -postgres_root("/db/postgresql/") \ No newline at end of file +postgres_root("/db/postgresql/") diff --git a/cookbooks/postgresql9_extensions/definitions/auto_explain.rb b/cookbooks/postgresql9_extensions/definitions/auto_explain.rb index c8f1d14b3..410f09b6d 100644 --- a/cookbooks/postgresql9_extensions/definitions/auto_explain.rb +++ b/cookbooks/postgresql9_extensions/definitions/auto_explain.rb @@ -1,14 +1,12 @@ define :postgresql9_autoexplain do dbname_to_use = params[:name] - - load_shared_library do - db_name dbname_to_use + + load_shared_library do + db_name dbname_to_use library_name "auto_explain" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - + include_recipe "postgresql9_extensions::ext_autoexplain" end - - diff --git a/cookbooks/postgresql9_extensions/definitions/btree_gin.rb b/cookbooks/postgresql9_extensions/definitions/btree_gin.rb index 051aa3581..f02725cc8 100644 --- a/cookbooks/postgresql9_extensions/definitions/btree_gin.rb +++ b/cookbooks/postgresql9_extensions/definitions/btree_gin.rb @@ -1,11 +1,10 @@ define :postgresql9_btree_gin do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use username "postgres" extname "btree_gin" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/btree_gist.rb b/cookbooks/postgresql9_extensions/definitions/btree_gist.rb index abbfd04bf..88ca771a1 100644 --- a/cookbooks/postgresql9_extensions/definitions/btree_gist.rb +++ b/cookbooks/postgresql9_extensions/definitions/btree_gist.rb @@ -1,11 +1,10 @@ define :postgresql9_btree_gist do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use username "postgres" extname "btree_gist" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/chkpass.rb b/cookbooks/postgresql9_extensions/definitions/chkpass.rb index e7fefcb6c..4c9e1ec38 100644 --- a/cookbooks/postgresql9_extensions/definitions/chkpass.rb +++ b/cookbooks/postgresql9_extensions/definitions/chkpass.rb @@ -1,11 +1,10 @@ define :postgresql9_chkpass do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use username "postgres" extname "chkpass" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/citext.rb b/cookbooks/postgresql9_extensions/definitions/citext.rb index f1edaac23..93edfd177 100644 --- a/cookbooks/postgresql9_extensions/definitions/citext.rb +++ b/cookbooks/postgresql9_extensions/definitions/citext.rb @@ -1,10 +1,9 @@ define :postgresql9_citext do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "citext" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/cube.rb b/cookbooks/postgresql9_extensions/definitions/cube.rb index 5479418f7..9802a0d13 100644 --- a/cookbooks/postgresql9_extensions/definitions/cube.rb +++ b/cookbooks/postgresql9_extensions/definitions/cube.rb @@ -1,10 +1,9 @@ define :postgresql9_cube do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "cube" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/dblink.rb b/cookbooks/postgresql9_extensions/definitions/dblink.rb index 97c7e973f..69b4d4786 100644 --- a/cookbooks/postgresql9_extensions/definitions/dblink.rb +++ b/cookbooks/postgresql9_extensions/definitions/dblink.rb @@ -1,10 +1,9 @@ define :postgresql9_dblink do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "dblink" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/dict_int.rb b/cookbooks/postgresql9_extensions/definitions/dict_int.rb index cfb825c71..42f203405 100644 --- a/cookbooks/postgresql9_extensions/definitions/dict_int.rb +++ b/cookbooks/postgresql9_extensions/definitions/dict_int.rb @@ -1,10 +1,9 @@ define :postgresql9_dict_int do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "dict_int" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/dict_xsyn.rb b/cookbooks/postgresql9_extensions/definitions/dict_xsyn.rb index b7bf80cc1..2b5f99cd0 100644 --- a/cookbooks/postgresql9_extensions/definitions/dict_xsyn.rb +++ b/cookbooks/postgresql9_extensions/definitions/dict_xsyn.rb @@ -1,10 +1,9 @@ define :postgresql9_dict_xsyn do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "dict_xsyn" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/earthdistance.rb b/cookbooks/postgresql9_extensions/definitions/earthdistance.rb index c399e25d5..c0be39601 100644 --- a/cookbooks/postgresql9_extensions/definitions/earthdistance.rb +++ b/cookbooks/postgresql9_extensions/definitions/earthdistance.rb @@ -1,10 +1,9 @@ define :postgresql9_earthdistance do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "earthdistance" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/file_fdw.rb b/cookbooks/postgresql9_extensions/definitions/file_fdw.rb index a9112ff2b..e4fdb8349 100644 --- a/cookbooks/postgresql9_extensions/definitions/file_fdw.rb +++ b/cookbooks/postgresql9_extensions/definitions/file_fdw.rb @@ -1,10 +1,9 @@ define :postgresql9_file_fdw do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "file_fdw" - supported_versions %w[9.1] + supported_versions %w[9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/fuzzystrmatch.rb b/cookbooks/postgresql9_extensions/definitions/fuzzystrmatch.rb index b7fca68e2..78b938190 100644 --- a/cookbooks/postgresql9_extensions/definitions/fuzzystrmatch.rb +++ b/cookbooks/postgresql9_extensions/definitions/fuzzystrmatch.rb @@ -1,10 +1,9 @@ define :postgresql9_fuzzystrmatch do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "fuzzystrmatch" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/hstore.rb b/cookbooks/postgresql9_extensions/definitions/hstore.rb index 12903cd7e..ba0f06ad3 100644 --- a/cookbooks/postgresql9_extensions/definitions/hstore.rb +++ b/cookbooks/postgresql9_extensions/definitions/hstore.rb @@ -1,10 +1,9 @@ define :postgresql9_hstore do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "hstore" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/intarray.rb b/cookbooks/postgresql9_extensions/definitions/intarray.rb index 17530a90b..1dc4429de 100644 --- a/cookbooks/postgresql9_extensions/definitions/intarray.rb +++ b/cookbooks/postgresql9_extensions/definitions/intarray.rb @@ -1,10 +1,9 @@ define :postgresql9_intarray do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "intarray" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/isn.rb b/cookbooks/postgresql9_extensions/definitions/isn.rb index 430e895c6..52223df7f 100644 --- a/cookbooks/postgresql9_extensions/definitions/isn.rb +++ b/cookbooks/postgresql9_extensions/definitions/isn.rb @@ -1,10 +1,9 @@ define :postgresql9_isn do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "isn" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/lo.rb b/cookbooks/postgresql9_extensions/definitions/lo.rb index b8da6190f..b894331cc 100644 --- a/cookbooks/postgresql9_extensions/definitions/lo.rb +++ b/cookbooks/postgresql9_extensions/definitions/lo.rb @@ -1,10 +1,9 @@ define :postgresql9_lo do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "lo" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/load_shared_library.rb b/cookbooks/postgresql9_extensions/definitions/load_shared_library.rb index 9269333ee..7bf13d946 100644 --- a/cookbooks/postgresql9_extensions/definitions/load_shared_library.rb +++ b/cookbooks/postgresql9_extensions/definitions/load_shared_library.rb @@ -2,7 +2,7 @@ library_name = params[:library_name] db_name = params[:db_name] supported_versions = params[:supported_versions] - + if @node[:postgres_version] == "9.0" && supported_versions.include?("9.0") execute "Postgresql loading library #{library_name}" do command "psql -U postgres -d #{db_name} -c \"LOAD \'#{library_name}\'\";" @@ -11,9 +11,9 @@ execute "Postgresql loading library #{library_name}" do command "psql -U postgres -d #{db_name} -c \"LOAD \'#{library_name}\'\";" end + elsif @node[:postgres_version] == "9.2" && supported_versions.include?("9.2") + execute "Postgresql loading library #{library_name}" do + command "psql -U postgres -d #{db_name} -c \"LOAD \'#{library_name}\'\";" + end end - end - - - \ No newline at end of file diff --git a/cookbooks/postgresql9_extensions/definitions/load_sql_file.rb b/cookbooks/postgresql9_extensions/definitions/load_sql_file.rb index f83e3a920..cfa3e9e64 100644 --- a/cookbooks/postgresql9_extensions/definitions/load_sql_file.rb +++ b/cookbooks/postgresql9_extensions/definitions/load_sql_file.rb @@ -2,9 +2,9 @@ db_name = params[:db_name] extname = params[:extname] supported_versions = params[:supported_versions] - - Chef::Log.info "Loading to database #{db_name} extension #{extname} supported on versions: (#{supported_versions}). PG version installed is #{@node[:postgres_version]}" - + + Chef::Log.info "Loading to database #{db_name} extension #{extname} supported on versions: #{supported_versions.join(", ")}. PG version installed is #{@node[:postgres_version]}" + if @node[:postgres_version] == "9.0" && supported_versions.include?("9.0") execute "Postgresql loading contrib #{extname} on database #{db_name}" do command "psql -U postgres -d #{db_name} -f /usr/share/postgresql-9.0/contrib/#{extname}.sql" @@ -13,6 +13,9 @@ execute "Postgresql loading extension #{extname}" do command "psql -U postgres -d #{db_name} -c \"CREATE EXTENSION IF NOT EXISTS #{extname}\";" end + elsif @node[:postgres_version] == "9.2" && supported_versions.include?("9.2") + execute "Postgresql loading extension #{extname}" do + command "psql -U postgres -d #{db_name} -c \"CREATE EXTENSION IF NOT EXISTS #{extname}\";" + end end - end diff --git a/cookbooks/postgresql9_extensions/definitions/ltree.rb b/cookbooks/postgresql9_extensions/definitions/ltree.rb index 868ee7558..c1005fdc4 100644 --- a/cookbooks/postgresql9_extensions/definitions/ltree.rb +++ b/cookbooks/postgresql9_extensions/definitions/ltree.rb @@ -1,10 +1,9 @@ define :postgresql9_ltree do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "ltree" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/pg_buffercache.rb b/cookbooks/postgresql9_extensions/definitions/pg_buffercache.rb index a851765c5..2184c910e 100644 --- a/cookbooks/postgresql9_extensions/definitions/pg_buffercache.rb +++ b/cookbooks/postgresql9_extensions/definitions/pg_buffercache.rb @@ -1,9 +1,9 @@ define :postgresql9_pg_buffercache do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "pg_buffercache" - supported_versions %w[9.0] + supported_versions %w[9.0 9.2] end -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/pg_freespacemap.rb b/cookbooks/postgresql9_extensions/definitions/pg_freespacemap.rb index 15f1feb95..6db483d90 100644 --- a/cookbooks/postgresql9_extensions/definitions/pg_freespacemap.rb +++ b/cookbooks/postgresql9_extensions/definitions/pg_freespacemap.rb @@ -1,9 +1,9 @@ define :postgresql9_pg_freespacemap do - dbname_to_use = params[:name] - + dbname_to_use = params[:name] + load_sql_file do db_name dbname_to_use extname "pg_freespacemap" - supported_versions %w[9.0] + supported_versions %w[9.0 9.2] end -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/pg_stat_statements.rb b/cookbooks/postgresql9_extensions/definitions/pg_stat_statements.rb new file mode 100644 index 000000000..5b4c6b928 --- /dev/null +++ b/cookbooks/postgresql9_extensions/definitions/pg_stat_statements.rb @@ -0,0 +1,9 @@ +define :postgresql9_pg_stat_statements do + dbname_to_use = params[:name] + + load_sql_file do + db_name dbname_to_use + extname "pg_stat_statements" + supported_versions %w[9.2] + end +end diff --git a/cookbooks/postgresql9_extensions/definitions/pg_trgm.rb b/cookbooks/postgresql9_extensions/definitions/pg_trgm.rb index 9f152f1bf..527a6415d 100644 --- a/cookbooks/postgresql9_extensions/definitions/pg_trgm.rb +++ b/cookbooks/postgresql9_extensions/definitions/pg_trgm.rb @@ -1,10 +1,9 @@ define :postgresql9_pg_trgm do - dbname_to_use = params[:name] - + dbname_to_use = params[:name] + load_sql_file do db_name dbname_to_use extname "pg_trgm" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/pgcrypto.rb b/cookbooks/postgresql9_extensions/definitions/pgcrypto.rb index ee0f5b2c2..79942e037 100644 --- a/cookbooks/postgresql9_extensions/definitions/pgcrypto.rb +++ b/cookbooks/postgresql9_extensions/definitions/pgcrypto.rb @@ -1,10 +1,9 @@ define :postgresql9_pgcrypto do - dbname_to_use = params[:name] - + dbname_to_use = params[:name] + load_sql_file do db_name dbname_to_use extname "pgcrypto" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/pgrowlocks.rb b/cookbooks/postgresql9_extensions/definitions/pgrowlocks.rb index 41010dd44..a6d9cf78a 100644 --- a/cookbooks/postgresql9_extensions/definitions/pgrowlocks.rb +++ b/cookbooks/postgresql9_extensions/definitions/pgrowlocks.rb @@ -1,10 +1,9 @@ define :postgresql9_pgrowlocks do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "pgrowlocks" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/postgis.rb b/cookbooks/postgresql9_extensions/definitions/postgis.rb index d884c6928..a527fa9d0 100644 --- a/cookbooks/postgresql9_extensions/definitions/postgis.rb +++ b/cookbooks/postgresql9_extensions/definitions/postgis.rb @@ -1,47 +1,48 @@ define :postgresql9_postgis do dbname_to_use = params[:name] - + if @node[:postgres_version] == "9.0" include_recipe "postgresql9_extensions::ext_postgis_install" - - load_sql_file do + + load_sql_file do db_name dbname_to_use supported_versions %w[9.0] - extname "postgis-1.5/postgis" + extname "postgis-1.5/postgis" end - - load_sql_file do + + load_sql_file do db_name dbname_to_use supported_versions %w[9.0] - extname "postgis-1.5/spatial_ref_sys" + extname "postgis-1.5/spatial_ref_sys" end - - load_sql_file do + + load_sql_file do db_name dbname_to_use supported_versions %w[9.0] - extname"postgis-1.5/postgis_comments" + extname"postgis-1.5/postgis_comments" end - elsif @node[:postgres_version] == "9.1" + elsif @node[:postgres_version] == "9.1" include_recipe "postgresql9_extensions::ext_postgis_install" execute "Postgresql loading postgis on database #{dbname_to_use} for version 9.1 as a contrib" do command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-9.1/contrib/postgis-1.5/postgis.sql" end - + execute "Postgresql loading spatial_ref_sys on database #{dbname_to_use} for version 9.1 as a contrib" do command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-9.1/contrib/postgis-1.5/spatial_ref_sys.sql" end - + execute "Postgresql loading postgis_comments on database #{dbname_to_use} for version 9.1 as a contrib" do command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-9.1/contrib/postgis-1.5/postgis_comments.sql" end - + elsif @node[:postgres_version] == "9.2" + Chef::Log.info "PostGIS support for 9.2 is coming soon" end - + execute "Grant permissions to the deploy user on the geometry_columns schema" do command "psql -U postgres -d #{dbname_to_use} -c \"GRANT all on geometry_columns to deploy\"" end - + execute "Grant permissions to the deploy user on the spatial_ref_sys schema" do command "psql -U postgres -d #{dbname_to_use} -c \"GRANT all on spatial_ref_sys to deploy\"" end diff --git a/cookbooks/postgresql9_extensions/definitions/seg.rb b/cookbooks/postgresql9_extensions/definitions/seg.rb index 6fd028860..dc5803431 100644 --- a/cookbooks/postgresql9_extensions/definitions/seg.rb +++ b/cookbooks/postgresql9_extensions/definitions/seg.rb @@ -1,10 +1,9 @@ define :postgresql9_seg do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "seg" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/sslinfo.rb b/cookbooks/postgresql9_extensions/definitions/sslinfo.rb index ed71e1603..ff09df8f8 100644 --- a/cookbooks/postgresql9_extensions/definitions/sslinfo.rb +++ b/cookbooks/postgresql9_extensions/definitions/sslinfo.rb @@ -7,4 +7,4 @@ supported_versions %w[9.0 9.1] end -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/tablefunc.rb b/cookbooks/postgresql9_extensions/definitions/tablefunc.rb index 2e7aae046..c761c444f 100644 --- a/cookbooks/postgresql9_extensions/definitions/tablefunc.rb +++ b/cookbooks/postgresql9_extensions/definitions/tablefunc.rb @@ -1,10 +1,9 @@ define :postgresql9_tablefunc do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "tablefunc" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/test_parser.rb b/cookbooks/postgresql9_extensions/definitions/test_parser.rb index 2e24ed953..8f14e37cb 100644 --- a/cookbooks/postgresql9_extensions/definitions/test_parser.rb +++ b/cookbooks/postgresql9_extensions/definitions/test_parser.rb @@ -1,10 +1,9 @@ define :postgresql9_test_parser do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "test_parser" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/uuid-ossp.rb b/cookbooks/postgresql9_extensions/definitions/uuid-ossp.rb index 78b6fe7e1..eaf773d40 100644 --- a/cookbooks/postgresql9_extensions/definitions/uuid-ossp.rb +++ b/cookbooks/postgresql9_extensions/definitions/uuid-ossp.rb @@ -1,10 +1,9 @@ define :postgresql9_uuid_ossp do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "uuid-ossp" - supported_versions %w[9.0 9.1] + supported_versions %w[9.0 9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/definitions/xml2.rb b/cookbooks/postgresql9_extensions/definitions/xml2.rb index fbb5a72ad..cbe2eeb5b 100644 --- a/cookbooks/postgresql9_extensions/definitions/xml2.rb +++ b/cookbooks/postgresql9_extensions/definitions/xml2.rb @@ -1,10 +1,9 @@ define :postgresql9_xml2 do - dbname_to_use = params[:name] - - load_sql_file do + dbname_to_use = params[:name] + + load_sql_file do db_name dbname_to_use extname "xml2" - supported_versions %w[9.1] + supported_versions %w[9.1 9.2] end - -end \ No newline at end of file +end diff --git a/cookbooks/postgresql9_extensions/recipes/ext_autoexplain.rb b/cookbooks/postgresql9_extensions/recipes/ext_autoexplain.rb index 2e71803cc..55a65343d 100644 --- a/cookbooks/postgresql9_extensions/recipes/ext_autoexplain.rb +++ b/cookbooks/postgresql9_extensions/recipes/ext_autoexplain.rb @@ -12,6 +12,7 @@ mode 0600 backup 0 variables({ + :db_version => @node[:postgres_version], :shared_preload_libraries => "'auto_explain'", :custom_variable_classes => "'auto_explain'", :auto_explain_log_min_duration => "'3s'", diff --git a/cookbooks/postgresql9_extensions/recipes/ext_postgis_install.rb b/cookbooks/postgresql9_extensions/recipes/ext_postgis_install.rb index 3dd64470c..fd7ef15f5 100644 --- a/cookbooks/postgresql9_extensions/recipes/ext_postgis_install.rb +++ b/cookbooks/postgresql9_extensions/recipes/ext_postgis_install.rb @@ -2,7 +2,7 @@ postgis_version = "1.5.2" proj_version = "4.6.1" geos_version = "3.2.2" - + package_use "sci-libs/geos" do flags "-ruby" end @@ -45,7 +45,7 @@ execute "setting emerge options" do command "emerge --ignore-default-opts dev-db/postgis" end - +elsif@node[:postgres_version] == "9.2" end diff --git a/cookbooks/postgresql9_extensions/templates/default/custom_autoexplain.erb b/cookbooks/postgresql9_extensions/templates/default/custom_autoexplain.erb index 3c628b717..09dc240cb 100644 --- a/cookbooks/postgresql9_extensions/templates/default/custom_autoexplain.erb +++ b/cookbooks/postgresql9_extensions/templates/default/custom_autoexplain.erb @@ -1,5 +1,6 @@ # ------------------------------------ # PostgreSQL Custom configuration file +# DB Version: <%= @db_version %> # ------------------------------------ # # This file was created by the postgresql9_extensions custom chef run @@ -12,5 +13,6 @@ auto_explain.log_buffers = <%= @auto_explain_log_buffers %> auto_explain.log_format = <%= @auto_explain_log_format %> auto_explain.log_nested_statements = <%= @auto_explain_log_nested_statements %> shared_preload_libraries = <%= @shared_preload_libraries %> -custom_variable_classes = <%= @custom_variable_classes %> - +<% if @db_version != "9.2" %> + custom_variable_classes = <%= @custom_variable_classes %> +<% end %>