Sha256: 82e1279de176000fdd01a9adfdda038b1f12e798d9bd8ff62b71368ac8f39f26

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

#!/usr/bin/env ruby

PRJ_DIR = "/home/clr/prj"

$: << "#{ENV['PWD']}/lib" << "#{PRJ_DIR}/pg_util/lib"

require 'pg_util.rb'
require 'pg_ctrl.rb'


rdbms = PgCtrl::RDBMS.new

print "Databases\n"
rdbms.databases.values.each { |d|
  print "   #{d}\n"
  print "      OID: #{d.oid}\n"
  print "      Owner: #{d.owner}\n"
  print "      Encoding: #{d.encoding}\n"
  print "      LC Collate: #{d.lc_collate}\n"
  print "      LC CType: #{d.lc_ctype}\n"
  print "      Template: #{d.template?}\n"
  print "      Can connect: #{d.can_connect?}\n"
}
print "\n"

print "Users\n"
rdbms.users.values.each { |u|
  print "   #{u}\n"
  print "      OID: #{u.oid}\n"
  print "      Superuser: #{u.superuser?}\n"
  print "      Can create DB: #{u.can_create_db?}\n"
  print "      Can create role: #{u.can_create_role?}\n"
  print "      Can login: #{u.can_login?}\n"

}
print "\n"

print "RDBMS #{rdbms}\n"
print "   host: #{rdbms.host}\n"
print "   port: #{rdbms.port}\n"
print "   user: #{rdbms.user}\n"
print "   database: #{rdbms.database}\n"
print "\n"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pg_ctrl-0.0.8 main