These are chat archives for ged/ruby-pg

13th
Jun 2017
Michael Granger
@ged
Jun 13 01:04

@ridiculous : The docs say:

Specifies command-line options to send to the server at connection start. For example, setting this to -c geqo=off sets the session's value of the geqo parameter to off. Spaces within this string are considered to separate command-line arguments, unless escaped with a backslash (); write \ to represent a literal backslash. For a detailed discussion of the available options, consult Chapter 19.

Michael Granger
@ged
Jun 13 01:14
So for example:
[1] pry(main)> c = PG.connect( dbname: 'test', options: '-c search_path=foo,bar,baz,public' )
=> #<PG::Connection:0x007fd958b26f40>
[2] pry(main)> r = c.exec( "SHOW search_path" )
=> #<PG::Result:0x007fd957ef98d0 status=PGRES_TUPLES_OK ntuples=1 nfields=1 cmd_tuples=0>
[3] pry(main)> r.to_a
=> [{"search_path"=>"foo,bar,baz,public"}]
Ryan Buckley
@ridiculous
Jun 13 17:38
Ah cool, thank you!