From adb0b6ae1e511d8f65b54daeb4eff12def18dfaa Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Fri, 10 Jun 2011 13:41:51 +0000 Subject: [PATCH] bigint update script --- sql/update_bigint.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/update_bigint.sql diff --git a/sql/update_bigint.sql b/sql/update_bigint.sql new file mode 100644 index 00000000..9cc0fffb --- /dev/null +++ b/sql/update_bigint.sql @@ -0,0 +1,9 @@ +\a +\t +\o /tmp/bigintupdate.sql +select 'alter table "'||relname||'" alter '||attname||' type bigint;' from pg_attribute join pg_class on +(attrelid = oid) where attname like '%place_id%' and attnum > 0 and relkind = 'r'::"char" and atttypid = 23 +and not relname::text ~ '^.*_[0-9]+$' order by 'alter table "'||relname||'" alter '||attname||' type +bigint;'; +\o +\i /tmp/bigintupdate.sql -- 2.39.5