Return values based on rows inserted, where target_list can be specific column names from the table, * for all columns, or computations using scalar expressions. To fill a specific column with its default value, leave the value out of the select_stmt or use DEFAULT at the appropriate position. To fill all columns with their default values, use DEFAULT VALUES in place of select_stmt. Also, if column names are listed after INTO, values must be in corresponding order otherwise, they must follow the declared order of the columns in the table. Each value must match the data type of its column. The name of a column to populate during the insert.Ī selection query. When an alias is provided, it completely hides the actual table name. WITH RECURSIVE common_table_expr, UPSERT INTO table_name AS table_alias_name ( column_name, ) select_stmt DEFAULT VALUES RETURNING target_list NOTHING Parameters ParameterĪn alias for the table name. The user must have the INSERT, SELECT, and UPDATE privileges on the table. If the input data contains duplicates, see Import data containing duplicate rows using DISTINCT ON. Whenever possible, use multi-row UPSERT instead of multiple single-row UPSERT statements.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |