Minor changes to string-contains? and string-contains?-test
Merge pull request #745 from holguinj/master

Clojure cleanup in string-contains?, add/extend tests for string-contains? and dissoc-if-nil.
Changed the storage-utils require alias from sutil -> sutils
Merge pull request #742 from shrug/bugs/1.5.x/20148

(packaging) (#20148) Update logrotate script when appropriate
Merge pull request #743 from senior/maint/master/scf-storage-split

Move storage utility and hashing functions out of scf/storage.clj and into their on namespaces
Merge branch '1.5.x'

* 1.5.x:
  (packaging) (maint) Clean up the Debian rules file
  (packaging) (#20148) Update logrotate script when appropriate
PDB-67 Converting to using a bigint for catalogs table primary key

In preparation for differential updates to catalog related data (metadata and
edges) this patch converts the usage of the current catalog hash as primary
key over to using a bigint sequence instead. This allows us to update foreign
tables keys without having to also update the foreign key table.

This also has some index and table sized benefits, as the catalog hash is not
replicated multiple times but stored once. Instead the bigint is what is
replicated which is smaller (8 bits versus a 40 bit sha1 hash in this case).

Signed-off-by: Ken Barber <ken@bob.sh>
PDB-67 Remove match simple definitions from create table

This is to avoid confusion, and since we don't care about the match status for
these single column foreign keys anyway the setting is superfluous.

Signed-off-by: Ken Barber <ken@bob.sh>
PDB-67 Switch add-resources! and add-edges! to use catalog id instead of hash

For performance reasons, its better if we use a catalog id for both the
functions add-resources! and add-edges! so we can avoid the need to do a
select beforehand.

With this in mind this patch changes the behaviour of add-catalog-metadata! to
return the full generated id's so we can pluck out the id and use that later
for add-resources! and add-edges!.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #746 from kbarber/ticket/master/PDB-67-change-catalog-to-use-ids

PDB-67 Converting to using a bigint for catalogs table primary key
(22977) Add a debugging option to help diagnose catalogs for a host that hash to different values

Added a new global config parameter to allow debugging of catalogs that hash to
a different value. This commit also changes the JSON format of the catalog used
for hashing to something more human readable. The following PRs were also related
to this change:

https://github.com/puppetlabs/puppetdb/pull/743
https://github.com/puppetlabs/puppetdb/pull/740
PDB-70 Add index on catalog_resources.exported

This increases performance for exported resource collection queries. For
postgresql the index is only a partial on exported = true, since indexing on
the very common 'false' case is not that effective.

Signed-off-by: Ken Barber <ken@bob.sh>
Replace insert-values with a select query for postgresql <= 8.1

Returning support was not added until PostgreSQL 8.2. This code has instead
been modified to fake it for PostgreSQL 8.1 by doing an SQL query on the
data in question after inserting.

This concept is known as RETURNING and was added in 8.2 as documented
in E.24.1 of the 8.2 guide:

    http://www.postgresql.org/docs/8.2/static/release-8-2.html

Signed-off-by: Ken Barber <ken@bob.sh>
PDB-84 Update to latest version of PostgreSQL JDBC driver

The PostgreSQL upstream finally has uploaded a new revision of their JDBC
driver, but to a new organisation name on maven it seems:

    http://mvnrepository.com/artifact/org.postgresql/postgresql

As linked from their download site:

    http://jdbc.postgresql.org/download.html

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #749 from kbarber/maint/master/bug-in-postgresql81-from-hash-to-id-change

Replace insert-values with a select query for postgresql <= 8.1
Added a new Troubleshooting Low Catalog Duplication guide and other docs
for the new catalog hash debugging feature
Merge pull request #750 from kbarber/ticket/master/PDB-84-latest-jdbc-version

PDB-84 Update to latest version of PostgreSQL JDBC driver
Added warnings when catalog hash debugging is enabled
Changed catalog debugging paths to be platform agnostic.

Updated storage.clj clojure docs to include ctalog-hash-debug-dir info

Refactored generated-stream/generated-string usage to default the date-format
and pretty print settings
Fix cli with no argument handling

Seems the cli.tools 0.2.2 library decided to change its API and is now
not returning nil valued entries when there is no default. This has played
havoc with our required-args detection, meaning that when you attempt to
call a command without any arguments you get a nasty exception.

This patch fixes this, and adds acceptance tests to ensure we don't regress.

Signed-off-by: Ken Barber <ken@bob.sh>