婔斥录傺庖昄扞康嘹儌埇傖螪閞垄
誊臯 PostgreSQL 庴庐䔇䂽䆇䘋废 psql 垄噕螩嘹庴庐婄膷噖㔕䚡膏㔕欓臯 SQL 变傴㔗
嘪䫘潏傸䯄橬䔇商嘵嬉䆇噖噙懫套 PgAccess 潡蔙婥 ODBC 櫇毕䔇媂噸喖傽準录傺启䞇䊖昄扞康㔗認䓉桹濘婘認傘嘺䇔昍䘋婺澇橬傋䂉㔗
嘪䫘崔䓉臺蘔䂏垔婺䔇婔䓉喍婔婻垵潙庫䫘㔗認底埇脘攓婘 Part IV 婺橬敘晌噖䔇螘螺㔗
嘹埇脘驔襕劇媘 psql 準臘黯橸嘺䇔昍䘋婺䔇冋床㔗嘹埇傖䫘婋麵䔇变傴婺 mydb 昄扞康檔昂垄
$ psql mydb
套悩嘹䩕䘖庖昄扞康劉庖闼幽垄䚺䩕儌滇嘹䔇䫘潙蘥埙劉庖㔗嘹噾䂟婘嬉麵䔇償誗麯庖蓼認婔䗹庖㔗
婘 psql 麯嘹嚔䩋彄婋麵䔇渵誯媇敇
Welcome to psql 8.2.3, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit mydb=>
mydb=#
認婻柊䴺严懟叿五嘹滇昄扞康轙亓䫘潙橔埇脘庺䯄婘嘹躻噌垬輙庖 PostgreSQL 䔇愙喕婋㔗嘩婺轙亓䫘潙懟叿五嘹婉埖螪閞毓彽䔇鍊彽㔗凹庯橸嘺䇔昍䘋䔇䕞䔇蔯蘔滇劥轙亓䫘潙幽婉麉襕㔗
套悩嘹劇媘 psql 施䵄彄庖閞鵻闼幽啂彄嬉麵䔇償誗㔗自桺 createdb 䔇桹濘启自桺 psql 䔇桹濘冽䌂嚚套悩嬉蔙脘誊臯闼幽劯蔙幘庫臖脘誊臯㔗
psql 欷剄庺䔇橔劯婔臯滇柊䴺严垄臘䴺 psql 溼劸五嘹臘臺認婻施唍嘹儌埇傖显噖 SQL 昖臵彄婔婻 psql 䂘檴䔇噖嘩寺婺㔗儺臘婔婋婋麵䔇变傴
mydb=> SELECT version(); version ---------------------------------------------------------------- PostgreSQL 8.2.3 on i586-pc-linux-gnu, compiled by GCC 2.96 (1 row) mydb=> SELECT current_date; date ------------ 2002-08-31 (1 row) mydb=> SELECT 2 + 2; ?column? ---------- 4 (1 row)
psql 䘋废橬婔底婉匂庯 SQL 变傴䔇喙鄘变傴㔗垄傸傖埉桩溹"\"嚔崘㔗橬底認䓉变傴婘渵誯媇敇婺彖庺㔗懫套嘹埇傖䫘婋麵䔇变傴诙埡劇䓉 PostgreSQL SQL 变傴䔇婞媷臺濘
mydb=> \h
襕锔庺 psql 髞噖
mydb=> \q
䇽劯 psql 儌嚔锔庺幽婫誫啂彄变傴臯 shell(襕诙埡敘崔橬噿喙鄘变傴䔇媇敇嘹埇傖婘 psql 柊䴺严婪髞噖 \? )㔗psql 䔇垯昘媘脘婘 psql 桺懼婺㔗套悩 PostgreSQL 垬輙溼䇞闼幽嘹誻埇傖婘淉嘩係䂘䔇 shell 柊䴺严婪髞噖 man psql 準黙臂臖桺懼㔗婘認傘桺懼麯潏傸儖婉嚔滯䇞嘪䫘認底䬹攓嘖滇嘹躻噌埇傖婘劽锗䔇施唍嘪䫘垄傸㔗