Skip to content

Instantly share code, notes, and snippets.

@jackdouglas
Created March 23, 2012 17:00
Show Gist options
  • Save jackdouglas/2172779 to your computer and use it in GitHub Desktop.
Save jackdouglas/2172779 to your computer and use it in GitHub Desktop.
set role dba;
create role stack;
grant stack to dba;
create schema authorization stack;
set role stack;
--
create table film(film_id integer primary key, release_year integer not null);
create table film_actor(actor_id integer, film_id integer references film, primary key (actor_id, film_id));
insert into film(film_id, release_year) values(1,2004);
begin;
insert into film_actor(actor_id, film_id) values(1,1);
--in session 2: update film set release_year=2005 where film_id=1;
commit;
--
drop schema stack cascade;
set role dba;
drop role stack;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment