Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: Correct ownership semantics of indexes #18877

Merged
merged 3 commits into from
Apr 21, 2023

Conversation

jkosh44
Copy link
Contributor

@jkosh44 jkosh44 commented Apr 20, 2023

This commit updates the semantics of index owners in the following ways:

  • The owner of an index is always set to the owner of the underlying relation.
  • Only the owner of a relation, or superuser, can create indexes on the relation.
  • Altering the owner of a relation also alters the owner of any indexes on that relation.

This behavior is consistent with PostgreSQL.

Works towards resolving #18551
Part of #11579

Motivation

This PR fixes a recognized bug.

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered.
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • This PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way) and therefore is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • This PR includes the following user-facing behavior changes:
    • This release fixes the owners of indexes so that they always match their underlying relations.

This commit updates the semantics of index owners in the following
ways:

  - The owner of an index is always set to the owner of the underlying
  relation.
  - Only the owner of a relation, or superuser, can create indexes on
  the relation.
  - Altering the owner of a relation also alters the owner of any
  indexes on that relation.

This behavior is consistent with PostgreSQL.

Works towards resolving MaterializeInc#18551
Part of MaterializeInc#11579
@jkosh44 jkosh44 requested a review from def- April 20, 2023 18:26
@jkosh44 jkosh44 marked this pull request as ready for review April 20, 2023 18:40
@jkosh44 jkosh44 requested a review from a team as a code owner April 20, 2023 18:40
…ex-owners

# Conflicts:
#	test/sqllogictest/object_ownership.slt
@jkosh44 jkosh44 enabled auto-merge (squash) April 20, 2023 22:39
@jkosh44 jkosh44 merged commit 2976a00 into MaterializeInc:main Apr 21, 2023
@jkosh44 jkosh44 deleted the index-owners branch April 21, 2023 00:53
joacoc pushed a commit to joacoc/materialize that referenced this pull request Apr 21, 2023
This commit updates the semantics of index owners in the following ways:

- The owner of an index is always set to the owner of the underlying
relation.
- Only the owner of a relation, or superuser, can create indexes on the
relation.
- Altering the owner of a relation also alters the owner of any indexes
on that relation.

This behavior is consistent with PostgreSQL.

Works towards resolving MaterializeInc#18551
Part of MaterializeInc#11579
@jkosh44 jkosh44 mentioned this pull request Apr 24, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants