12/27/2023 0 Comments Stimulsoft truncate rows![]() ![]() This implies that if a specified table has any descendant tables that are foreign, the command will fail. TRUNCATE is not currently supported for foreign tables. This is similar to the usual behavior of currval() after a failed transaction. ![]() Be aware that if any additional sequence operations are done on the restarted sequences before the transaction rolls back, the effects of these operations on the sequences will be rolled back, but not their effects on currval() that is, after the transaction currval() will continue to reflect the last sequence value obtained inside the failed transaction, even though the sequence itself may no longer be consistent with that. When RESTART IDENTITY is specified, the implied ALTER SEQUENCE RESTART operations are also done transactionally that is, they will be rolled back if the surrounding transaction does not commit. By default the value of this property is set to 0 which means that there is no minimum number of data rows. TRUNCATE is transaction-safe with respect to the data in the tables: the truncation will be safely rolled back if the surrounding transaction does not commit. The MinRowsInColumn property of the Data band can be used to define the minimum permitted number of rows in the first column. After truncation, the table will appear empty to concurrent transactions, if they are using a snapshot taken before the truncation occurred. The triggers will fire in the order that the tables are to be processed (first those listed in the command, and then any that were added due to cascading). ![]() If ON TRUNCATE triggers are defined for any of the tables, then all BEFORE TRUNCATE triggers are fired before any truncation happens, and all AFTER TRUNCATE triggers are fired after the last truncation is performed and any sequences are reset. TRUNCATE will not fire any ON DELETE triggers that might exist for the tables. The CASCADE option can be used to automatically include all dependent tables - but be very careful when using this option, or else you might lose data you did not intend to! Checking validity in such cases would require table scans, and the whole point is not to do one. TRUNCATE cannot be used on a table that has foreign-key references from other tables, unless all such tables are also truncated in the same command. If concurrent access to a table is required, then the DELETE command should be used instead. When RESTART IDENTITY is specified, any sequences that are to be restarted are likewise locked exclusively. TRUNCATE acquires an ACCESS EXCLUSIVE lock on each table it operates on, which blocks all other concurrent operations on the table. You must have the TRUNCATE privilege on a table to truncate it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |