The specified number of distinct nonnull values. When set to a positive value, ANALYZE will assume that the column contains exactly The statistics gathered for the table plus its inheritanceĬhildren. Itself, while n_distinct_inherited affects n_distinct affects the statistics for the table Number-of-distinct-values estimates made by subsequent ANALYZE operations. Only defined per-attribute options are n_distinct and n_distinct_inherited, which override the This form sets or resets per-attribute options. 1 to revert to using the system default statistics targetįor more information on the use of statistics by the PostgreSQL query planner, refer to Section 14.2. Target can be set in the range 0 to 10000 alternatively, set it to This form sets the per-column statistics-gathering target for You can only use SET NOT NULL when the column contains no null These forms change whether a column is marked to allow null They do not cause rows already in the table to change. These forms set or remove the default value for a column.ĭefault values only apply in subsequent INSERT or UPDATE commands No implicit or assignment cast from old to new type. USING clause must be provided if there is Is the same as an assignment cast from old data type to new. New column value from the old if omitted, the default conversion USING clause specifies how to compute the The optional COLLATEĬlause specifies a collation for the new column if omitted, theĬollation is the default for the new column type. Simple table constraints involving the column will be automaticallyĬonverted to use the new column type by reparsing the originally This form changes the type of a column of a table. IF EXISTSĭo not throw an error if the table does not exist. Indexes and tableĬonstraints involving the column will be automatically dropped asĪnything outside the table depends on the column, for example,ĮXISTS is specified and the column does not exist, no error is This form adds a new column to the table, using the same syntaxĪs CREATE TABLE. SET SCHEMA new_schema where action is one of:ĪDD column_name data_type ]ĭROP column_name ĪLTER column_name TYPE data_type ĪLTER column_name SET DEFAULT expressionĪLTER column_name DROP DEFAULTĪLTER column_name USING INDEX index_name RENAME CONSTRAINT constraint_name TO new_constraint_name When set to a positive value, ANALYZE will assume that the column contains exactly the specified number of distinct nonnull values.Synopsis ALTER TABLE name ĪLTER TABLE name n_distinct affects the statistics for the table itself, while n_distinct_inherited affects the statistics gathered for the table plus its inheritance children. Currently, the only defined per-attribute options are n_distinct and n_distinct_inherited, which override the number-of-distinct-values estimates made by subsequent ANALYZE operations. SET STATISTICS acquires a SHARE UPDATE EXCLUSIVE lock. For more information on the use of statistics by the PostgreSQL query planner, refer to Section 14.2. ![]() ![]() The target can be set in the range 0 to 10000 alternatively, set it to -1 to revert to using the system default statistics target ( default_statistics_target). This form sets the per-column statistics-gathering target for subsequent ANALYZE operations. sequence_option is an option supported by ALTER SEQUENCE such as INCREMENT BY. These forms alter the sequence that underlies an existing identity column. If DROP IDENTITY IF EXISTS is specified and the column is not an identity column, no error is thrown. Like SET DEFAULT, these forms only affect the behavior of subsequent INSERT and UPDATE commands they do not cause rows already in the table to change. These forms change whether a column is an identity column or change the generation attribute of an existing identity column. RENAME CONSTRAINT constraint_name TO new_constraint_nameĪLTER TABLE ALL IN TABLESPACE name ]ĪTTACH PARTITION partition_name AS IDENTITY
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |