Skip to content

Remove Trailing White Spaces

Ryan TG edited this page Jun 5, 2023 · 12 revisions

Keeping this up for now, but this is hopefully not relevant anymore after https://github.com/pinballmap/pbm/commit/fa1e19fc77316d74aebdb1c6acd2fdeed320b797

update locations set name=trim(name) where name ~ '\s+$';
update locations set street=trim(street) where street ~ '\s+$';
update locations set city=trim(city) where city ~ '\s+$';
update locations set zip=trim(zip) where zip ~ '\s+$';
update locations set state=trim(state) where state ~ '\s+$';
update locations set website=trim(website) where website ~ '\s+$';
update locations set phone=trim(phone) where phone ~ '\s+$';

Previous Issue: https://github.com/scottwainstock/pbm/issues/654

also look for double white space select name from locations where name like '% %';

Remove trailing newline from machine_conditions (not actually needed anymore):

update machine_conditions set comment=regexp_replace(comment, E'[\\n\\r]+$', '', 'g') where comment ~ E'[\\n\\r]+$';