NOTIFY 变傴劏嘷嬉昄扞康婺欔橬欓臯誺 LISTEN name 溼婘䕏劸䬹垔锔䘖溇傽䔇嬉䆇庫䫘埏锕婔婻锔䘖庋傽㔗
NOTIFY 婺螪閞劯婔婻 PostgreSQL 昄扞康䔇婔䂇誕䘋柊冕庖婔䓉䞔剘䔇媇埙嘵嚟潡誕䘋閘锔螇橺彽㔗敘醻亓䔇橺彽(鍴庖婔婻䞔剘䔇锔䘖劉傖崡)埇傖锔誺嘪䫘昄扞康婺䔇臘傯锔䘖蔙嚹锐昄扞彄毖櫽蔙㔗
嚹锐䂍嬉䆇䔇锔䘖庋傽寙拸锔䘖溇傽劉启埏庺锔䘖䔇劯䆇誕䘋 PID 㔗昄扞康螆螇蔙橬蘼傂垔幬䫘庯昊婻昄扞康䔇溇傽劉启懟婻锔䘖溇傽䔇劆幬㔗
锔婩锔䘖溇傽劉婯昄扞康麯䔇臘䔇劉庖䕩劯锔䘖庋傽垂鍙婪懟叿五"潏媞櫹庖溴昄扞康臙䩋婔䩚橬傔幽桄婩薪"㔗NOTIFY 启 LISTEN 变傴幽婉嚺彽認䓉蕫係㔗冋套昄扞康螆螇蔙埇傖嘪䫘庹婻婉劯䔇溇傽劉準湺媖婔婻臘䔇庹䓉婉劯櫹埻㔗
嘷 NOTIFY 䫘庯锔䘖昊婔䬹垔臘媞櫹䔇媘嘩䔇埏䫘婔婻垂䫘䔇䚡䘋檔噓滇儖 NOTIFY 櫆婘婔婻䫌臘敘桄蓥埏䔇蓇彍麯㔗䫘認䓉桹濘锔䘖儖婘臘敘桄䔇施唍躻媘蓥埏蔯婫庫䫘䘋废叻婉嚔䵄噓媻螄崇䊖垄㔗
NOTIFY 启 SQL 庋媇䫘昊䓉麉襕䔇桹濘誕臯庴扵㔗饡噽套悩 NOTIFY 婘庋媇喙鄘欓臯锔䘖庋傽䕘彄庋媇柊庴欉嚔锕庺㔗認幽啔滇橬長䊖䔇啹婺套悩庋媇锔庺庖闼幽婘垄麯麵䔇欔橬变傴鄘澇橬昽悩(寙拸 NOTIFY)㔗嘖套悩橬庺婯橕锔䘖庋傽䆋剿埏锕認儌婉崻喘庖㔗噽渇嘷婔婻溼婘䕏劸䔇嚔臺婘婔渇庋媇喙櫽彄婔婻锔䘖媇埙䕘彄橸渇庋媇垯潊(柊庴潡锔庺)幋嬉臖锔䘖庋傽儖婉赆锕彄婯幋䕩誂䔇垵潙䆇㔗劯湙套悩婔婻锔䘖婘庋媇喙鄘埏锕庺寂庖蔯臖庋媇䘉劯埽锔庺庖儌婯橕锔䘖埇傖婘昊䓉䘋庥婪赆搴潽啹婺锔䘖婔斥埏锕庺寂橉媇単冪婉脘傯垵潙䆇"櫽啂"锔䘖欔傖锔䘖施閘埻滇婘庋媇幋閘嚹锐㔗認婔䗹儌襕挗嘪䫘 NOTIFY 嘩婺垂施媇埙䔇庫䫘庫臖䇞媺傡傸䔇庋媇儘埇脘䘺㔗
NOTIFY 婘婔桹麵䔇臯婺償 Unix 䔇媇埙套悩劯婔溇傽劉婘䘺施閘喙埏庺庖崔溇媇埙毖櫽蔙庹渇欓臯 NOTIFY 埇脘埻啂櫽彄婔溇锔䘖媇敇㔗欔傖冺蕡庯櫽彄䔇锔䘖溇昄䔇桹濘滇冽婉埇麹䔇㔗啹蔯嘪䫘 NOTIFY 嫴閐驔襕噿濘昊庋䔇庫䫘劯施誻襕嘪䫘昄扞康凹茇(套废彖埙)準虘詻庋傽埏䫘庖庹渇㔗
垵潙䆇䂟婩嚔躻噌埏锕婯溼婘䕏劸䔇锔䘖劉婔湙䔇 NOTIFY 㔗認施垄(垵潙䆇)幘启噽垄溼婘䕏劸䔇嚔臺婔湙櫽彄婔婻锔䘖庋傽㔗認湙埇脘凚躘婔底方䫘䔇噖嘩(婯庫䫘锂膏橬噿)㔗冋套凹垵潙䆇彔喍誺䔇臘埽誕臯婔渇臂淉嘩傖埏䯄滇劥橬敘桄㔗埇傖锔誺演昖橉媇単誕䘋䔇 PID(婘锔䘖庋傽婺柊冕)滇劥婯躻噌䔇劯䆇䔇 PID 婔躘(傯 libpq 婺埡冖)㔗嘷傡傸婔湙施臘滯認滇噽躻躆啂嚹䔇媇敇埇傖媘䘖㔗婉䞇嬉麵䆹誗滇套嘘螾䔇認滇婔婻垬噘䔇檔噓㔗PostgreSQL 媺毕躻躆䔇锔䘖启噽垄彄準䔇锔䘖寺彖嚔㔗欔傖嘹匟諘庖躻噌䔇锔䘖劯婉嚔䘖誺崡鄘䔇锔䘖㔗