Skip to content

Instantly share code, notes, and snippets.

@dmshvetsov
Last active February 24, 2020 03:22
Show Gist options
  • Select an option

  • Save dmshvetsov/67f809c212351c51fc10468e9a5abdf3 to your computer and use it in GitHub Desktop.

Select an option

Save dmshvetsov/67f809c212351c51fc10468e9a5abdf3 to your computer and use it in GitHub Desktop.
Create a million record with random strings, 10% of them will have hanging whitespace, 10% will have trailing whitespace
insert into
trailing_spaces (value)
select
case
when mod(indx, 9) = 0 then 'A' || (random() * 100)::text || ' '
when mod(indx, 10) = 0 then ' B' || (random() * 100)::text
else 'C' || (random() * 100)::text
end
from
generate_series(1, 1000000) as d (indx)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment