We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 92023f1 + 6f6da92 commit cd31c71Copy full SHA for cd31c71
lib/puppet/provider/postgresql_psql/ruby.rb
@@ -51,7 +51,7 @@ def run_unless_sql_command(sql)
51
end
52
53
def run_sql_command(sql)
54
- command = 'psql -t -c "' << sql.gsub('"', '\"') << '"'
+ command = %{psql #{"-d #{resource[:db]}" if resource[:db]} -t -c "#{sql.gsub('"', '\"')}"}
55
if resource[:cwd]
56
Dir.chdir resource[:cwd] do
57
Puppet::Util::SUIDManager.run_and_capture(command, resource[:psql_user], resource[:psql_group])
0 commit comments