3 \o /tmp/bigintupdate.sql
4 select 'alter table "'||relname||'" alter '||attname||' type bigint;' from pg_attribute join pg_class on
5 (attrelid = oid) where attname like '%place_id%' and attnum > 0 and relkind = 'r'::"char" and atttypid = 23
6 and not relname::text ~ '^.*_[0-9]+$' order by 'alter table "'||relname||'" alter '||attname||' type
9 \i /tmp/bigintupdate.sql