search_path not recomputed when role name changes

Поиск
Список
Период
Сортировка
Искать
От
Jeff Davis
Тема
search_path not recomputed when role name changes
Дата
Msg-id
186761d32c0255debbdf50b6310b581b9c973e6c.camel@j-davis.com
Список
Дерево обсуждения
search_path not recomputed when role name changes Jeff Davis <pgsql@j-davis.com>
Re: search_path not recomputed when role name changes Nathan Bossart <nathandbossart@gmail.com>
Re: search_path not recomputed when role name changes Michael Paquier <michael@paquier.xyz>
Re: search_path not recomputed when role name changes Jeff Davis <pgsql@j-davis.com>
Re: search_path not recomputed when role name changes Nathan Bossart <nathandbossart@gmail.com>
Re: search_path not recomputed when role name changes Michael Paquier <michael@paquier.xyz>

Session 1 as superuser:
  CREATE USER u1;
  CREATE SCHEMA u1 AUTHORIZATION u1;
  GRANT ALL PRIVILEGES ON SCHEMA public TO u1;

Session 2 as u1:
  SET search_path= "$user", public;
  CREATE TABLE u1.x(t) AS SELECT 'data in u1.x';  
  CREATE TABLE public.x(t) AS SELECT 'data in public.x';
  SELECT t FROM x; -- uses u1.x

Session 1 as superuser:
  ALTER ROLE u1 RENAME TO u2;

Session 2 as u1:
  SELECT CURRENT_USER; -- shows u2
  SHOW search_path; -- $user, public
  SELECT t FROM x; -- UNEXPECTED: uses u1.x still
  SET search_path = public;
  SET search_path TO default;
  SELECT t FROM x; -- uses public.x

The fix is simple, attached.


-- 
Jeff Davis
PostgreSQL Contributor Team - AWS


В списке pgsql-bugs по дате отправления
От: Tom Lane
Дата:
От: David Rowley
Дата:
FAQ