(docs) Port recent docs revisions to 1.6.x branch

This commit brings over the relevant changes from commit eb20757, since PuppetDB
1.6 will stay around a while for PE customers. I applied them by hand rather
than cherry-picking, to ensure no 2.1-isms would sneak over.
Merge pull request #1012 from nfagerlund/jul_2014_docs_16x

(docs) Port recent docs revisions to 1.6.x branch
(PDB-809) Store top level structured fact data as JSON

This adds the storage of the top level facts that happen to be structured in a
new column of fact_values called `value_json`. This is provided so we can query
top level facts for the /facts endpoint in a performant way, without having
to also reassemble the pieces of values into a JSON object later on.

This patch also removes some dead code from the facts endpoint code, and moves
the generalised reassembly code that was shared between facts and factsets into
a factsets specific area. Since now, this is the only endpoint that needs this
code.

Signed-off-by: Ken Barber <ken@bob.sh>
(PDB-809) Use json stored branch for factsets also

This patch fixes it so factsets can also benefit from the depth 0 json storage.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #1048 from kbarber/ticket/master/pdb-809-store-unflattened-fact-data

(PDB-809) Store top level structured fact data as JSON
(maint) Remove more dead code from facts.clj

This removes some older facts flattening code that is no longer used.

Signed-off-by: Ken Barber <ken@bob.sh>
(PDB-821) Facilitate facts subqueries against fact nodes.

This patch modifies the v4 IN and EXTRACT operators to accept multiple fields at once.
This allows the following...

    ["and" ["in", "name",
             ["extract", "name", [select-fact-nodes ["=","value",10]]]]
           ["in", "certname",
             ["extract", "certname", [select-fact-nodes ["=", "value", 10]]]]]

to be re-written as

    ["in", ["name","certname"],
      ["extract", ["name", "certname"], ["select-fact-nodes", ["=", "value", 10]]]]

As written, this will affect in and extract for all v4 endpoints, while throwing an
exception on v2/v3 to explain that vector fields are not allowed.
Merge pull request #1054 from kbarber/maint/master/more-dead-facts-code

(maint) Remove more dead code from facts.clj
Merge pull request #1053 from wkalt/ticket/master/pdb-821-fact-nodes-subquery

(PDB-821) Facilitate facts subqueries against fact nodes.
(PDB-830) Regexp array operator is too greedy

This changes the regular expression, and moves the delimiter lookahead guard
so it is only introduced when a wildcard/style search is introduced.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #1055 from kbarber/ticket/master/pdb-830-regexp-array-operator-is-too-greedy

(PDB-830) Regexp array operator is too greedy
(PDB-769) Deprecate PostgreSQL 9.2 and older

This patch deprecates PostgreSQL 9.2 and older.

Signed-off-by: Ken Barber <ken@bob.sh>
(maint) Fix regexp array operator test failures for PostgreSQL

PostgreSQL deals with lookaheads differently to HSQLDB, this work-around
switches a .* to an or'd regexp that matches in functionality but still
retains the expected look ahead behaviour. This is all to ensure we still
pin regexp lookups to within the delimiters.

I've also fixed that case where users might provide a number and expect
that to be matched exactly.

Signed-off-by: Ken Barber <ken@bob.sh>
(maint) Fix reference to greedy regexp operator

The regexp operator had a bug that made it greedy, this example in fact-paths
docs shows this bug and is now incorrect. This patch fixes the curl query.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #1057 from kbarber/maint/master/broken-regexp-test

(maint) Fix regexp array operator test failures for PostgreSQL
(PDB-834) Update documentation titles for release 2.2

This patch updates all the documentation titles to prepare for release 2.2.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #1056 from kbarber/ticket/master/pdb-769-deprecate-postgresql-93

(PDB-769) Deprecate PostgreSQL 9.2 and older
Merge pull request #1058 from kbarber/ticket/master/pdb-834-update-documentation-headers

(PDB-834) Update documentation titles for release 2.2
Merge branch '1.6.x' into stable

* 1.6.x:
  (docs) Port recent docs revisions to 1.6.x branch

Conflicts:
	documentation/api/query/v1/resources.markdown
	documentation/api/query/v2/fact-names.markdown
	documentation/api/query/v2/facts.markdown
	documentation/api/query/v2/metrics.markdown
	documentation/api/query/v2/nodes.markdown
	documentation/api/query/v2/operators.markdown
	documentation/api/query/v2/query.markdown
	documentation/api/query/v2/resources.markdown
	documentation/api/query/v3/events.markdown
	documentation/api/query/v3/query.markdown
	documentation/api/wire_format/catalog_format_v1.markdown
Merge branch 'stable'

* stable:
  (docs) Port recent docs revisions to 1.6.x branch