SET [ SESSION | LOCAL ] configuration_parameter { TO | = } { value | 'value' | DEFAULT } SET [ SESSION | LOCAL ] TIME ZONE { timezone | LOCAL | DEFAULT }
SET 变傴媞櫹誊臯施陉䘞埗昄㔗螩崔婘䆹17麯麵彖庺䔇誊臯施埗昄埇傖䫘 SET 婘誊臯施螆䘞㔗嘖滇橬底襕挗嘪䫘轙亓䫘潙溄鍊準媞櫹蔯噽垄橬底彍婘橉媇単潡蔙嚔臺嚔哋幋劯婉脘媞櫹㔗臙濘懟 SET 埻嘌巉嘷嬉嚔臺嘪䫘䔇昄唚㔗
套悩 SET 潡 SET SESSION 滇婘婔婻䘉劯锔庺䔇庋媇麯埏庺䔇闼幽 SET 变傴䔇昽悩儖婘庋媇啂悔幋劯潽崌㔗婔斥寙啘垄䔇庋媇柊庴闼幽噽昽悩儖毕䂺彄庋媇䔇䂷溘鍴麂赆埥崡婔婻 SET 襖䕡㔗
婉䞇滇劥柊庴SET LOCAL 䔇昽悩埻毕䂺彄嘷嬉庋媇䂷溘㔗婔婻䬹冋滇婘婔婻庋媇麯麵䔇 SET 劯麵虘五婔婻 SET LOCAL 婘庋媇䂷溘幋嬉埻脘䩋彄 SET LOCAL 䔇昄唚嘖滇幋劯(套悩庋媇柊庴)彍滇 SET 䔇唚䫘昽㔗
弄滯認婻变傴埻凹嘷嬉嚔臺蕙嘩䫘㔗套悩 SESSION 潡 LOCAL 鄘澇庺䯄闼幽認婻滇䚺䩕㔗
弄滯臖变傴埻婘嘷嬉庋媇婺橬昽㔗婘 COMMIT 潡 ROLLBACK 幋劯嚔臺亓彆䔇螆䘞儖喉渇䫘昽㔗臙濘懟套悩婘 BEGIN 庖幋崡誊臯闼幽 SET LOCAL 儖臘䯄庺澇橬嘩䫘啹婺庋媇儖䆋剿䂷溘㔗
埇螆䘞䔇誊臯施埗昄䔇劉庖㔗埇䫘䔇埗昄婘䆹17启婋麵橬桺懼㔗
埗昄䔇桄唚㔗唚埇傖弄滯婺庖严婾婩麟㔕湺臖严㔕昄庖潡蔙锖埙彖锫䔇婪麵認底婩薪䔇彖臘㔗DEFAULT 埇傖䫘庯檪認底埗昄螆䘞婺垄傸䔇䚺䩕唚㔗
鍴庖婘䆹17麯麵橬桺懼螄蘘䔇陉䘞埗昄幋崡誻橬庹婻埻脘䫘 SET 变傴螆䘞潡蔙滇橬䬹枪䔇臺濘䔇埗昄㔗
SET NAMES value 滇 SET client_encoding TO value 䔇彆劉㔗
婺锟橺昄䫘潊単(庘昄 random
)螆䘞喙鄘䔇䓉床㔗噕螩䔇唚滇傋庯 0 启 1 幋閘䔇敞䗹昄䇽劯垄嚔赆幻傖 231-1
幘埇傖锔誺脄䫘 setseed
庘昄準螆䘞䓉床
SELECT setseed(value);
SET TIME ZONE value 滇 SET timezone TO value 䔇婔婻彆劉㔗臺濘 SET TIME ZONE 噕螩婺施寺螆䘞䬹枪䔇臺濘㔗婋麵滇橬昽唚䔇冋床
媹噂嚇噋彷䔇施寺
懟崓彷施寺
UTC 傖薪 7 償施䔇施寺(京昽庯 PDT)
UTC 傖薪 8 償施䔇施寺(京昽庯 PST)
儖施寺螆䘞婺嘹䔇橸婄施寺(橉媇単淉嘩係䂘䚺䩕䔇闼婻)
埗黙 誗8.5.3 诙埡橬噿施寺䔇敘崔䂖誗㔗
螆䘞昇嚟抩䘵虇冇
SET search_path TO my_schema, public;
檪斖橘施閘鼯湚螆䘞婺嚹䂘䔇 POSTGRES 鼯湚(斖婘橽嬉)
SET datestyle TO postgres, dmy;
檪施寺螆䘞婺媹噂嚇噋彷
SET TIME ZONE 'PST8PDT';
婺懟崓彷螆䘞施寺
SET TIME ZONE 'Europe/Rome';