Skip to content

Instantly share code, notes, and snippets.

@nuria
Created September 12, 2022 21:00
Show Gist options
  • Save nuria/5fba9f7517114bdff6961bb0838aa963 to your computer and use it in GitHub Desktop.
Save nuria/5fba9f7517114bdff6961bb0838aa963 to your computer and use it in GitHub Desktop.
Build alter table clause from meta data redshift
select 'alter table ' || table_schema || '.' || table_name || ' alter column experiment_assignments type varchar(65535);'
from svv_columns
where table_schema = 'some'
and column_name = 'some'
and character_maximum_length = 512;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment