-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Document support for ALTER TABLE SET PROPERTIES #11022
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,22 @@ The optional ``IF EXISTS`` (when used before the column name) clause causes the | |
|
|
||
| The optional ``IF NOT EXISTS`` clause causes the error to be suppressed if the column already exists. | ||
|
|
||
| .. _alter-table-set-properties: | ||
|
|
||
| SET PROPERTIES | ||
| ^^^^^^^^^^^^^^ | ||
|
|
||
| The ``ALTER TABLE SET PROPERTIES`` statement followed by some number | ||
| of ``property_name`` and ``expression`` pairs applies the specified properties | ||
| and values to a table. Ommitting an already-set property from this | ||
| statement leaves that property unchanged in the table. | ||
|
|
||
| A property in a ``SET PROPERTIES`` statement can be set to ``DEFAULT``, which | ||
| reverts its value back to the default in that table. | ||
|
|
||
| Support for ``ALTER TABLE SET PROPERTIES`` varies between | ||
| connectors, as not all connectors support modifying table properties. | ||
|
|
||
| .. _alter-table-execute: | ||
|
|
||
| EXECUTE | ||
|
|
@@ -87,9 +103,19 @@ Allow everyone with role public to drop and alter table ``people``:: | |
|
|
||
| ALTER TABLE people SET AUTHORIZATION ROLE PUBLIC | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The interaction between pure SQL role granting and access control role granting is ... unexplored.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understood, but ultimately out of scope for this PR. If someone has input then I can file a follow-up issue
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Ordinant Do you mean using things like file-based access control together with SQL based access control? If so such a configuration can never be possible since Trino only allows a single type of system access control to be available at a time. However connectors may provide their own - and the rule there is that system level configuration wins over connector specific ones. |
||
|
|
||
| Set table properties (``x=y``) to table ``users``:: | ||
| Set table properties (``x = y``) in table ``people``:: | ||
|
|
||
| ALTER TABLE people SET PROPERTIES x = 'y'; | ||
|
|
||
| Set multiple table properties (``foo = 123`` and ``foo bar = 456``) in | ||
| table ``people``:: | ||
|
|
||
| ALTER TABLE people SET PROPERTIES foo = 123, "foo bar" = 456; | ||
|
|
||
| Set table property ``x`` to its default value in table``people``:: | ||
|
|
||
| ALTER TABLE people SET PROPERTIES x = DEFAULT; | ||
|
|
||
| ALTER TABLE people SET PROPERTIES x = 'y' | ||
|
|
||
| Collapse files in a table that are over 10 megabytes in size, as supported by | ||
| the Hive connector:: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.