![]() ![]() ![]() Issuing this outside of a transaction block emits a warning and otherwise has no effect. After COMMIT or ROLLBACK, the session-level setting takes effect again. Specifies that the command takes effect for only the current transaction. (This is the default if neither SESSION nor LOCAL appears.) LOCAL Specifies that the command takes effect for the current session. However, a regular SET command overrides any surrounding function's SET option its effects will persist unless rolled back. This allows SET LOCAL to be used for dynamic or repeated changes of a parameter within a function, while still having the convenience of using the SET option to save and restore the caller's value. If SET LOCAL is used within a function that has a SET option for the same variable (see CREATE FUNCTION), the effects of the SET LOCAL command disappear at function exit that is, the value in effect when the function was called is restored anyway. The effects of SET or SET LOCAL are also canceled by rolling back to a savepoint that is earlier than the command. A special case is SET followed by SET LOCAL within a single transaction: the SET LOCAL value will be seen until the end of the transaction, but afterwards (if the transaction is committed) the SET value will take effect. The effects of SET LOCAL last only till the end of the current transaction, whether committed or not. Once the surrounding transaction is committed, the effects will persist until the end of the session, unless overridden by another SET. If SET (or equivalently SET SESSION) is issued within a transaction that is later aborted, the effects of the SET command disappear when the transaction is rolled back. There are also parameters that cannot be changed after server or session start.) SET only affects the value used by the current session. (Some parameters can only be changed by superusers and users who have been granted SET privilege on that parameter. Many of the run-time parameters listed in Chapter 20 can be changed on-the-fly with SET. The SET command changes run-time configuration parameters.
0 Comments
Leave a Reply. |