Skip to content

Instantly share code, notes, and snippets.

@sahapasci
Created April 18, 2019 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sahapasci/e766d2c2a0c2521ebb73e89ede971e84 to your computer and use it in GitHub Desktop.
Save sahapasci/e766d2c2a0c2521ebb73e89ede971e84 to your computer and use it in GitHub Desktop.
postgresql 9.6 alter column type which used in function
create table my_table (id integer primary key, data text);
create function my_func(id integer, data text)
returns void
language plpgsql
as
$$
begin
insert into my_table values (id, data);
end;
$$;
select my_func (10, 'asdf');
alter table my_table alter column id type bigint;
\d my_table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment