Sha256: e9bb785b707ba063064fb220e8c0c246199631a03d33b65f519ada71d16a7543

Contents?: true

Size: 461 Bytes

Versions: 75

Compression:

Stored size: 461 Bytes

Contents

#!/usr/bin/env ruby

require 'pg'

c = PG.connect( dbname: 'test' )

# this one works:
c.exec( "DROP TABLE IF EXISTS foo" )
c.exec( "CREATE TABLE foo (strings character varying[]);" )

# But using a prepared statement works:
c.set_error_verbosity( PG::PQERRORS_VERBOSE )
c.prepare( 'stmt', "INSERT INTO foo VALUES ($1);" )

# This won't work
#c.exec_prepared( 'stmt', ["ARRAY['this','that']"] )

# but this will:
c.exec_prepared( 'stmt', ["{'this','that'}"] )

Version data entries

75 entries across 75 versions & 6 rubygems

Version Path
jruby-pg-0.1-java sample/array_insert.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/pg-0.20.0/sample/array_insert.rb
pg-0.20.0-x86-mingw32 sample/array_insert.rb
pg-0.20.0-x64-mingw32 sample/array_insert.rb
pg-0.20.0 sample/array_insert.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/array_insert.rb
pg-0.19.1.pre20170124220800-x64-mingw32 sample/array_insert.rb
pg-0.19.1.pre20170124220800-x86-mingw32 sample/array_insert.rb
pg-0.19.1.pre20170124220800 sample/array_insert.rb
pg-0.19.1.pre20170115074000-x64-mingw32 sample/array_insert.rb
pg-0.19.1.pre20170115074000-x86-mingw32 sample/array_insert.rb
pg-0.19.1.pre20170115074000 sample/array_insert.rb
pg-0.19.0.pre20170115074000 sample/array_insert.rb
pg-0.19.0-x86-mingw32 sample/array_insert.rb
pg-0.19.0-x64-mingw32 sample/array_insert.rb
pg-0.19.0 sample/array_insert.rb
pg-0.19.0.pre20160904200247-x86-mingw32 sample/array_insert.rb
pg-0.19.0.pre20160904200247-x64-mingw32 sample/array_insert.rb
pg-0.19.0.pre20160904200247 sample/array_insert.rb
pg-0.19.0.pre20160820113039-x86-mingw32 sample/array_insert.rb