![]() This form sets or resets per-attribute options. 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. You can only use SET NOT NULL when the column contains no null values. These forms change whether a column is marked to allow null values or to reject null values. Default values only apply in subsequent INSERT or UPDATE commands they do not cause rows already in the table to change. These forms set or remove the default value for a column. A USING clause must be provided if there is no implicit or assignment cast from old to new type. The optional USING clause specifies how to compute the new column value from the old if omitted, the default conversion is the same as an assignment cast from old data type to new. The optional COLLATE clause specifies a collation for the new column if omitted, the collation is the default for the new column type. Indexes and simple table constraints involving the column will be automatically converted to use the new column type by reparsing the originally supplied expression. This form changes the type of a column of a table. If IF EXISTS is specified and the column does not exist, no error is thrown. ![]() You will need to say CASCADE if anything outside the table depends on the column, for example, foreign key references or views. Indexes and table constraints involving the column will be automatically dropped as well. If IF NOT EXISTS is specified and a column already exists with this name, no error is thrown. This form adds a new column to the table, using the same syntax as CREATE TABLE. RENAME CONSTRAINT constraint_name TO new_constraint_nameĪLTER TABLE ALL IN TABLESPACE name ]Ī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 There is no ALTER EXTERNAL TABLE statement in the SQL standard or regular PostgreSQL.ALTER TABLE name This is the default behavior.Īdd a new column to an external table definition: ALTER EXTERNAL TABLE ext_expenses ADD COLUMN manager text Ĭhange the owner of an external table: ALTER EXTERNAL TABLE ext_data OWNER TO jojo Ĭhange the data type of an external table: ALTER EXTERNAL TABLE ext_leads ALTER COLUMN acct_code TYPE integer ĪLTER EXTERNAL TABLE is a Greenplum Database extension. Refuse to drop the column or constraint if there are any dependent objects. The role name of the new owner of the external table.Īutomatically drop objects that depend on the dropped column, such as a view that references the column. The name (possibly schema-qualified) of an existing external table definition to alter.ĭata type of the new column, or new data type for an existing column. To modify this information, you must drop and recreate the external table definition. The ALTER EXTERNAL TABLE and ALTER TABLE commands cannot modify the type of the external table (read, write, web), the table FORMAT information, or the location of the external data. A superuser has these privileges automatically.Ĭhanges that you make to an external table definition with either ALTER EXTERNAL TABLE or ALTER TABLE do not affect the external data. To alter the owner, you must also be a direct or indirect member of the new owning role, and that role must have CREATE privilege on the external table’s schema. To change the schema of an external table, you must also have CREATE privilege on the new schema. You must own the external table to use ALTER EXTERNAL TABLE or ALTER TABLE.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |