code: func PgDatabaseByDatname(db XODB, datname pgtypes.Name) (*PgDatabase, error) {
  	var err error
  
  	// sql query
  	const sqlstr = `SELECT ` +
  		`tableoid, cmax, xmax, cmin, xmin, oid, ctid, datname, datdba, encoding, datcollate, datctype, datistemplate, datallowconn, datconnlimit, datlastsysoid, datfrozenxid, datminmxid, dattablespace, datacl ` +
  		`FROM pg_catalog.pg_database ` +
  		`WHERE datname = $1`
  
  	// run query
  	XOLog(sqlstr, datname)
  	pd := PgDatabase{}
  
  	err = db.QueryRow(sqlstr, datname).Scan(&pd.Tableoid, &pd.Cmax, &pd.Xmax, &pd.Cmin, &pd.Xmin, &pd.Oid, &pd.Ctid, &pd.Datname, &pd.Datdba, &pd.Encoding, &pd.Datcollate, &pd.Datctype, &pd.Datistemplate, &pd.Datallowconn, &pd.Datconnlimit, &pd.Datlastsysoid, &pd.Datfrozenxid, &pd.Datminmxid, &pd.Dattablespace, &pd.Datacl)
  	if err != nil {
  		return nil, err
  	}
  
  	return &pd, nil
  }
docs: // PgDatabaseByDatname retrieves a row from 'pg_catalog.pg_database' as a PgDatabase.
  //
  // Generated from index 'pg_database_datname_index'.