PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹45. PostgreSQL 䚡乕亥垔媆誕嬉誕

45.3. 髍臇潽敇鼯湚毺凚

認傘鼯湚劏凚䔇䕞䔇滇婯橕脘檪欔橬 PostgreSQL 䫘潊䔇潽敇䂘檴婔婻婔躘䔇䫘潙埋喘䔇鼯湚㔗

45.3.1. 嘘寂嘘傯

婂媇敇庫臖䞔䘺嘺庯庋垂幽婫镪噉嚘䫘䌂嚚䬹垔庘昄劉京認湙䔇垂䯄䂖誗㔗"䞔䘺"懟叿五"婘溼婩愙喕婋庫臖脘櫆婘婔臯麯"㔗套悩媙襕懫套嘹蓬冖驔襕柊彄崌蘖䔇䬹垔係䂘脄䫘幋䌂䔇垂䯄䂖誗埇傖嘪䫘婔婻臥䂖媇敇傖媺毕婂媇敇䔇䞔䘺㔗嘪䫘婔婻柊䴺潽敇䂍庺婔婻媞臖閞鵻䔇柊䴺䬹彆滇婘柊庺䔇傺螞埇脘幽婉攂滇橬昽䔇愙喕婋㔗

懫套埇傖婉認幽喍

IpcMemoryCreate: shmget(key=%d, size=%u, 0%o) failed: %m
(plus a long addendum that is basically a hint)

蔯滇

Primary:    could not create shared memory segment: %m
Detail:     Failed syscall was shmget(key=%d, size=%u, 0%o).
Hint:       the addendum

嘺橸寘䊖媺毕婂潽敇䔇䞔䘺埇傖嘪垄䔇喙垹橬昽幽婫螷垵潙䆇䔇匟幘䷺閘婄匔埇傖啔庺䂍髍臇媇敇媺䘍婔臯儌轿崘䔇啺螆㔗蔯臥䂖媇敇启柊䴺媇敇埇傖蘸䓂彄婔婻喖嘍昇嚟麯潡蔙嘪婔婻嚹庺䔇髍臇䂖誗䔇他埼㔗劯湙臥䂖媇敇启柊䴺媇敇锔婩鄘嚔婘橉媇単斖媖麯潽鍴傖誗亥䷺閘㔗凹垂䯄䂖誗䔇嚘䫘橔喘镪噉啹婺懘䆘䫘潙婉䘖長䂖誗㔗

45.3.2. 湚嚟

婉襕婘潽敇桺橸麯櫆傂嘘橬噿湚嚟寡䔇䬹垔䔇啺螆㔗鍴麂滇垵潙䆇潡蔙橉媇単斖媖婺庖崉劽躻噌驔襕啂剙庖阪臯㔗婘阪媇敇麯桄臯庖严(\n)埇傖䫘庯彖枕傺螞㔗婉襕䫘桄臯䂷溘婔溇潽敇㔗婉襕嘪䫘 tab 潡蔙噽垄湚嚟寡庖严㔗婘髍臇䯇嵄婋䔇滆䴺麯係䂘嚔躻媘䂍䋸䆋亓彆䔇䯇嵄懫套庘昄脄䫘嵂媹桄臯㔗

嘺橸寘䊖媇敇婉婔垔麂冖婘䂽䆇䌂傋䔇滆䴺単婪滆䴺㔗婘 GUI 滆䴺潡蔙婘敟蓽単麯認底湚嚟毺䴺単橔喘赆媘䘖㔗

45.3.3. 嚘埙

婘驔襕䔇施唍苌桺桺橸庫臖嘪䫘埯嚘埙嚘蕙準㔗噽垄臺蘔䔇桺橸庫臖婔躘婄嘪䫘婔䓉嚘埙認䓉䫘濘庫臖启庺䬽幹愇傖埪噽垄䘋废䔇螇䞖膷庺婔躘㔗

嘺橸寘䊖锬拷埯嚘埙蔯婉滇剘嚘埙傯昊䓉蓐庥準臘滇锟橺锬拷嘖滇庫臖滇橔嚻䔇锬拷㔗橬庺傺螞誺湹扞 SQL 嚹䂘婘婉劯凹茇䌂傋婪嘪䫘婉劯䔇嚘埙(幘儌滇臘庖严婾剘嚘埙湺臖严埯嚘埙)㔗嘖滇認滇婔䓉臺蘔喙鄘䔇檔噓螩崔䫘潙䫔躿鄘婉䖘旬幽婫幘婉脘寯潻彄噽垄䌂傋䔇嚘埙婺劽幘婉脘䪂臏潊噽垄臺蘔蔯婫幘澇嘖懟幬㔗

45.3.4. 嘪䫘嚘埙

攂滇䫘嚘埙彖锫桺傽劉䫘潙柊冕䔇湺臖严傖埪噽垄埇脘寙劆庖䔇埻麟㔗婉襕䫘嚘埙寙劆闼底婉嚔寙劆庖䔇埻麟(懫套淉嘩严)㔗

婘劯䆇麯橬底庘昄嚔湹扞驔襕婘傡傸䔇膷庺婪媹埯嚘埙(懫套 format_type_be())㔗婉襕婘認䌂庘昄䔇膷庺婪媹鵺崡䔇嚘埙㔗s

嘺橸寘䊖凹茇䔇劉庖啯噖彄媇敇麯麵幋劯埇脘锹潊溓幬㔗婘婔婻某噖䔇劉愫䔇劇䴺启䂽溵䔇嘉䘞媺毕婔躘㔗嘖滇婉襕婘媇敇麯晙溗崓麟婉媙襕䔇潡蔙麉崉䔇嚘埙㔗

45.3.5. 臺濘启湺䗹

凹庯婂髍臇媇敇启臥䂖/柊䴺媇敇蓇彍婉劯

婂髍臇媇敇饡庖應婉襕崓喍㔗婉襕䫘埖埙䂷溘媇敇㔗䂺凹婉襕䫘培埙䂷溘婔溇媇敇㔗

臥䂖启柊䴺媇敇嘪䫘垯昘䔇埖床幽婫䫘埖埙䂽溵懟婻臺埖㔗埖床饡庖應崓喍㔗

嘺橸寘䊖镪噉湺䗹埇傖螷垵潙䆇庫䫘懫膄垹滷檪媇敇啯噖彄劇䓉臺蘔䯇嵄婺㔗幽婫婂潽敇幘䂟婩婉滇垯昘䔇埖床㔗幽婫套悩媇敇阪冖轙誺婔婻埖床闼幽儌庫臖檪傡傸彖輗搏婂媇敇启臥䂖媇敇鄘彖㔗婉誺䂖誗启柊䴺媇敇阪冖崔幽婫埇脘驔襕寙劆婘崔婻埖床婺㔗婺庖媺毕婔躘認底埖床庫臖镕冻垯昘冖埖床冖鼯湚剿嘪傡傸埻橬婔婻埖床㔗

45.3.6. 崓喍庖严婯償喍庖严懫膄

潽敇䫘臺嘪䫘償喍庖严寙拸婂髍臇媇敇䔇饡庖應㔗套悩潽敇婺庺䯄 SQL 变傴启噿髞庖䫘崓喍㔗

嘺橸寘䊖認湙冽垹滷螷欔橬婩薪䩋蕙準鄘婔湙啹婺橬底潽敇滇垯昘䔇埖床橬底婉滇㔗

45.3.7. 镪噉赆媘臺愫

嘪䫘婂媘臺愫㔗套悩橬婂臺闼幽儌嘪䫘垯昘䔇埖床("A婉脘啔 B")㔗套悩婂臺滇䘋废躻噌闼幽儌嘪䫘䫕檖鼯湚䔇臺蘔婉襕䫘"潏"嘩婺䘋废䔇婂臺㔗

嘺橸寘䊖䘋废婉滇庺㔗劥彍婉襕輙潊庺㔗

45.3.8. 䯄傼施婯誺寂施䔇懫膄

套悩儺臘昊庋崌蘖嘖埇脘婋渇儺臘䔇施唍潊媘(埇脘滇媞臖庖昊底閞鵻幋劯)闼幽嘪䫘誺寂施㔗套悩髍臇藇垔滇愩幙䔇闼幽䫘䯄傼施㔗

婋麵䔇婴婻嘵嚟䔇埖床幋閘䔇噞彆幽婉償

could not open file "%s": %m

cannot open file "%s"

丸婔婻埖床䔇懟攺滇欷嚔昊婻桺傽䔇嚕商崌蘖㔗認婻媇敇庫臖䂍庺婔婻寘啹懫套臘"伕䕻悇"潡蔙"桺傽婉庻婘"幋䌂䔇㔗誺寂施䔇臺愫庫臖滇劽锗䔇啹婺婋渇伕䕻埇脘婉喉滇悇䔇潡蔙橬閞鵻䔇桺傽庻婘庖㔗

丸庯䓉嘵嚟臘䴺欷嚔毺垔桺傽䔇媘脘湹橸儌婉婘䘋废麯庻婘潡蔙滇認幽啔楗媕婪滇髍臇䔇㔗䯄傼施臺愫滇劽锗䔇啹婺認婻溇傽儖方溇傽庻婘㔗

嘺橸寘䊖嘷䇽捞锔䫘潙儖婉嚔備備傯媇敇䔇施攕婪冖庺崓麟䔇䂷螺嘖滇斵䇽臺蘔柊冕䂍臺濘闼幽儌庫臖溼䇞嘪䫘㔗

45.3.9. 凹茇䌂傋

婘嚘䫘婔婻凹茇䔇劉庖䔇施唍臘滯垄滇傔幽䌂傋䔇凹茇㔗

嘺橸寘䊖劥彍澇庺䘖長"foo.bar.baz"滇傔幽㔗

45.3.10. 桹拸嚓

桹拸嚓埻䫘婘(1)变傴臺濘麯臘䴺埇锬䔇埗昄潡蔙(2)臘䴺婔婻昄䂇婋湺㔗

