pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Recalculate search_path after ALTER ROLE.
10+ messages / 3 participants
[nested] [flat]

* pgsql: Recalculate search_path after ALTER ROLE.
@ 2023-08-09 20:31  Jeff Davis <jdavis@postgresql.org>
  0 siblings, 1 reply; 10+ messages in thread

From: Jeff Davis @ 2023-08-09 20:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Recalculate search_path after ALTER ROLE.

Renaming a role can affect the meaning of the special string $user, so
must cause search_path to be recalculated.

Discussion: https://postgr.es/m/186761d32c0255debbdf50b6310b581b9c973e6c.camel@j-davis.com
Reviewed-by: Nathan Bossart, Michael Paquier
Backpatch-through: 11

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fa2e874946c5b9f23394358c131e987df7cc8ffb

Modified Files
--------------
src/backend/catalog/namespace.c                   |  6 +-
src/test/isolation/expected/search-path-inval.out | 97 +++++++++++++++++++++++
src/test/isolation/isolation_schedule             |  1 +
src/test/isolation/specs/search-path-inval.spec   | 59 ++++++++++++++
4 files changed, 162 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* pgsql: Recalculate search_path after ALTER ROLE.
@ 2023-08-09 20:31  Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 10+ messages in thread

From: Jeff Davis @ 2023-08-09 20:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Recalculate search_path after ALTER ROLE.

Renaming a role can affect the meaning of the special string $user, so
must cause search_path to be recalculated.

Discussion: https://postgr.es/m/186761d32c0255debbdf50b6310b581b9c973e6c.camel@j-davis.com
Reviewed-by: Nathan Bossart, Michael Paquier
Backpatch-through: 11

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0d56c32c8e724f96f4aa5b15645d427f6e2ddf21

Modified Files
--------------
src/backend/catalog/namespace.c                   |  6 +-
src/test/isolation/expected/search-path-inval.out | 97 +++++++++++++++++++++++
src/test/isolation/isolation_schedule             |  1 +
src/test/isolation/specs/search-path-inval.spec   | 59 ++++++++++++++
4 files changed, 162 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* pgsql: Recalculate search_path after ALTER ROLE.
@ 2023-08-09 20:31  Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 10+ messages in thread

From: Jeff Davis @ 2023-08-09 20:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Recalculate search_path after ALTER ROLE.

Renaming a role can affect the meaning of the special string $user, so
must cause search_path to be recalculated.

Discussion: https://postgr.es/m/186761d32c0255debbdf50b6310b581b9c973e6c.camel@j-davis.com
Reviewed-by: Nathan Bossart, Michael Paquier
Backpatch-through: 11

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9f3343e40df6fc92a3913eeb8e240e0f5c6a5cfc

Modified Files
--------------
src/backend/catalog/namespace.c                   |  6 +-
src/test/isolation/expected/search-path-inval.out | 97 +++++++++++++++++++++++
src/test/isolation/isolation_schedule             |  1 +
src/test/isolation/specs/search-path-inval.spec   | 59 ++++++++++++++
4 files changed, 162 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* pgsql: Recalculate search_path after ALTER ROLE.
@ 2023-08-09 20:31  Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 10+ messages in thread

From: Jeff Davis @ 2023-08-09 20:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Recalculate search_path after ALTER ROLE.

Renaming a role can affect the meaning of the special string $user, so
must cause search_path to be recalculated.

Discussion: https://postgr.es/m/186761d32c0255debbdf50b6310b581b9c973e6c.camel@j-davis.com
Reviewed-by: Nathan Bossart, Michael Paquier
Backpatch-through: 11

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/00953f1e232912a21bb17b3ad486e6ef8c5eadab

Modified Files
--------------
src/backend/catalog/namespace.c                   |  6 +-
src/test/isolation/expected/search-path-inval.out | 97 +++++++++++++++++++++++
src/test/isolation/isolation_schedule             |  1 +
src/test/isolation/specs/search-path-inval.spec   | 59 ++++++++++++++
4 files changed, 162 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* pgsql: Recalculate search_path after ALTER ROLE.
@ 2023-08-09 20:31  Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 10+ messages in thread

From: Jeff Davis @ 2023-08-09 20:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Recalculate search_path after ALTER ROLE.

Renaming a role can affect the meaning of the special string $user, so
must cause search_path to be recalculated.

Discussion: https://postgr.es/m/186761d32c0255debbdf50b6310b581b9c973e6c.camel@j-davis.com
Reviewed-by: Nathan Bossart, Michael Paquier
Backpatch-through: 11

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/90cadfd4995b3848223ea881cdadcf83d29ff679

Modified Files
--------------
src/backend/catalog/namespace.c                   |  6 +-
src/test/isolation/expected/search-path-inval.out | 97 +++++++++++++++++++++++
src/test/isolation/isolation_schedule             |  1 +
src/test/isolation/specs/search-path-inval.spec   | 59 ++++++++++++++
4 files changed, 162 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* pgsql: Recalculate search_path after ALTER ROLE.
@ 2023-08-09 20:32  Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 10+ messages in thread

From: Jeff Davis @ 2023-08-09 20:32 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Recalculate search_path after ALTER ROLE.

Renaming a role can affect the meaning of the special string $user, so
must cause search_path to be recalculated.

Discussion: https://postgr.es/m/186761d32c0255debbdf50b6310b581b9c973e6c.camel@j-davis.com
Reviewed-by: Nathan Bossart, Michael Paquier
Backpatch-through: 11

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a86d4022788943b6bd3141b64d2a3e1129570087

Modified Files
--------------
src/backend/catalog/namespace.c                   |  6 +-
src/test/isolation/expected/search-path-inval.out | 97 +++++++++++++++++++++++
src/test/isolation/isolation_schedule             |  1 +
src/test/isolation/specs/search-path-inval.spec   | 59 ++++++++++++++
4 files changed, 162 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* pgsql: Recalculate search_path after ALTER ROLE.
@ 2023-08-09 20:32  Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 10+ messages in thread

From: Jeff Davis @ 2023-08-09 20:32 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Recalculate search_path after ALTER ROLE.

Renaming a role can affect the meaning of the special string $user, so
must cause search_path to be recalculated.

Discussion: https://postgr.es/m/186761d32c0255debbdf50b6310b581b9c973e6c.camel@j-davis.com
Reviewed-by: Nathan Bossart, Michael Paquier
Backpatch-through: 11

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/43ba5105a8e0c28e893bd698f76211b5ea757145

Modified Files
--------------
src/backend/catalog/namespace.c                   |  6 +-
src/test/isolation/expected/search-path-inval.out | 97 +++++++++++++++++++++++
src/test/isolation/isolation_schedule             |  1 +
src/test/isolation/specs/search-path-inval.spec   | 59 ++++++++++++++
4 files changed, 162 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pgsql: Recalculate search_path after ALTER ROLE.
@ 2023-08-09 23:12  Jeff Davis <pgsql@j-davis.com>
  parent: Jeff Davis <jdavis@postgresql.org>
  0 siblings, 1 reply; 10+ messages in thread

From: Jeff Davis @ 2023-08-09 23:12 UTC (permalink / raw)
  To: Jeff Davis <jdavis@postgresql.org>; pgsql-committers@lists.postgresql.org

On Wed, 2023-08-09 at 20:31 +0000, Jeff Davis wrote:
> Recalculate search_path after ALTER ROLE.

Looks like this is causing some buildfarm failures for
debug_parallel_query members related to the combination of parallel
query, search_path, and renaming a role.

I'm not sure yet, but this looks like a possible pre-existing bug, or
some incorrect assumption I made in fa2e874946.

Investigating...

Regards,
	Jeff Davis






