Skip to content

Instantly share code, notes, and snippets.

@monadplus
Created February 3, 2020 11:54
Show Gist options
  • Save monadplus/d6e4a76fbde1571498bed31af562dac7 to your computer and use it in GitHub Desktop.
Save monadplus/d6e4a76fbde1571498bed31af562dac7 to your computer and use it in GitHub Desktop.
PostgreSQL: functions don't hold static references to the objects.
create table a (isOk BOOLEAN not null);
CREATE or replace FUNCTION get_isOk ( )
returns BOOLEAN as $$
select isOk from faa;
$$ LANGUAGE SQL;
drop table a;
-- select get_isOk(); -- now fails
create table a (isOk BOOLEAN not null);
select get_isOk(); -- works!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment