agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE
6+ messages / 1 participants
[nested] [flat]

* pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE
@ 2026-08-10 13:41  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-08-10 13:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Preserve the owner of extended statistics rebuilt by ALTER TABLE.

When ALTER TABLE ... ALTER COLUMN TYPE (or any subcommand that rebuilds
them) drops and re-creates the extended statistics objects depending on
the altered column, the re-created objects were owned by the role running
ALTER TABLE rather than by the original owner of the statistics.

Remember each object's owner before dropping it, and restore it on
re-creation.

CreateStatistics()'s signature changes and CreateStatsStmt gains a field,
but no known third-party code calls the former or constructs the latter.

Author: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Backpatch-through: 14
Security: CVE-2026-6469

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6713a6e04cbb24ec3f3c1dda10e703f138109e71
Author: Masahiko Sawada <msawada@postgresql.org>

Modified Files
--------------
src/backend/commands/statscmds.c        | 48 ++++++++++++++----------------
src/backend/commands/tablecmds.c        | 52 ++++++++++++++++++++++++---------
src/backend/tcop/utility.c              | 19 ++++++++++--
src/include/commands/defrem.h           |  2 +-
src/include/nodes/parsenodes.h          |  1 +
src/test/regress/expected/stats_ext.out | 29 ++++++++++++++++++
src/test/regress/sql/stats_ext.sql      | 20 +++++++++++++
7 files changed, 129 insertions(+), 42 deletions(-)



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

* pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE
@ 2026-08-10 13:41  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-08-10 13:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Preserve the owner of extended statistics rebuilt by ALTER TABLE.

When ALTER TABLE ... ALTER COLUMN TYPE (or any subcommand that rebuilds
them) drops and re-creates the extended statistics objects depending on
the altered column, the re-created objects were owned by the role running
ALTER TABLE rather than by the original owner of the statistics.

Remember each object's owner before dropping it, and restore it on
re-creation.

CreateStatistics()'s signature changes and CreateStatsStmt gains a field,
but no known third-party code calls the former or constructs the latter.

Author: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Backpatch-through: 14
Security: CVE-2026-6469

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/93b93f28fb1a3aef83a2fa979f54cc1b4eae5fcc
Author: Masahiko Sawada <msawada@postgresql.org>

Modified Files
--------------
src/backend/commands/statscmds.c        | 48 ++++++++++++++----------------
src/backend/commands/tablecmds.c        | 52 ++++++++++++++++++++++++---------
src/backend/tcop/utility.c              | 19 ++++++++++--
src/include/commands/defrem.h           |  2 +-
src/include/nodes/parsenodes.h          |  1 +
src/test/regress/expected/stats_ext.out | 29 ++++++++++++++++++
src/test/regress/sql/stats_ext.sql      | 20 +++++++++++++
7 files changed, 129 insertions(+), 42 deletions(-)



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

* pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE
@ 2026-08-10 13:41  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-08-10 13:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Preserve the owner of extended statistics rebuilt by ALTER TABLE.

When ALTER TABLE ... ALTER COLUMN TYPE (or any subcommand that rebuilds
them) drops and re-creates the extended statistics objects depending on
the altered column, the re-created objects were owned by the role running
ALTER TABLE rather than by the original owner of the statistics.

Remember each object's owner before dropping it, and restore it on
re-creation.

CreateStatistics()'s signature changes and CreateStatsStmt gains a field,
but no known third-party code calls the former or constructs the latter.

Author: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Backpatch-through: 14
Security: CVE-2026-6469

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a1fa24127d6a24611e5ec8e5b00584b333a3a06c
Author: Masahiko Sawada <msawada@postgresql.org>

Modified Files
--------------
src/backend/commands/statscmds.c        | 48 ++++++++++++++----------------
src/backend/commands/tablecmds.c        | 52 ++++++++++++++++++++++++---------
src/backend/tcop/utility.c              | 19 ++++++++++--
src/include/commands/defrem.h           |  2 +-
src/include/nodes/parsenodes.h          |  1 +
src/test/regress/expected/stats_ext.out | 29 ++++++++++++++++++
src/test/regress/sql/stats_ext.sql      | 20 +++++++++++++
7 files changed, 129 insertions(+), 42 deletions(-)



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

* pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE
@ 2026-08-10 13:41  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-08-10 13:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Preserve the owner of extended statistics rebuilt by ALTER TABLE.

When ALTER TABLE ... ALTER COLUMN TYPE (or any subcommand that rebuilds
them) drops and re-creates the extended statistics objects depending on
the altered column, the re-created objects were owned by the role running
ALTER TABLE rather than by the original owner of the statistics.

Remember each object's owner before dropping it, and restore it on
re-creation.

CreateStatistics()'s signature changes and CreateStatsStmt gains a field,
but no known third-party code calls the former or constructs the latter.

Author: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Backpatch-through: 14
Security: CVE-2026-6469

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/75a03c569c761fa27ba15975f342b72ab0d28946
Author: Masahiko Sawada <msawada@postgresql.org>

Modified Files
--------------
src/backend/commands/statscmds.c        | 48 ++++++++++++++----------------
src/backend/commands/tablecmds.c        | 52 ++++++++++++++++++++++++---------
src/backend/tcop/utility.c              | 19 ++++++++++--
src/include/commands/defrem.h           |  2 +-
src/include/nodes/parsenodes.h          |  1 +
src/test/regress/expected/stats_ext.out | 29 ++++++++++++++++++
src/test/regress/sql/stats_ext.sql      | 20 +++++++++++++
7 files changed, 129 insertions(+), 42 deletions(-)



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

* pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE
@ 2026-08-10 13:41  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-08-10 13:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Preserve the owner of extended statistics rebuilt by ALTER TABLE.

When ALTER TABLE ... ALTER COLUMN TYPE (or any subcommand that rebuilds
them) drops and re-creates the extended statistics objects depending on
the altered column, the re-created objects were owned by the role running
ALTER TABLE rather than by the original owner of the statistics.

Remember each object's owner before dropping it, and restore it on
re-creation.

CreateStatistics()'s signature changes and CreateStatsStmt gains a field,
but no known third-party code calls the former or constructs the latter.

Author: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Backpatch-through: 14
Security: CVE-2026-6469

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7c3367ab5dc42c34788cf9a4c768d46d4acf1041
Author: Masahiko Sawada <msawada@postgresql.org>

Modified Files
--------------
src/backend/commands/statscmds.c        | 48 ++++++++++++++----------------
src/backend/commands/tablecmds.c        | 52 ++++++++++++++++++++++++---------
src/backend/tcop/utility.c              | 19 ++++++++++--
src/include/commands/defrem.h           |  2 +-
src/include/nodes/parsenodes.h          |  1 +
src/test/regress/expected/stats_ext.out | 29 ++++++++++++++++++
src/test/regress/sql/stats_ext.sql      | 20 +++++++++++++
7 files changed, 129 insertions(+), 42 deletions(-)



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

* pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE
@ 2026-08-10 13:41  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-08-10 13:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Preserve the owner of extended statistics rebuilt by ALTER TABLE.

When ALTER TABLE ... ALTER COLUMN TYPE (or any subcommand that rebuilds
them) drops and re-creates the extended statistics objects depending on
the altered column, the re-created objects were owned by the role running
ALTER TABLE rather than by the original owner of the statistics.

Remember each object's owner before dropping it, and restore it on
re-creation.

CreateStatistics()'s signature changes and CreateStatsStmt gains a field,
but no known third-party code calls the former or constructs the latter.

Author: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Backpatch-through: 14
Security: CVE-2026-6469

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fb6d1ca8d746dc1ca0e32890a50d7b93d2fbebae
Author: Masahiko Sawada <msawada@postgresql.org>

Modified Files
--------------
src/backend/commands/statscmds.c        | 48 ++++++++++++++----------------
src/backend/commands/tablecmds.c        | 52 ++++++++++++++++++++++++---------
src/backend/tcop/utility.c              | 19 ++++++++++--
src/include/commands/defrem.h           |  2 +-
src/include/nodes/parsenodes.h          |  1 +
src/test/regress/expected/stats_ext.out | 29 ++++++++++++++++++
src/test/regress/sql/stats_ext.sql      | 20 +++++++++++++
7 files changed, 129 insertions(+), 42 deletions(-)



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


end of thread, other threads:[~2026-08-10 13:41 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 13:41 pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE Noah Misch <noah@leadboat.com>
2026-08-10 13:41 pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE Noah Misch <noah@leadboat.com>
2026-08-10 13:41 pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE Noah Misch <noah@leadboat.com>
2026-08-10 13:41 pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE Noah Misch <noah@leadboat.com>
2026-08-10 13:41 pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE Noah Misch <noah@leadboat.com>
2026-08-10 13:41 pgsql: Preserve the owner of extended statistics rebuilt by ALTER TABLE Noah Misch <noah@leadboat.com>

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