Skip to content

Commit

Permalink
PG Extensions: Added support for dict_int, dict_xsyn, intarray, sslin…
Browse files Browse the repository at this point in the history
…fo, test_parser, and xml2
  • Loading branch information
Ines Sombra committed Feb 6, 2012
1 parent 8f50194 commit bcba9b4
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cookbooks/main/recipes/default.rb
Expand Up @@ -80,7 +80,7 @@
#require_recipe "newrelic_server_monitoring"

#enable Extension modules for a given Postgresql database
# if ['solo','db_master', 'db_slave'].include?(node[:instance_role])
if ['solo','db_master', 'db_slave'].include?(node[:instance_role])
# Extensions supported by 9.0
# postgresql9_postgis "dbname"

Expand All @@ -92,26 +92,33 @@
# postgresql9_citext "dbname"
# postgresql9_cube "dbname"
# postgresql9_dblink "dbname"
# postgresql9_dict_int "dbname"
# postgresql9_dict_xsyn "dbname"
# postgresql9_earthdistance "dbname"
# postgresql9_fuzzystrmatch "dbname"
# postgresql9_hstore "dbname"
# postgresql9_intarray "dbname"
# postgresql9_isn "dbname"
# postgresql9_lo "dbname"
# postgresql9_ltree "dbname"
# postgresql9_pg_trgm "dbname"
# postgresql9_pgcrypto "dbname"
# postgresql9_pgrowlocks "dbname"
# 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"
# postgresql9_xml2 "dbname"

#Admin-Level Contribs
# postgresql9_pg_buffercache "postgres"
# postgresql9_pg_freespacemap "postgres"
# postgresql9_pg_stat_statements "todo" - Not done

# end
end
70 changes: 70 additions & 0 deletions cookbooks/postgresql9_extensions/README.md
Expand Up @@ -100,6 +100,28 @@ extension applied to.

``postgresql9_dblink "dbname""``

##dict_int
###supported versions: 9.0, 9.1
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:

* 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
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:

* 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
Expand Down Expand Up @@ -150,6 +172,18 @@ extension applied to.

``postgresql9_hstore "dbname""``

##intarray
###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:

* 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),
Expand Down Expand Up @@ -248,6 +282,17 @@ extension applied to.
``postgresql9_seg "dbname""``


##sslinfo
###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:

* 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
Expand All @@ -261,6 +306,18 @@ extension applied to.
``postgresql9_tablefunc "dbname""``


##test_parser
###supported versions: 9.0, 9.1
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:

* 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""``


##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
Expand Down Expand Up @@ -288,6 +345,19 @@ 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
in another package.)

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_xml2 "dbname""``


Admin-level Contrib packages
---------------------------------------------
Expand Down
10 changes: 10 additions & 0 deletions cookbooks/postgresql9_extensions/definitions/dict_int.rb
@@ -0,0 +1,10 @@
define :postgresql9_dict_int 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]
end

end
10 changes: 10 additions & 0 deletions cookbooks/postgresql9_extensions/definitions/dict_xsyn.rb
@@ -0,0 +1,10 @@
define :postgresql9_dict_xsyn 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]
end

end
10 changes: 10 additions & 0 deletions cookbooks/postgresql9_extensions/definitions/intarray.rb
@@ -0,0 +1,10 @@
define :postgresql9_intarray do
dbname_to_use = params[:name]

load_sql_file do
db_name dbname_to_use
extname "intarray"
supported_versions %w[9.0 9.1]
end

end
10 changes: 10 additions & 0 deletions cookbooks/postgresql9_extensions/definitions/sslinfo.rb
@@ -0,0 +1,10 @@
define :postgresql9_sslinfo do
dbname_to_use = params[:name]

load_sql_file do
db_name dbname_to_use
extname "sslinfo"
supported_versions %w[9.0 9.1]
end

end
10 changes: 10 additions & 0 deletions cookbooks/postgresql9_extensions/definitions/test_parser.rb
@@ -0,0 +1,10 @@
define :postgresql9_test_parser 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]
end

end
10 changes: 10 additions & 0 deletions cookbooks/postgresql9_extensions/definitions/xml2.rb
@@ -0,0 +1,10 @@
define :postgresql9_xml2 do
dbname_to_use = params[:name]

load_sql_file do
db_name dbname_to_use
extname "xml2"
supported_versions %w[9.1]
end

end

0 comments on commit bcba9b4

Please sign in to comment.