Created
January 31, 2015 22:24
-
-
Save apeiros/3ef8b75e9855f19d1e15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pg.exec_params("CREATE TABLE foos (data bytea)") | |
para = Array.new(256).pack("C*") # => "\x00\x01\x02\x03\x04\x05…\xFE\xFF" | |
pg.exec_params("INSERT INTO foos ($1)", [para]) | |
pg.exec_params("SELECT * FROM foos").to_a # => [{"data"=>"\\x"}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment