Sha256: 14d93dd3b49289452eba28ac89616e004f2ca5b0c26f7e5062c7d274fea7db28
Contents?: true
Size: 401 Bytes
Versions: 123
Compression:
Stored size: 401 Bytes
Contents
# -*- ruby -*- require 'pg' require 'stringio' # An example of how to stream data to your local host from the database as CSV. $stderr.puts "Opening database connection ..." conn = PG.connect( :dbname => 'test' ) $stderr.puts "Running COPY command ..." buf = '' conn.transaction do conn.exec( "COPY logs TO STDOUT WITH csv" ) $stdout.puts( buf ) while buf = conn.get_copy_data end conn.finish
Version data entries
123 entries across 123 versions & 4 rubygems