YMatrix
Quick Start
Simulate Time Series Scenarios
Standard Cluster Deployment
Data Modeling
Connecting to The database
Data Writing
Data Migration
Data Query
Scene Application Examples
Federal Query
Maintenance and Monitoring
Global Maintenance
Partition Maintenance
Backup and Restore
Cluster Expansion
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool Guide
Data Type
Storage Engine
Execution Engine
Stream Processing
DR (Disaster Recovery)
Configuration Parameters
Index
Extension
SQL Reference
FAQ
Change the value of the YMatrix database configuration parameters.
SET [SESSION | LOCAL] configuration_parameter {TO | =} value | 'value' | DEFAULT}
SET [SESSION | LOCAL] TIME ZONE {timezone | LOCAL | DEFAULT}
The SET command changes the server configuration parameters. Any configuration parameters classified as session parameters can be changed instantly using SET. SET only affects the values used by the current session.
If SET or SET SESSION is issued in a transaction that is aborted later, the effect of the SET command disappears when the transaction is rolled back. Once a transaction is committed, the effect will continue until the end of the session unless it is overwritten by another SET.
The impact of SET LOCAL only lasts until the end of the current transaction, whether committed or not. A special case is that SET LOCAL is followed by SET in a single transaction: The SET LOCAL value will be displayed until the end of the transaction, but then (if a transaction is committed) the SET value will take effect.
If SET LOCAL is used in a function that contains SET options for the same configuration parameter (see CREATE FUNCTION), the effect of the SET LOCAL command disappears when the function exits; anyway, the value that was valid when the function was called is restored. This allows SET LOCAL to be used for dynamic or repeated changes to parameters in a function, while preserving the convenience of saving and restoring caller values using SET options. Note that regular SET commands override SET options for surrounding functions. Unless it rolls back, its impact persists.
If you use the DECLARE command to create a cursor in a transaction, you can only use the SET command in a transaction after closing the cursor with the CLOSE command.
SESSION
LOCAL
configuration_parameter
value
TIME ZONE
LOCAL
DEFAULT
Set the schema search path:
SET search_path TO my_schema, public;
Increase the segment host memory for each query to 200 MB:
SET statement_mem TO '200MB';
Set date style to the input habit of "Day before the month" of traditional POSTGRES:
SET datestyle TO postgres, dmy;
Set the time zone (Pacific time) of San Mateo, California:
SET TIME ZONE 'PST8PDT';
Set the time zone of Italy:
SET TIME ZONE 'Europe/Rome';
Sets the system default SEGMENT_SET object.
SET mx_default_segment_set TO 'ss1';
SET TIME ZONE extends the syntax defined in the SQL standard. This standard allows only digital time zone offsets, while the YMatrix database allows for more flexible time zone specifications. All other features of SET are YMatrix database extensions.