Skip to content

Instantly share code, notes, and snippets.

@PostgreSqlStan
Created May 6, 2023 00:32
Show Gist options
  • Save PostgreSqlStan/75c4d2ee526324262ed0b3d844221d2c to your computer and use it in GitHub Desktop.
Save PostgreSqlStan/75c4d2ee526324262ed0b3d844221d2c to your computer and use it in GitHub Desktop.
Why does the 2nd call show an OID instead of the name of the table?
drop schema if exists issue_repo cascade;
create schema issue_repo; set schema 'issue_repo';
create or replace procedure caller1 () as $proc$
begin call nameit('t'); end;
$proc$ language plpgsql;
create or replace procedure nameit (target regclass) as $proc$
begin raise notice '👻 target: %', target; end;
$proc$ language plpgsql;
create table t();
call caller1();
drop table t;
create table t();
call caller1();
@PostgreSqlStan
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment