Created
July 31, 2014 22:29
-
-
Save thinkerbot/2e476e708a2c34cb03f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop schema if exists a cascade; | |
create schema a; | |
drop schema if exists b cascade; | |
create schema b; | |
create table b.things (id int); | |
insert into b.things (id) values (1); | |
insert into b.things (id) values (2); | |
insert into b.things (id) values (3); | |
set search_path=a; | |
create table things (id int); | |
create function sum_things() returns bigint as | |
$$ | |
select sum(id) from things; | |
$$ language sql; | |
select sum_things(); | |
set search_path=b,a; | |
select sum_things(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment