Can I transform a parameter's posterior to a different parametrization? I have a model with several parameters. I apply Bayesian inference with a uniform prior for all of the parameters. After the process is finished, I realize that I need one of those parameters $x$ parametrized as its logarithm:
$$y = log(x/a)$$
where $a$ is a constant. As far as I understand, a uniform prior in $x$ is a very much non-uniform prior in $y$.
Can I transform the posterior I got using a uniform prior in  $x$ into a posterior with a uniform prior in $y$?

Parameters are usually written in Greek letters, so I'll write $\eta = \log \frac{\theta}{c}$ instead. Denoting the likelihood by $L(\theta\mid X)$, the posterior distribution you sampled from is
$$
\pi(\theta\mid X) \propto L(\theta\mid X)\pi(\theta) \propto L(\theta\mid X),
$$
since $\pi(\theta) \propto 1$. If you apply $\eta(\theta) = \log \frac{\theta}{c}$ to the posterior sample $\{\theta^{(1)},\ldots,\theta^{(S)}\}$ directly, it is equivalent to sampling from the following posterior:
$$
\pi^*(\eta\mid X) \propto L(\eta\mid X) \mathcal{J}(\eta\to\theta),
$$
where $\mathcal{J}(\eta \to \theta)$ is the Jacobian $\left|\frac{d\theta}{d\eta} \right| = ce^{\eta}$.
My understanding is that you would like to transform the posterior sample $\{\theta^{(1)},\ldots, \theta^{(S)}\}$ so that it represents a sample from $\pi(\eta\mid X) \propto L(\eta\mid X)$, which lacks the Jacobian term in $\pi^*(\eta\mid X)$. In general, prior swapping is not easy, and you would do well to start over with the correct prior distribution.
However, if we give up equal weights for every posterior sample point, we can correct the weights so that the weighted sample represents the desired distribution, an idea often seen in importance-sampling literature. To that end, first transform $\eta^{(s)} = \log \frac{\theta^{(s)}}{c}$ for $s=1,\ldots,S$, and attach a weight to each sample point: $\{(\eta^{(1)},w^{(1)}),\ldots, (\eta^{(S)},w^{(S)})\}$. @Peter Pang's answer is correct in that the weights are the ratio of the correct posterior to the original: $w^{(s)} = \frac{L(\eta\mid X)}{L(\eta\mid X)\mathcal{J}(\eta\to\theta)} = \frac{1}{\mathcal{J}(\eta \to \theta)}=\frac{1}{c\exp(\eta^{(s)})} = \frac{1}{\theta^{(s)}}$. Subsequent analysis should be carefuly tuned following the rules of importance sampling. See Neiswanger et el. for more information.
