SET [ SESSION | LOCAL ] SESSION AUTHORIZATION username SET [ SESSION | LOCAL ] SESSION AUTHORIZATION DEFAULT RESET SESSION AUTHORIZATION
認溇变傴檪嘷嬉嚔臺䯇嵄麯䔇嚔臺䫘潙湺臖启嘷嬉䫘潙湺臖鄘螆䘞婺 username 㔗認婻䫘潙劉埇傖喍潊婔婻湺臖严潡蔙婔婻庖严婾桺橸㔗嘪䫘認婻变傴埇傖婘施埻潊婔婻麂䬹溄䫘潙䘉劯喉彺扵啂轙亓䫘潙㔗
嚔臺䫘潙湺臖严婔嚔哋螆䘞婺(埇脘䂟誺螴臕䔇)垵潙䆇柊冕䔇䫘潙劉㔗嘷嬉䫘潙湺臖严锔婩京庯嚔臺䫘潙湺臖严嘖滇埇脘婘"setuid"䔇䯇嵄麯潡蔙䌂嚚䔇橺彽麯婘施櫹埻㔗幘埇傖䫘 SET ROLE 準媞櫹㔗嘷嬉䫘潙䔇躆傘启溄鍊演昖橬噿㔗
埻橬婘彺哋嚔臺䫘潙(噾螴臕䫘潙)橬轙亓䫘潙溄鍊䔇施唍嚔臺䫘潙湺臖严欉脘櫹埻㔗劥彍埻橬婘毺垔庖赆螴臕䔇䫘潙劉䔇愙喕婋係䂘欉毖埖臖变傴㔗
The SESSION 启 LOCAL 媞閄臉启捞锔 SET 变傴麯䔇嘩䫘䕩劯㔗
The DEFAULT 启 RESET 嘵嚟麉䘞嚔臺启嘷嬉䫘潙湺臖严婺彺哋螴臕䔇䫘潙劉㔗認底嘵嚟埇傖婺傂嘘䫘潙欓臯㔗
SELECT SESSION_USER, CURRENT_USER; session_user | current_user --------------+-------------- peter | peter SET SESSION AUTHORIZATION 'paul'; SELECT SESSION_USER, CURRENT_USER; session_user | current_user --------------+-------------- paul | paul