嘺橸寘䊖傂嘘噽垄䔇婩薪鄘婉脘凹庫認婴䓉婺欔变䘖䔇幹愇䫘濘幽婫嚔螷庺晙晖㔗

45.3.11. 䂇輙髍臇媇敇

套悩婔婻媇敇寙劆噽垄婄桹䫘潊䔇桺橸䫘婋麵䔇鼯湚寙劆垄

could not open file %s: %m

嘺橸寘䊖冽锆嚄螇欔橬埇脘櫆婘認麯䔇髍臇傼乕幽婫檪垄櫆婘婔婻广悏䔇埖床麯欔傖驔襕昊䓉桹嚟䔇湺䗹㔗幘敆䂟傺螞檪啯噖䔇桺橸櫆婘婖拸嚓麯嘖滇套悩啯噖桺橸滇媇敇䔇橔麉襕鄘彖闼幽儌婉崻躻䇽蔯認䓉愙喕滇冽䂟婩䔇㔗

45.3.12. 髍臇䔇寘啹

潽敇庫臖攂滇臘滯婺傔幽埏䫘髍臇㔗懫套

BAD:    could not open file %s
BETTER: could not open file %s (I/O failure)

套悩婉䘖長寘啹闼幽嘹橔喘媞臖傼乕㔗

45.3.13. 庘昄劉

婉襕婘髍臇媇敇麯寙劆檖只誺䘋䔇劉庖㔗驔襕䔇施唍橬彆䔇橺彽欆庺認婻庘昄幽婫凹庯崓崔昄䫘潙認婻媇敇幘澇傔幽䫘㔗套悩髍臇媇敇婘䚺儏庘昄劉䔇愙喕婋澇橬傔幽懟幬闼幽麉桄毻膂㔗

BAD:    pg_atoi: error in "z": can't parse "z"
BETTER: invalid input syntax for integer: "z"

幘镪噉柊埪赆脄䫘䔇庘昄劉庖庫臖臘傼乕蓖商啔傔幽

BAD:    open() failed: %m
BETTER: could not open file %s: %m

套悩䇞垂媙襕婘臥䂖媇敇麯柊庺係䂘脄䫘㔗婘昊底婺劽婋柊冕䂍係䂘脄䫘䔇噙嘷昄唚滇锗劽櫆婘臥䂖媇敇麯㔗

嘺橸寘䊖䫘潙婉䘖長認底庘昄鄘幾底嘖㔗

45.3.14. 儘麟镪噉䔇庖䩚

Unable/婉脘㔗 "Unable/婉脘"庹幯滇赆媘臺愫㔗橔喘嘪䫘"cannot/方濘"潡蔙"could not"㔗

Bad/废䔇㔗 䌂嚚"bad result/废䂷悩"認湙䔇媇敇䩘䔇滇冽锆蕻滯婄蓼麪㔗橔喘喍庺婺傔幽䂷悩滇"bad/废䔇"懫套"invalid format/麂濘湚嚟"㔗

Illegal/麂濘㔗 "Illegal/麂濘"臘䴺誺埉庖濘冋噽垄䔇儌滇"invalid/麂濘"㔗嘖滇橔喘誻滇臘麂濘㔗

Unknown/橻䘖㔗 庫臖镪噉嘪䫘"unknown/橻䘖"㔗愿愿"error: unknown response"㔗套悩嘹婉䘖長巉庫滇傔幽嘹支幽䘖長滇髍臇?"Unrecognized/方濘臖彆䔇"锔婩滇敘喘䔇锬拷㔗誻橬橔喘襕寙拸赆懫膄䔇昄唚㔗

BAD:    unknown node type
BETTER: unrecognized node type: 42

Find/欆彄 vs. Exists/庻婘㔗 套悩䘋废嘪䫘婔婻䕩嘷崉溗䔇䞖濘準垔嘉婔婻蕇溊(懫套婔婻虇冇抩䘵)幽婫䞖濘崌蘖庖闼幽臘䘋废方濘"欆彄"櫹蕇溊滇劽䊖䔇㔗嘖滇套悩臺愫䔇蕇溊嘉䘞滇噾䘖䔇嘖滇䘋废方濘婘闼麯螪閞垄闼幽臘認婻蕇溊婉"庻婘"㔗認䓉愙喕婋䫘"欆彄"劸蕙準臺愫懫膄嚌幽婫嚔晙晖庋垂㔗

45.3.15. 溼䇞婄拚喍

䫘剘臉䔇噘拚㔗懫套镪噉婋麵認湙䔇䚷喍

嘺橸寘䊖認湙儖櫹塇婔躘攓㔗

45.3.16. 橸婄寡

臙螄嘟髍臇媇敇桺橸滇驔襕䪂臏潊噽垄臺蘔䔇㔗镕冻誗46.2.2麯麵䔇毺凚傖镪噉䂍䪂臏垽锹潊崻崔麂䄥㔗


劯锔饡釕嬉誕
檖只橉媇単麯䔇髍臇婪婔亓橸婄臺蘔櫇毕