Got it. Many thanks.
On Mon, Jan 4, 2021 at 2:46 PM hubert depesz lubaczewski
wrote:
> On Mon, Jan 04, 2021 at 02:14:11PM +0100, Hassan Akefirad wrote:
> > I have foo table and would like to set bar column to a random string.
> I've got the following query:
> > update foo
> > set bar = array_to_
On Mon, Jan 04, 2021 at 02:14:11PM +0100, Hassan Akefirad wrote:
> I have foo table and would like to set bar column to a random string. I've
> got the following query:
> update foo
> set bar = array_to_string(
> array(select string_agg(substring('0123456789bcdfghjkmnpqrstvwxyz',
> round(random()
I have foo table and would like to set bar column to a random string. I've
got the following query:
update foo
set bar = array_to_string(
array(select string_agg(substring('0123456789bcdfghjkmnpqrstvwxyz',
round(random() * 30)::integer, 1), '')
from generate_series(1, 9)), '');
But it generates t