Skip to content

Commit

Permalink
Use updated postgres string escaping for byte arrays.
Browse files Browse the repository at this point in the history
Switching to using E'\\000'::bytea rather than just '\\000' when
escaping byte arrays.  Old syntax wasn't supported at all in 9.1,
and new is supported as far back as 8.2.
  • Loading branch information
ajuckel committed Aug 30, 2012
1 parent e40f9b9 commit 88d4896
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/arjdbc/postgresql/adapter.rb
Expand Up @@ -591,7 +591,7 @@ def quote(value, column = nil) #:nodoc:
"'#{value}'"
when String
case column.sql_type
when 'bytea' then "'#{escape_bytea(value)}'"
when 'bytea' then "E'#{escape_bytea(value)}'::bytea"
when 'xml' then "xml '#{quote_string(value)}'"
when /^bit/
case value
Expand Down

0 comments on commit 88d4896

Please sign in to comment.