Using Debian's 0.24.1-1 with postgres 8.1 on etch, I get the following error when trying to collect tagged resources:
ERROR: invalid input syntax for type boolean: "param_values.value = 'bind' and param_names.name = 'tags'"
The SQL statement in question looks like this (reformatted):
SELECT
resources."id" AS t0_r0,
resources."title" AS t0_r1,
[...]
FROM
resources
LEFT OUTER JOIN param_values ON param_values.resource_id = resources.id
LEFT OUTER JOIN param_names ON param_names.id = param_values.param_name_id
WHERE
(host_id != 9 AND (exported='t' AND restype='File')
AND
('param_values.value = ''bind'' and param_names.name = ''tags'''))
This is caused by this manifest snippet:
File<<| tags == bind |>>
and can be fixed by applying this patch:
diff --git a/lib/puppet/parser/collector.rb b/lib/puppet/parser/collector.rb
index b8165a8..ec57b0d 100644
--- a/lib/puppet/parser/collector.rb
+++ b/lib/puppet/parser/collector.rb
@@ -51,7 +51,7 @@ class Puppet::Parser::Collector
search = "(exported=? AND restype=?)"
values = [true, @type]
- search += " AND (?)" and values << @equery if @equery
+ search += " AND (%s)" % @equery if @equery
# We're going to collect objects from rails, but we don't want any
# objects from this host.
adding @equery to values causes rails to "correctly" quote it as a value, but this is of course not the intended thing to quote, since it contains the query snippet which was generated in lib/puppet/parser/ast/collexpr.rb:evaluate.
I'm not sure whether this is totally the right patch, but it Woskr For Me[tm].