  We use the BOSS DR12 galaxy power spectrum to constrain compensated
isocurvature perturbations (CIP), which are opposite-sign primordial baryon and
dark matter perturbations that leave the total matter density unchanged.
Long-wavelength CIP $\sigma(\vec{x})$ enter the galaxy density contrast as
$\delta_g(\vec{x}) \supset b_\sigma\sigma(\vec{x})$, with $b_\sigma$ the linear
CIP galaxy bias parameter. We parameterize the CIP spectra as $P_{\sigma\sigma}
= A^2P_{\mathcal{R}\mathcal{R}}$ and $P_{\sigma\mathcal{R}} =
\xi\sqrt{P_{\sigma\sigma}P_{\mathcal{R}\mathcal{R}}}$, where $A$ is the CIP
amplitude and $\xi$ is the correlation with the curvature perturbations
$\mathcal{R}$. We find a significance of detection of $Ab_\sigma \neq 0$ of
$1.8\sigma$ for correlated ($\xi = 1$) and $3.7\sigma$ for uncorrelated ($\xi =
0$) CIP. Large-scale data systematics have a bigger impact for uncorrelated
CIP, which may explain the large significance of detection. The constraints on
$A$ depend on the assumed priors for the $b_\sigma$ parameter, which we
estimate using separate universe simulations. Assuming $b_\sigma$ values
representative of all halos we find $\sigma_A = 145$ for correlated CIP and
$\sigma_{|A|} = 475$ for uncorrelated CIP. Our strongest uncorrelated CIP
constraint is for $b_\sigma$ representative of the $33\%$ most concentrated
halos, $\sigma_{|A|} = 197$, which is better than the current CMB bounds $|A|
\lesssim 360$. We also discuss the impact of the local primordial
non-Gaussianity parameter $f_{\rm NL}$ in CIP constraints. Our results
demonstrate the power of galaxy data to place tight constraints on CIP, and
motivate works to understand better the impact of data systematics, as well as
to determine theory priors for $b_\sigma$.