^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pgsql: Recalculate search_path after ALTER ROLE.
@ 2023-08-10 06:08  Jeff Davis <pgsql@j-davis.com>
  parent: Jeff Davis <pgsql@j-davis.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Jeff Davis @ 2023-08-10 06:08 UTC (permalink / raw)
  To: Jeff Davis <jdavis@postgresql.org>; pgsql-committers@lists.postgresql.org

On Wed, 2023-08-09 at 16:12 -0700, Jeff Davis wrote:
> I'm not sure yet, but this looks like a possible pre-existing bug, or
> some incorrect assumption I made in fa2e874946.

Before my commit the behavior is the same. Here's a minimal repro
(debug_parallel_query set to 'on' or 'regress'):

  s1:
    CREATE USER u1;
    SET SESSION AUTHORIZATION u1;

  s2:
    ALTER ROLE u1 RENAME TO u2;

  s1:
    SELECT 1;
    ERROR:  role "u1" does not exist
    CONTEXT:  while setting parameter "session_authorization" to "u1"

Given that it works fine without parallel query, I'm inclined to call
this a parallel query bug. The error is coming from RestoreGUCState().

That being said, the buildfarm is red after my commit, so unless
someone sees a quick fix here, perhaps I should remove my isolation
test? I don't want to revert my whole commit, because it seems correct
and fixes a separate bug.

Regards,
	Jeff Davis






^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pgsql: Recalculate search_path after ALTER ROLE.
@ 2023-08-10 11:03  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Jeff Davis <pgsql@j-davis.com>
  0 siblings, 0 replies; 10+ messages in thread

From: Tom Lane @ 2023-08-10 11:03 UTC (permalink / raw)
  To: Jeff Davis <pgsql@j-davis.com>; +Cc: Jeff Davis <jdavis@postgresql.org>; pgsql-committers@lists.postgresql.org

Jeff Davis <pgsql@j-davis.com> writes:
> On Wed, 2023-08-09 at 16:12 -0700, Jeff Davis wrote:
>> I'm not sure yet, but this looks like a possible pre-existing bug, or
>> some incorrect assumption I made in fa2e874946.

> Before my commit the behavior is the same. Here's a minimal repro
> ...
> Given that it works fine without parallel query, I'm inclined to call
> this a parallel query bug. The error is coming from RestoreGUCState().

Check.  Seems like we need a way to restore the role GUC without
performing a catalog lookup.  I'll bet there are comparable bugs
with search path, temp tablespace names, etc.

> That being said, the buildfarm is red after my commit, so unless
> someone sees a quick fix here, perhaps I should remove my isolation
> test? I don't want to revert my whole commit, because it seems correct
> and fixes a separate bug.

Yes, just remove the test case for now.  It might or might not be
worth the trouble to put it back later.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2023-08-10 11:03 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-08-09 20:31 pgsql: Recalculate search_path after ALTER ROLE. Jeff Davis <jdavis@postgresql.org>
2023-08-09 23:12 ` Jeff Davis <pgsql@j-davis.com>
2023-08-10 06:08   ` Jeff Davis <pgsql@j-davis.com>
2023-08-10 11:03     ` Tom Lane <tgl@sss.pgh.pa.us>
2023-08-09 20:31 pgsql: Recalculate search_path after ALTER ROLE. Jeff Davis <jdavis@postgresql.org>
2023-08-09 20:31 pgsql: Recalculate search_path after ALTER ROLE. Jeff Davis <jdavis@postgresql.org>
2023-08-09 20:31 pgsql: Recalculate search_path after ALTER ROLE. Jeff Davis <jdavis@postgresql.org>
2023-08-09 20:31 pgsql: Recalculate search_path after ALTER ROLE. Jeff Davis <jdavis@postgresql.org>
2023-08-09 20:32 pgsql: Recalculate search_path after ALTER ROLE. Jeff Davis <jdavis@postgresql.org>
2023-08-09 20:32 pgsql: Recalculate search_path after ALTER ROLE. Jeff Davis <jdavis@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox