- PostgreSQL ³£¼ûÎÊÌ⣨FAQ£© ×î½ü¸üУº2003 Äê 01 Ô 06 ÈÕ ÐÇÆÚÒ»
- 22:27:35 CST Ŀǰά»¤ÈËÔ±£ºBruce Momjian (pgman@candle.pha.pa.us )
+ PostgreSQL ³£¼ûÎÊÌ⣨FAQ£©
+
+ ×î½ü¸üУº2003 Äê 01 Ô 06 ÈÕ ÐÇÆÚÒ» 22:27:35 CST
+
+ Ŀǰά»¤ÈËÔ±£ºBruce Momjian (pgman@candle.pha.pa.us)
ÖÐÎÄ°æά»¤ÈËÔ±£ººÎΰƽ £¨laser@pgsqldb.com £©
- ±¾ÎĵµµÄ×îа汾¿ÉÒÔÔÚhttp:
- //www.postgresql.org/files/documentation/faqs/FAQ.html ²é¿´¡£
+
+ ±¾ÎĵµµÄ×îа汾¿ÉÒÔÔÚhttp://www.postgresql.org/files/documentation/fa
+ qs/FAQ.html ²é¿´¡£
+
²Ù×÷ϵͳƽ̨Ïà¹ØµÄÎÊÌâÔÚhttp://www.postgresql.org/docs/faq/Àï»Ø´ð¡£
- ----------------------------------------------------------------------
- -- ³£¼ûÎÊÌâ 1.1 <#1.1>) PostgreSQL ÊÇʲô£¿¸ÃÔõô·¢Òô£¿ 1.2 <#1.2>)
- PostgreSQL µÄ°æȨÊÇʲô? 1.3 <#1.3>) PostgreSQL ÔËÐÐÔÚʲô Unix
- ƽ̨ÉÏ£¿ 1.4 <#1.4>) ¿ÉÓÃµÄ·Ç Unix ƽ̨ÓÐÄÇЩ£¿ 1.5 <#1.5>)
- ÎÒ´ÓÄÄÀïÄܵõ½ PostgreSQL£¿ 1.6 <#1.6>) ÎÒ´ÓÄÄÀïÄܵõ½¶Ô PostgreSQL
- µÄÖ§³Ö£¿ 1.7 <#1.7>) PostgreSQL ×îеİ汾ÊÇʲô£¿ 1.8 <#1.8>)
- ÓÐÄÄЩ¿ÉÓÃµÄ PostgreSQL µÄÎĵµ£¿ 1.9 <#1.9>) ÎÒÈçºÎÁ˽âÒÑÖªµÄ BUG
- »òȱʧµÄÌØÐÔ£¿ 1.10 <#1.10>) ÎÒÓ¦¸ÃÔõÑùѧϰ SQL £¿ 1.11 <#1.11>)
- PostgreSQL ÊÇ Y2K ¼æÈݵÄÂ𣿠1.12 <#1.12>) ÎÒÓ¦¸ÃÔõÑù¼ÓÈ뿪·¢¶ÓÎ飿
- 1.13 <#1.13>) ÎÒÓ¦¸ÃÔõÑùÌá½»Ò»¸ö BUG ±¨¸æ£¿ 1.14 <#1.14>) PostgreSQL
- ºÍÆäËû DBMS ±ÈÆðÀ´ÈçºÎ£¿ 1.15 <#1.15>) ÎÒÓ¦¸ÃÔõÑùÔÞÖú PostgreSQL £¿
- Óû§¿Í»§¶ËÎÊÌâ 2.1 <#2.1>) ÓÐ PostgreSQL µÄ ODBC Çý¶¯³ÌÐòô£¿ 2.2
- <#2.2>) ÓÐʲô¹¤¾ß¿ÉÒÔ°Ñ PostgreSQL ÓÃÓÚ Web Ò³Ã棿 2.3 <#2.3>)
- PostgreSQL ÓµÓÐͼÐÎÓû§½çÃæÂ𣿠2.4 <#2.4>) ÎÒÃÇ¿ÉÒÔÓÃʲôÓïÑÔºÍ
- PostgreSQL ´ò½»µÀ£¿ ϵͳ¹ÜÀíÎÊÌâ 3.1 <#3.1>) ÎÒÔõÑùÄÜ°Ñ PostgreSQL
- ×°ÔÚ /usr/local/pgsql ÒÔÍâµÄµØ·½£¿ 3.2 <#3.2>) µ±ÎÒÔËÐÐ postmaster
- ʱ£¬³öÏÖ/ Bad System Call/£¨ÏµÍ³µ÷ÓÃ´í£© »ò Core Dumped ´íÎó¡£ÎªÊ²Ã´£¿
- 3.3 <#3.3>) µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ /IpcMemoryCreate/
- ´íÎó¡£Îª ʲô£¿ 3.4 <#3.4>) µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ
- /IpcSemaphoreCreate/ ´íÎó¡£ ÎªÊ²Ã´£¿ 3.5 <#3.5>)
- ÎÒÈçºÎ¿ØÖÆÀ´×ÔÆäËûÖ÷»úµÄÁ¬½Ó£¿ 3.6 <#3.6>)
- ÎÒÔõÑùµ÷ÕûÊý¾Ý¿âÒýÇæÒÔ»ñµÃ¸üºÃµÄÐÔÄÜ£¿ 3.7 <#3.7>) PostgreSQL
- Àï¿ÉÒÔ»ñµÃʲôÑùµÄµ÷ÊÔÌØÐÔ£¿ 3.8 <#3.8>)
- ΪʲôÔÚÊÔͼÁ¬½ÓµÇ¼ʱÊÕµ½¡°Sorry, too many clients¡± ÏûÏ¢£¿ 3.9
- <#3.9>) pgsql_tmp Ŀ¼ÀﶼÓÐЩʲô£¿ 3.10 <#3.10>) ΪʲôҪÔÚÉý¼¶
- PostgreSQL ·¢²¼°æ±¾Ê±×ö dump ºÍ restore £¿ ²Ù×÷ÎÊÌâ 4.1 <#4.1>)
- ¶þ½øÖÆÓαêºÍÆÕͨÓαêÖ®¼äµÄÇø±ðÊÇʲô£¿ 4.2 <#4.2>)
- ÈçºÎֻѡÔñÒ»¸ö²éѯ½á¹ûµÄÍ·¼¸ÐУ¿ 4.3 <#4.3>)
- ÎÒÈçºÎ»ñÈ¡Ò»¸öÊý¾Ý¿âÖбíµÄÁÐ±í£¬»òÕßÊÇÆäËûÎÒÄÜÔÚ /psql /Àï¿´
- µ½µÄ¶«Î÷£¿ 4.4 <#4.4>) ÔõÑù´Ó±íÀïÃæɾ³ýÒ»ÁУ¿ 4.5 <#4.5>)
- Ò»ÐУ¬Ò»¸ö±í£¬Ò»¸ö¿âµÄ×î´ó³ß´çÊǶàÉÙ£¿ 4.6 <#4.6>)
- ´æ´¢Ò»¸öµäÐ͵ÄÎı¾ÎļþÀïµÄÊý¾ÝÐèÒª¶àÉÙ´ÅÅ̿ռ䣿 4.7 <#4.7>)
- ÈçºÎ²é¿´±í¡¢Ë÷Òý¡¢Êý¾Ý¿âÒÔ¼°Óû§µÄ¶¨Ò壿 4.8 <#4.8>)
- ÎҵIJéѯºÜÂý»òÕßûÓÐÀûÓÃË÷Òý¡£ÎªÊ²Ã´£¿ 4.9 <#4.9>)
- ÎÒÈçºÎ²ÅÄÜ¿´µ½²éѯÓÅ»¯Æ÷ÊÇÔõÑù´¦ÀíÎҵIJéѯµÄ£¿ 4.10 <#4.10>) R-tree
- Ë÷ÒýÊÇʲô£¿ 4.11 <#4.11>) ʲôÊÇ»ùÒò²éѯÓÅ»¯£¨Genetic Query
- Optimization£©£¿ 4.12 <#4.12>)
- ÎÒÔõÑù×öÕýÔò±í´ïʽËÑË÷ºÍ´óСдÎ޹صÄÕýÔò±í´ïʽ²éÕÒ£¿ÔõÑùÀû
- ÓÃË÷Òý½øÐдóСдÎ޹زéÕÒ£¿ 4.13 <#4.13>)
- ÔÚÒ»¸ö²éѯÀÎÒÔõÑù¼ì²âÒ»¸ö×Ö¶ÎÊÇ·ñΪ NULL£¿ 4.14 <#4.14>)
- ¸÷ÖÖ×Ö·ûÀàÐÍÖ®¼äÓÐʲô²»Í¬£¿ 4.15.1 <#4.15.1>)
- ÎÒÔõÑù´´½¨Ò»¸öÐòÁкÅ/×Ô¶¯µÝÔöµÄ×ֶΣ¿ 4.15.2 <#4.15.2>)
- ÎÒÈçºÎ»ñµÃÒ»¸ö²åÈëµÄÐòÁкŵÄÖµ£¿ 4.15.3 <#4.15.3>) ʹÓà currval() ºÍ
- nextval() »áµ¼ÖºÍÆäËûÓû§µÄÎÉÂÒÇé¿ö £¨race condition£©Â𣿠4.15.4
- <#4.15.4>) Ϊʲô²»ÔÚÊÂÎñÒì³£ÖÐÖ¹ºóÖØÓÃÐòÁкÅÄØ£¿ÎªÊ²Ã´ÔÚÐòÁкÅ×Ö
- ¶ÎµÄÈ¡ÖµÖдæÔÚ¼ä¶ÏÄØ£¿ 4.16 <#4.16>) ʲôÊÇ OID£¿Ê²Ã´ÊÇ TID £¿ 4.17
- <#4.17>) PostgreSQL ʹÓõÄһЩÊõÓïµÄº¬ÒåÊÇʲô£¿ 4.18 <#4.18>)
- ΪʲôÎÒÊÕµ½´íÎó¡°/ERROR: Memory exhausted in AllocSetAlloc()/¡±£¿
- 4.19 <#4.19>) ÎÒÈçºÎ²ÅÄÜÖªµÀËùÔËÐÐµÄ PostgreSQL µÄ°æ±¾£¿ 4.20 <#4.20>)
- ΪʲôÎҵĴó¶ÔÏó²Ù×÷µ¼Ö´íÎó¡°/invalid large obj
- descriptor¡±£¨·Ç·¨µÄ´ó¶ÔÏóÃèÊö·û£©/£¿ 4.21 <#4.21>)
- ÎÒÈçºÎ´´½¨Ò»¸öȱʡֵÊǵ±Ç°Ê±¼äµÄ×ֶΣ¿ 4.22 <#4.22>) ΪʲôʹÓà IN
- µÄ×Ó²éѯÕâôÂý£¿ 4.23 <#4.23>) ÈçºÎ½øÐÐ outer join £¨ÍâÁ¬½Ó£©£¿ 4.24
- <#4.24>) ÈçºÎʹÓÃÉæ¼°¶à¸öÊý¾Ý¿âµÄ²éѯ£¿ 4.25 <#4.25>)
- ÈçºÎÈú¯Êý·µ»Ø¶àÐлò¶àÁУ¿ 4.26 <#4.26>) ΪʲôÔÚ PL/PgSQL
- º¯ÊýÖв»ÄÜ¿É¿¿µØ´´½¨»òɾ³ýÁÙʱ±í£¿ 4.27 <#4.27>) ÓÐÄÄЩÊý¾Ý¸´ÖÆÑ¡Ï
- 4.28 <#4.28>) ÓÐÄÄЩÊý¾Ý¼ÓÃÜÑ¡Ï À©Õ¹ PostgreSQL 5.1 <#5.1>)
- ÎÒдÁËÒ»¸öÓû§¶¨Ò庯Êý¡£µ±ÎÒÔÚ/ psql/ ÀïÔËÐÐʱ£¬ÎªÊ²Ã´»áµ¼Ö core
- dump£¿ 5.2 <#5.2>) ÎÒÈçºÎÄܸø PostgreSQL
- ¹±Ï×һЩͦ²»´íµÄÐÂÀàÐͺͺ¯Êý£¿ 5.3 <#5.3>) ÎÒÔõÑùдһ¸ö·µ»ØÒ»Ìõ¼Ç¼µÄ
- C º¯Êý£¿ 5.4 <#5.4>)
- ÎÒÐÞ¸ÄÁËÒ»¸öÔ´Îļþ£¬ÎªÊ²Ã´ÖØбàÒëºóûÓп´µ½¸Ä±ä£¿
- ----------------------------------------------------------------------
- -- ³£¼ûÎÊÌâ 1.1) PostgreSQL ÊÇʲô£¿¸ÃÔõô·¢Òô£¿ PostgreSQL ¶Á×÷
- /Post-Gres-Q-L// ¡£/ PostgreSQL ÊÇÏÂÒ»´ú DBMS µÄÑо¿ÔÐÍ POSTGRES
- Êý¾Ý¿â¹ÜÀíϵͳµÄÔöÇ¿°æ¡£ PostgreSQL ÔÚ±£³Ö POSTGRES
- µÄÇ¿´óµÄÊý¾ÝÄ£ÐͺͷḻµÄÊý¾ÝÀàÐ͵Ļù´¡ÉÏ£¬Óà һ¸öÀ©Õ¹Á赀 SQL
- ×Ó¼¯È¡´úÁËÔÏ鵀 PostQuel ²éѯÓïÑÔ¡£PostgreSQL ÊÇ×ÔÓɵÄ
- ²¢ÇÒËùÓÐÔ´´úÂ붼¿ÉÒÔ»ñµÃ¡£ PostgreSQL µÄ¿ª·¢ÓÉ²Î¼Ó PostgreSQL
- ¿ª·¢ÓʼþÁбíµÄÒ»¸ö¿ª·¢ÈËԱС×é½øÐС£ Ä¿Ç°µÄе÷ÈËÊÇ Marc G. Fournier
- £¨scrappy@postgreSQL.org £©¡££¨¹ØÓÚÈçºÎ¼ÓÈë²Î¼û1.6½Ú£©¡£Õâ¸ö¶ÓÎé
- ÏÖÔÚ¸ºÔð PostgreSQL µÄËùÓпª·¢¡£ PostgreSQL 1.01 µÄ×÷ÕßÊÇ Andrew Yu ºÍ
- Jolly Chen¡£»¹ÓÐÐí¶àÆäËûÈËΪÒÆÖ²£¬
- ²âÊÔ£¬µ÷ÊÔºÍÔöÇ¿´úÂë×öÁË´óÁ¿¹±Ïס£PostgreSQL µÄ×î³õÆðÔ´
- Postgres£¬ÊÇÔÚ¼Ó ÖÝ´óѧ²®¿ËÀû·ÖУµÄ Michael Stonebraker
- ½ÌÊÚµÄÖ¸µ¼Ï£¬ÓÉÐí¶àÑо¿Éú£¬±¾¿Æ ÉúºÍ±à³ÌÖ°Ô±Íê³ÉµÄ¡£
+ _________________________________________________________________
+
+ ³£¼ûÎÊÌâ
+
+ 1.1) PostgreSQL ÊÇʲô£¿¸ÃÔõô·¢Òô£¿
+ 1.2) PostgreSQL µÄ°æȨÊÇʲô?
+ 1.3) PostgreSQL ÔËÐÐÔÚʲô Unix ƽ̨ÉÏ£¿
+ 1.4) ¿ÉÓÃµÄ·Ç Unix ƽ̨ÓÐÄÇЩ£¿
+ 1.5) ÎÒ´ÓÄÄÀïÄܵõ½ PostgreSQL£¿
+ 1.6) ÎÒ´ÓÄÄÀïÄܵõ½¶Ô PostgreSQL µÄÖ§³Ö£¿
+ 1.7) PostgreSQL ×îеİ汾ÊÇʲô£¿
+ 1.8) ÓÐÄÄЩ¿ÉÓÃµÄ PostgreSQL µÄÎĵµ£¿
+ 1.9) ÎÒÈçºÎÁ˽âÒÑÖªµÄ BUG »òȱʧµÄÌØÐÔ£¿
+ 1.10) ÎÒÓ¦¸ÃÔõÑùѧϰ SQL £¿
+ 1.11) PostgreSQL ÊÇ Y2K ¼æÈݵÄÂð£¿
+ 1.12) ÎÒÓ¦¸ÃÔõÑù¼ÓÈ뿪·¢¶ÓÎ飿
+ 1.13) ÎÒÓ¦¸ÃÔõÑùÌá½»Ò»¸ö BUG ±¨¸æ£¿
+ 1.14) PostgreSQL ºÍÆäËû DBMS ±ÈÆðÀ´ÈçºÎ£¿
+ 1.15) ÎÒÓ¦¸ÃÔõÑùÔÞÖú PostgreSQL £¿
+
+ Óû§¿Í»§¶ËÎÊÌâ
+
+ 2.1) ÓÐ PostgreSQL µÄ ODBC Çý¶¯³ÌÐòô£¿
+ 2.2) ÓÐʲô¹¤¾ß¿ÉÒÔ°Ñ PostgreSQL ÓÃÓÚ Web Ò³Ã棿
+ 2.3) PostgreSQL ÓµÓÐͼÐÎÓû§½çÃæÂð£¿
+ 2.4) ÎÒÃÇ¿ÉÒÔÓÃʲôÓïÑÔºÍ PostgreSQL ´ò½»µÀ£¿
+
+ ϵͳ¹ÜÀíÎÊÌâ
+
+ 3.1) ÎÒÔõÑùÄÜ°Ñ PostgreSQL ×°ÔÚ /usr/local/pgsql ÒÔÍâµÄµØ·½£¿
+ 3.2) µ±ÎÒÔËÐÐ postmaster ʱ£¬³öÏÖ Bad System Call£¨ÏµÍ³µ÷ÓÃ´í£©»ò Core
+ Dumped ´íÎó¡£ÎªÊ²Ã´£¿
+ 3.3) µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ IpcMemoryCreate ´íÎó¡£ÎªÊ²Ã´£¿
+ 3.4) µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ IpcSemaphoreCreate
+ ´íÎó¡£ÎªÊ²Ã´£¿
+ 3.5) ÎÒÈçºÎ¿ØÖÆÀ´×ÔÆäËûÖ÷»úµÄÁ¬½Ó£¿
+ 3.6) ÎÒÔõÑùµ÷ÕûÊý¾Ý¿âÒýÇæÒÔ»ñµÃ¸üºÃµÄÐÔÄÜ£¿
+ 3.7) PostgreSQL Àï¿ÉÒÔ»ñµÃʲôÑùµÄµ÷ÊÔÌØÐÔ£¿
+ 3.8) ΪʲôÔÚÊÔͼÁ¬½ÓµÇ¼ʱÊÕµ½¡°Sorry, too many clients¡± ÏûÏ¢£¿
+ 3.9) pgsql_tmp Ŀ¼ÀﶼÓÐЩʲô£¿
+ 3.10) ΪʲôҪÔÚÉý¼¶ PostgreSQL ·¢²¼°æ±¾Ê±×ö dump ºÍ restore £¿
+
+ ²Ù×÷ÎÊÌâ
+
+ 4.1) ¶þ½øÖÆÓαêºÍÆÕͨÓαêÖ®¼äµÄÇø±ðÊÇʲô£¿
+ 4.2) ÈçºÎֻѡÔñÒ»¸ö²éѯ½á¹ûµÄÍ·¼¸ÐУ¿
+ 4.3) ÎÒÈçºÎ»ñÈ¡Ò»¸öÊý¾Ý¿âÖбíµÄÁÐ±í£¬»òÕßÊÇÆäËûÎÒÄÜÔÚ psql
+ Àï¿´µ½µÄ¶«Î÷£¿
+ 4.4) ÔõÑù´Ó±íÀïÃæɾ³ýÒ»ÁУ¿
+ 4.5) Ò»ÐУ¬Ò»¸ö±í£¬Ò»¸ö¿âµÄ×î´ó³ß´çÊǶàÉÙ£¿
+ 4.6) ´æ´¢Ò»¸öµäÐ͵ÄÎı¾ÎļþÀïµÄÊý¾ÝÐèÒª¶àÉÙ´ÅÅ̿ռ䣿
+ 4.7) ÈçºÎ²é¿´±í¡¢Ë÷Òý¡¢Êý¾Ý¿âÒÔ¼°Óû§µÄ¶¨Ò壿
+ 4.8) ÎҵIJéѯºÜÂý»òÕßûÓÐÀûÓÃË÷Òý¡£ÎªÊ²Ã´£¿
+ 4.9) ÎÒÈçºÎ²ÅÄÜ¿´µ½²éѯÓÅ»¯Æ÷ÊÇÔõÑù´¦ÀíÎҵIJéѯµÄ£¿
+ 4.10) R-tree Ë÷ÒýÊÇʲô£¿
+ 4.11) ʲôÊÇ»ùÒò²éѯÓÅ»¯£¨Genetic Query Optimization£©£¿
+ 4.12)
+ ÎÒÔõÑù×öÕýÔò±í´ïʽËÑË÷ºÍ´óСдÎ޹صÄÕýÔò±í´ïʽ²éÕÒ£¿ÔõÑùÀûÓÃË÷Òý½øÐдó
+ СдÎ޹زéÕÒ£¿
+ 4.13) ÔÚÒ»¸ö²éѯÀÎÒÔõÑù¼ì²âÒ»¸ö×Ö¶ÎÊÇ·ñΪ NULL£¿
+ 4.14) ¸÷ÖÖ×Ö·ûÀàÐÍÖ®¼äÓÐʲô²»Í¬£¿
+ 4.15.1) ÎÒÔõÑù´´½¨Ò»¸öÐòÁкÅ/×Ô¶¯µÝÔöµÄ×ֶΣ¿
+ 4.15.2) ÎÒÈçºÎ»ñµÃÒ»¸ö²åÈëµÄÐòÁкŵÄÖµ£¿
+ 4.15.3) ʹÓà currval() ºÍ nextval() »áµ¼ÖºÍÆäËûÓû§µÄÎÉÂÒÇé¿ö£¨race
+ condition£©Âð£¿
+ 4.15.4)
+ Ϊʲô²»ÔÚÊÂÎñÒì³£ÖÐÖ¹ºóÖØÓÃÐòÁкÅÄØ£¿ÎªÊ²Ã´ÔÚÐòÁкÅ×ֶεÄÈ¡ÖµÖдæÔÚ¼ä
+ ¶ÏÄØ£¿
+ 4.16) ʲôÊÇ OID£¿Ê²Ã´ÊÇ TID £¿
+ 4.17) PostgreSQL ʹÓõÄһЩÊõÓïµÄº¬ÒåÊÇʲô£¿
+ 4.18) ΪʲôÎÒÊÕµ½´íÎó¡°ERROR: Memory exhausted in AllocSetAlloc()¡±£¿
+ 4.19) ÎÒÈçºÎ²ÅÄÜÖªµÀËùÔËÐÐµÄ PostgreSQL µÄ°æ±¾£¿
+ 4.20) ΪʲôÎҵĴó¶ÔÏó²Ù×÷µ¼Ö´íÎó¡°invalid large obj
+ descriptor¡±£¨·Ç·¨µÄ´ó¶ÔÏóÃèÊö·û£©£¿
+ 4.21) ÎÒÈçºÎ´´½¨Ò»¸öȱʡֵÊǵ±Ç°Ê±¼äµÄ×ֶΣ¿
+ 4.22) ΪʲôʹÓà IN µÄ×Ó²éѯÕâôÂý£¿
+ 4.23) ÈçºÎ½øÐÐ outer join £¨ÍâÁ¬½Ó£©£¿
+ 4.24) ÈçºÎʹÓÃÉæ¼°¶à¸öÊý¾Ý¿âµÄ²éѯ£¿
+
+ 4.25) ÈçºÎÈú¯Êý·µ»Ø¶àÐлò¶àÁУ¿
+
+ 4.26) ΪʲôÔÚ PL/PgSQL º¯ÊýÖв»ÄÜ¿É¿¿µØ´´½¨»òɾ³ýÁÙʱ±í£¿
+
+ 4.27) ÓÐÄÄЩÊý¾Ý¸´ÖÆÑ¡Ï
+ 4.28) ÓÐÄÄЩÊý¾Ý¼ÓÃÜÑ¡Ï
+
+ À©Õ¹ PostgreSQL
+
+ 5.1) ÎÒдÁËÒ»¸öÓû§¶¨Ò庯Êý¡£µ±ÎÒÔÚ psql ÀïÔËÐÐʱ£¬ÎªÊ²Ã´»áµ¼Ö core
+ dump£¿
+ 5.2) ÎÒÈçºÎÄܸø PostgreSQL ¹±Ï×һЩͦ²»´íµÄÐÂÀàÐͺͺ¯Êý£¿
+ 5.3) ÎÒÔõÑùдһ¸ö·µ»ØÒ»Ìõ¼Ç¼µÄ C º¯Êý£¿
+ 5.4) ÎÒÐÞ¸ÄÁËÒ»¸öÔ´Îļþ£¬ÎªÊ²Ã´ÖØбàÒëºóûÓп´µ½¸Ä±ä£¿
+ _________________________________________________________________
+
+ ³£¼ûÎÊÌâ
+
+ 1.1) PostgreSQL ÊÇʲô£¿¸ÃÔõô·¢Òô£¿
+
+ PostgreSQL ¶Á×÷ Post-Gres-Q-L ¡£
+
+ PostgreSQL ÊÇÏÂÒ»´ú DBMS µÄÑо¿ÔÐÍ POSTGRES
+ Êý¾Ý¿â¹ÜÀíϵͳµÄÔöÇ¿°æ¡£PostgreSQL ÔÚ±£³Ö POSTGRES
+ µÄÇ¿´óµÄÊý¾ÝÄ£ÐͺͷḻµÄÊý¾ÝÀàÐ͵Ļù´¡ÉÏ£¬ÓÃÒ»¸öÀ©Õ¹Á赀 SQL
+ ×Ó¼¯È¡´úÁËÔÏ鵀 PostQuel ²éѯÓïÑÔ¡£PostgreSQL
+ ÊÇ×ÔÓɵIJ¢ÇÒËùÓÐÔ´´úÂ붼¿ÉÒÔ»ñµÃ¡£
+
+ PostgreSQL µÄ¿ª·¢ÓÉ²Î¼Ó PostgreSQL
+ ¿ª·¢ÓʼþÁбíµÄÒ»¸ö¿ª·¢ÈËԱС×é½øÐС£Ä¿Ç°µÄе÷ÈËÊÇ Marc G. Fournier
+ £¨scrappy@postgreSQL.org
+ £©¡££¨¹ØÓÚÈçºÎ¼ÓÈë²Î¼û1.6½Ú£©¡£Õâ¸ö¶ÓÎéÏÖÔÚ¸ºÔð PostgreSQL
+ µÄËùÓпª·¢¡£
+
+ PostgreSQL 1.01 µÄ×÷ÕßÊÇ Andrew Yu ºÍ Jolly
+ Chen¡£»¹ÓÐÐí¶àÆäËûÈËΪÒÆÖ²£¬²âÊÔ£¬µ÷ÊÔºÍÔöÇ¿´úÂë×öÁË´óÁ¿¹±Ïס£PostgreS
+ QL µÄ×î³õÆðÔ´ Postgres£¬ÊÇÔÚ¼ÓÖÝ´óѧ²®¿ËÀû·ÖУµÄ Michael Stonebraker
+ ½ÌÊÚµÄÖ¸µ¼Ï£¬ÓÉÐí¶àÑо¿Éú£¬±¾¿ÆÉúºÍ±à³ÌÖ°Ô±Íê³ÉµÄ¡£
+
Õâ¸öÈí¼þ×î³õÔÚ²®¿ËÀûµÄÃû×ÖÊÇ Postgres¡£ÔÚ 1995 Ä꣬µ±Ôö¼ÓÁË SQL
- ¹¦ÄÜºó£¬ ËüµÄÃû×Ö¸Ä³É Postgres95¡£ÔÚ 1996ÄêÄ©£¬²Å¸ÄÃûΪ PostgreSQL¡£
- 1.2) PostgreSQL µÄ°æȨÊÇʲô? PostgreSQL ÊÜÏÂÃæµÄ°æȨԼÊø¡£ PostgreSQL
- Êý¾Ý¿â¹ÜÀíϵͳ £¨PostgreSQL Data Base Management System£©
- ²¿·Ö°æȨ£¨c£©1996-2002£¬PostgreSQL È«Çò¿ª·¢Ð¡×é ²¿·Ö°æȨ£¨c£©1994-6
- ¼ÓÖÝ´óѧ¶Ê £¨Portions copyright (c) 1996-2002, PostgreSQL Global
- Development Group Portions Copyright (c) 1994-6 Regents of the
- University of California£©
+ ¹¦Äܺó£¬ËüµÄÃû×Ö¸Ä³É Postgres95¡£ÔÚ 1996ÄêÄ©£¬²Å¸ÄÃûΪ PostgreSQL¡£
+
+ 1.2) PostgreSQL µÄ°æȨÊÇʲô?
+
+ PostgreSQL ÊÜÏÂÃæµÄ°æȨԼÊø¡£
+
+ PostgreSQL Êý¾Ý¿â¹ÜÀíϵͳ
+
+ £¨PostgreSQL Data Base Management System£©
+
+ ²¿·Ö°æȨ£¨c£©1996-2002£¬PostgreSQL È«Çò¿ª·¢Ð¡×é
+ ²¿·Ö°æȨ£¨c£©1994-6 ¼ÓÖÝ´óѧ¶ÊÂ
+
+ £¨Portions copyright (c) 1996-2002, PostgreSQL Global Development
+ Group
+ Portions Copyright (c) 1994-6 Regents of the University of
+ California£©
+
ÔÊÐíΪÈκÎÄ¿µÄʹÓ㬿½±´£¬Ð޸ĺͷַ¢Õâ¸öÈí¼þºÍËüµÄÎĵµ¶ø²»ÊÕÈ¡ÈκηÑÓÃ
- £¬
- ²¢ÇÒÎÞÐëÇ©ÊðÒò´Ë¶ø²úÉúµÄÖ¤Ã÷£¬Ç°ÌáÊÇÉÏÃæµÄ°æȨÉùÃ÷ºÍ±¾¶ÎÒÔ¼°ÏÂÃæÁ½¶ÎÎÄ
- ×Ö ³öÏÖÔÚËùÓп½±´ÖС£ £¨Permission to use, copy, modify, and
- distribute this software and its documentation for any purpose,
- without fee, and without a written agreement is hereby granted,
- provided that the above copyright notice and this paragraph and the
- following two paragraphs appear in all copies.£©
+ £¬²¢ÇÒÎÞÐëÇ©ÊðÒò´Ë¶ø²úÉúµÄÖ¤Ã÷£¬Ç°ÌáÊÇÉÏÃæµÄ°æȨÉùÃ÷ºÍ±¾¶ÎÒÔ¼°ÏÂÃæÁ½¶Î
+ ÎÄ×Ö³öÏÖÔÚËùÓп½±´ÖС£
+
+ £¨Permission to use, copy, modify, and distribute this software and
+ its documentation for any purpose, without fee, and without a written
+ agreement is hereby granted, provided that the above copyright notice
+ and this paragraph and the following two paragraphs appear in all
+ copies.£©
+
ÔÚÈκÎÇé¿öÏ£¬¼ÓÖÝ´óѧ¶¼²»³Ðµ£ÒòʹÓôËÈí¼þ¼°ÆäÎĵµ¶øµ¼ÖµĶÔÈκε±ÊÂÈË
- µÄ
- Ö±½ÓµÄ£¬¼ä½ÓµÄ£¬ÌØÊâµÄ£¬¸½¼ÓµÄ»òÕßÏà°é¶øÉúµÄË𻵣¬°üÀ¨ÀûÒæËðʧµÄÔðÈΣ¬
- ¼´ ʹ¼ÓÖÝ´óѧÒѾ½¨ÒéÁËÕâЩËðʧµÄ¿ÉÄÜÐÔʱҲÊÇÈç´Ë¡£ £¨IN NO EVENT SHALL
- THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT,
- INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
- LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
- DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED
- OF THE POSSIBILITY OF SUCH DAMAGE.£©
+ µÄÖ±½ÓµÄ£¬¼ä½ÓµÄ£¬ÌØÊâµÄ£¬¸½¼ÓµÄ»òÕßÏà°é¶øÉúµÄË𻵣¬°üÀ¨ÀûÒæËðʧµÄÔðÈÎ
+ £¬¼´Ê¹¼ÓÖÝ´óѧÒѾ½¨ÒéÁËÕâЩËðʧµÄ¿ÉÄÜÐÔʱҲÊÇÈç´Ë¡£
+
+ £¨IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY
+ PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+ DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS
+ SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA
+ HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.£©
+
¼ÓÖÝ´óѧÃ÷È··ÅÆúÈκα£Ö¤£¬°üÀ¨µ«²»¾ÖÏÞÓÚijһÌض¨ÓÃ;µÄÉÌÒµºÍÀûÒæµÄÒþº¬
- ±£
- Ö¤¡£ÕâÀïÌṩµÄÕâ·ÝÈí¼þÊÇ»ùÓÚ¡°µ±×÷ÊÇ¡±µÄ»ù´¡µÄ£¬Òò¶ø¼ÓÖÝ´óѧûÓÐÔðÈÎÌá
- ¹©Î¬ »¤£¬Ö§³Ö£¬¸üУ¬ÔöÇ¿»òÕßÐ޸ĵķþÎñ¡£ £¨THE UNIVERSITY OF
- CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
- BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE
- MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.£©
- ÉÏÃæ¾ÍÊÇ BSD °æȨÉùÃ÷£¬Ò»¸ö¾µäµÄ¿ªÔ´°æȨÉùÃ÷¡£Ëü¶ÔÔ´´úÂëµÄʹÓÃδ×÷ÈκÎ
- ÏÞÖÆ¡£ÎÒÃÇϲ»¶Ëü²¢ÇÒ²»´òËã¸Ä±äËü¡£ 1.3) PostgreSQL ÔËÐÐÔÚʲô Unix
- ƽ̨ÉÏ£¿ Ò»°ã˵À´£¬Ò»¸öÏÖ´úµÄ UNIX ¼æÈݵÄƽ̨¶¼ÄÜÔËÐÐ PostgreSQL
- ¡£ÔÚ°²×°Ö¸ÄÏÀïÁÐ ³öÁË·¢²¼Ê±¾¹ýÃ÷È·²âÊÔµÄƽ̨¡£ 1.4) ¿ÉÓÃµÄ·Ç Unix
- ƽ̨ÓÐÄÄЩ£¿ ¿Í»§¶Ë °Ñ libpq C
- ¿â£¬psql£¬ÆäËû½Ó¿ÚºÍ¿Í»§¶ËÓ¦ÓóÌÐò±àÒë³É¿ÉÒÔÔÚ MS Windows ƽ
- ̨ÉÏÔËÐÐÊÇ¿ÉÄܵġ£ÕâÖÖÇé¿öÏ£¬¿Í»§¶ËÔÚ MS Windows ÉÏÔËÐУ¬²¢ÇÒͨ¹ý
+ ±£Ö¤¡£ÕâÀïÌṩµÄÕâ·ÝÈí¼þÊÇ»ùÓÚ¡°µ±×÷ÊÇ¡±µÄ»ù´¡µÄ£¬Òò¶ø¼ÓÖÝ´óѧûÓÐÔðÈÎ
+ Ìṩά»¤£¬Ö§³Ö£¬¸üУ¬ÔöÇ¿»òÕßÐ޸ĵķþÎñ¡£
+
+ £¨THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+ PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+ CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+ UPDATES, ENHANCEMENTS, OR MODIFICATIONS.£©
+ ÉÏÃæ¾ÍÊÇ BSD °æȨÉùÃ÷£¬Ò»¸ö¾
+ µäµÄ¿ªÔ´°æȨÉùÃ÷¡£Ëü¶ÔÔ´´úÂëµÄʹÓÃδ×÷ÈκÎÏÞÖÆ¡£ÎÒÃÇϲ»¶Ëü²¢ÇÒ²»´òËã¸Ä
+ ±äËü¡£
+
+ 1.3) PostgreSQL ÔËÐÐÔÚʲô Unix ƽ̨ÉÏ£¿
+
+ Ò»°ã˵À´£¬Ò»¸öÏÖ´úµÄ UNIX ¼æÈݵÄƽ̨¶¼ÄÜÔËÐÐ PostgreSQL
+ ¡£ÔÚ°²×°Ö¸ÄÏÀïÁгöÁË·¢²¼Ê±¾¹ýÃ÷È·²âÊÔµÄƽ̨¡£
+
+ 1.4) ¿ÉÓÃµÄ·Ç Unix ƽ̨ÓÐÄÄЩ£¿
+
+ ¿Í»§¶Ë
+
+ °Ñ libpq C ¿â£¬psql£¬ÆäËû½Ó¿ÚºÍ¿Í»§¶ËÓ¦ÓóÌÐò±àÒë³É¿ÉÒÔÔÚ MS Windows
+ ƽ̨ÉÏÔËÐÐÊÇ¿ÉÄܵġ£ÕâÖÖÇé¿öÏ£¬¿Í»§¶ËÔÚ MS Windows ÉÏÔËÐУ¬²¢ÇÒͨ¹ý
TCP/IP ÓëÒ»¸öÔËÐÐÔÚÎÒÃÇÖ§³ÖµÄ Unix
- ƽ̨ÉϵķþÎñÆ÷½øÐÐͨѶ¡£·¢²¼°æ±¾Öаü º¬Ò»¸öÎļþ win32.mak ÓÃÓÚÉú³É
- Win32 libpq ¿âºÍ psql ¡£PostgreSQL Ò²¿ÉÒÔ ºÍ ODBC ¿Í»§¶ËͨѶ¡£ ·þÎñÆ÷
+ ƽ̨ÉϵķþÎñÆ÷½øÐÐͨѶ¡£·¢²¼°æ±¾Öаüº¬Ò»¸öÎļþ win32.mak ÓÃÓÚÉú³É
+ Win32 libpq ¿âºÍ psql ¡£PostgreSQL Ò²¿ÉÒÔºÍ ODBC ¿Í»§¶ËͨѶ¡£
+
+ ·þÎñÆ÷
+
Êý¾Ý¿â·þÎñÆ÷ÏÖÔÚ¿ÉÒÔͨ¹ý Cygwin £¬Cygnus µÄ Unix/NT ÒÆÖ²¿âÔÚ Windows
- NT ºÍ Win2k ÉÏÔËÐС£²ÎÔÄ·¢²¼°æ±¾ÀïµÄ See /pgsql/doc/FAQ_MSWIN/ Îļþ»ò
- http://www.PostgreSQL.org/docs/faq-mswin.html ¡£ ÒÆÖ²µ½ MS Win
- NT/2000/XP µÄ±¾»ú°æµÄ¹¤×÷ÕýÔÚ½øÐС£ 1.5) ÎÒ´ÓÄÄÀïÄܵõ½ PostgreSQL£¿
+ NT ºÍ Win2k ÉÏÔËÐС£²ÎÔÄ·¢²¼°æ±¾ÀïµÄ See pgsql/doc/FAQ_MSWIN Îļþ»ò
+ http://www.PostgreSQL.org/docs/faq-mswin.html ¡£
+
+ ÒÆÖ²µ½ MS Win NT/2000/XP µÄ±¾»ú°æµÄ¹¤×÷ÕýÔÚ½øÐС£
+
+ 1.5) ÎÒ´ÓÄÄÀïÄܵõ½ PostgreSQL£¿
+
PostgreSQL µÄÖ÷ÄäÃûFTPÕ¾µãÊÇ
- ftp://ftp.PostgreSQL.org/pub£¬¾µÏñÕ¾µã¿ÉÒÔ ²Î¿¼ÎÒÃÇÍøÕ¾µÄÖ÷Ò³¡£ 1.6)
- ÎÒ´ÓÄÄÀïÄܵõ½¶Ô PostgreSQL µÄÖ§³Ö£¿
- Ö÷ÒªµÄÓʼþÁбíÊÇ£ºpgsql-general@postgreSQL.org ¡£¿ÉÒÔÔÚÄÇÀïÌÖÂÛÓйØ
- PostgreSQL µÄ ÎÊÌâ¡£Òª¼ÓÈëÁÐ±í£¬·¢Ò»·âÓʼþÄÚÈÝ£¨²»ÊÇÖ÷ÌâÐУ©Îª
- subscribe end µÄÓʼþµ½ pgsql-general-request@postgreSQL.org ¡£
- »¹¿ÉÒÔ»ñÈ¡ÕªÒªÁÐ±í¡£Òª¼ÓÈëÕâ¸öÁÐ±í£¬·¢Óʼþµ½£ºpgsql-general-digest-
- request@postgreSQL.org £¬ÆäÄÚÈÝΪ£º subscribe end ÿµ±Ö÷Áбí´ïµ½´óÔ¼
- 30k µÄÏûÏ¢ÄÚÈÝʱ£¬ÕªÒª¾Í·¢Ë͸øÕâ¸öÁбíµÄ³ÉÔ±¡£
+ ftp://ftp.PostgreSQL.org/pub£¬¾µÏñÕ¾µã¿ÉÒԲο¼ÎÒÃÇÍøÕ¾µÄÖ÷Ò³¡£
+
+ 1.6) ÎÒ´ÓÄÄÀïÄܵõ½¶Ô PostgreSQL µÄÖ§³Ö£¿
+
+ Ö÷ÒªµÄÓʼþÁбíÊÇ£ºpgsql-general@postgreSQL.org¡£¿ÉÒÔÔÚÄÇÀïÌÖÂÛÓйØ
+ PostgreSQL µÄÎÊÌâ¡£Òª¼ÓÈëÁÐ±í£¬·¢Ò»·âÓʼþÄÚÈÝ£¨²»ÊÇÖ÷ÌâÐУ©Îª
+ subscribe
+ end
+
+ µÄÓʼþµ½ pgsql-general-request@postgreSQL.org ¡£
+
+ »¹¿ÉÒÔ»ñÈ¡ÕªÒªÁÐ±í¡£Òª¼ÓÈëÕâ¸öÁÐ±í£¬·¢Óʼþµ½£ºpgsql-general-digest-req
+ uest@postgreSQL.org£¬ÆäÄÚÈÝΪ£º
+ subscribe
+ end
+
+ ÿµ±Ö÷Áбí´ïµ½´óÔ¼ 30k µÄÏûÏ¢ÄÚÈÝʱ£¬ÕªÒª¾Í·¢Ë͸øÕâ¸öÁбíµÄ³ÉÔ±¡£
+
»¹¿ÉÒԲμӳô³æÓʼþÁÐ±í¡£Òª¼ÓÈëÕâ¸öÁÐ±í£¬·¢ËÍÒ»¸öÓʼþµ½
- bugs-request@postgreSQL.org £¬ÄÚÈÝΪ£º subscribe end
+ bugs-request@postgreSQL.org£¬ÄÚÈÝΪ£º
+ subscribe
+ end
+
»¹¿ÉÒԲμӿª·¢ÈËÔ±ÓʼþÁÐ±í¡£Òª¼ÓÈëÕâ¸öÁÐ±í£¬·¢ËÍÒ»¸öÓʼþµ½
- hackers-request@postgreSQL.org £¬ ÄÚÈÝΪ£º subscribe end ÆäËûµÄ¹ØÓÚ
- PostgreSQL ÓʼþÁбíºÍÆäËûÐÅÏ¢¿ÉÒÔÔÚ PostgreSQL µÄ WWW Ö÷Ò³ÕÒµ½£º
- http://postgresql.org/ ÔÚ EFNet ÀﻹÓÐÒ»¸ö IRC ƵµÀ£¬ÆµµÀ
- #PostgreSQL¡£ÎÒÓà unix ÃüÁîirc -c '#PostgreSQL' "$USER"
- irc.phoenix.net ÉÌÒµÖ§³Ö¹«Ë¾µÄÁбíÔÚ
- http://www.PostgreSQL.org/users-lounge/commercial-support.html ¡£ 1.7)
- PostgreSQL ×îеİ汾ÊÇʲô£¿ PostgreSQL ×îеİ汾ÊÇ°æ±¾
- 7.2.3¡££¨Òë×¢£ºÏÖÔÚÓ¦¸ÃÊÇ 7.3.1 ÁË¡££©
- ÎÒÃǼƻ®Ã¿ËĸöÔ·¢²¼Ò»¸öÖ÷Òª°æ±¾¡£ 1.8) ÓÐÄÄЩ¿ÉÓÃµÄ PostgreSQL
- µÄÎĵµ£¿ ÔÚ·¢²¼°üÀïÓÐһЩÊֲᣬÊÖ²áÒ³ºÍһЩСµÄ²âÊÔÀý×Ó¡£²Î¼û /doc
- Ŀ¼¡££¨Òë×¢£º ӦΪ $PGHOME/doc£©¡£Ä㻹¿ÉÒÔÔÚÏßä¯ÀÀ PostgreSQL
- µÄÊֲᣬÔÚ http://www.PostgreSQL.org/users-lounge/docs/ ¡£ ÓÐÁ½±¾¹ØÓÚ
- PostgreSQL µÄÊéÔÚÏßÌṩ£¬ÔÚ http://www.PostgreSQL.org/docs/awbook.html
- www.PostgreSQL.org/docs/awbook.html> ºÍ
- http://www.commandprompt.com/ppbook/ www.commandprompt.com/ppbook/>
- ¡£ÔÚ http://www.ca.PostgreSQL.org/books/ www.ca.PostgreSQL.org/books/>
- ÉÏÓйØÓÚ PostgreSQL µÄ¿É¹ºÊé¼®µÄÁÐ ±í¡£ÔÚ
- http://techdocs.PostgreSQL.org/ techdocs.PostgreSQL.org/> ÉÏÊÕ¼¯ÁËÓйØ
- PostgreSQL µÄ¼¼ÊõÎÄÕ¡£ /psql/ ÓÐһЩ²»´íµÄ \d
- ÃüÁÏÔʾ¹ØÓÚÀàÐÍ£¬²Ù×÷·û£¬º¯Êý£¬¾Û¼¯µÈµÄÐÅÏ¢¡£ ÎÒÃÇµÄ web
- Õ¾µã°üº¬¸ü¶àµÄÎĵµ£® 1.9) ÎÒÈçºÎÁ˽âÒÑÖªµÄ BUG ºÍȱʧµÄÌØÐÔ£¿
+ hackers-request@postgreSQL.org£¬ÄÚÈÝΪ£º
+ subscribe
+ end
+
+ ÆäËûµÄ¹ØÓÚ PostgreSQL ÓʼþÁбíºÍÆäËûÐÅÏ¢¿ÉÒÔÔÚ PostgreSQL µÄ WWW
+ Ö÷Ò³ÕÒµ½£º
+
+ http://postgresql.org/
+
+ ÔÚ EFNet ÀﻹÓÐÒ»¸ö IRC ƵµÀ£¬ÆµµÀ #PostgreSQL¡£ÎÒÓà unix ÃüÁîirc -c
+ '#PostgreSQL' "$USER" irc.phoenix.net
+
+ ÉÌÒµÖ§³Ö¹«Ë¾µÄÁбíÔÚ
+ http://www.PostgreSQL.org/users-lounge/commercial-support.html ¡£
+
+ 1.7) PostgreSQL ×îеİ汾ÊÇʲô£¿
+
+ PostgreSQL ×îеİ汾ÊÇ°æ±¾ 7.2.3¡££¨Òë×¢£ºÏÖÔÚÓ¦¸ÃÊÇ 7.3.1 ÁË¡££©
+
+ ÎÒÃǼƻ®Ã¿ËĸöÔ·¢²¼Ò»¸öÖ÷Òª°æ±¾¡£
+
+ 1.8) ÓÐÄÄЩ¿ÉÓÃµÄ PostgreSQL µÄÎĵµ£¿
+
+ ÔÚ·¢²¼°üÀïÓÐһЩÊֲᣬÊÖ²áÒ³ºÍһЩСµÄ²âÊÔÀý×Ó¡£²Î¼û /doc
+ Ŀ¼¡££¨Òë×¢£ºÓ¦Îª $PGHOME/doc£©¡£Ä㻹¿ÉÒÔÔÚÏßä¯ÀÀ PostgreSQL
+ µÄÊֲᣬÔÚ http://www.PostgreSQL.org/users-lounge/docs/ ¡£
+
+ ÓÐÁ½±¾¹ØÓÚ PostgreSQL µÄÊéÔÚÏßÌṩ£¬ÔÚ
+ http://www.PostgreSQL.org/docs/awbook.html ºÍ
+ http://www.commandprompt.com/ppbook/ ¡£ÔÚ
+ http://www.ca.PostgreSQL.org/books/ ÉÏÓйØÓÚ PostgreSQL
+ µÄ¿É¹ºÊé¼®µÄÁÐ±í¡£ÔÚ http://techdocs.PostgreSQL.org/ ÉÏÊÕ¼¯ÁËÓйØ
+ PostgreSQL µÄ¼¼ÊõÎÄÕ¡£
+
+ psql ÓÐһЩ²»´íµÄ \d ÃüÁÏÔʾ¹ØÓÚÀàÐÍ£¬²Ù×÷·û£¬º¯Êý£¬¾Û¼¯µÈµÄÐÅÏ¢¡£
+
+ ÎÒÃÇµÄ web Õ¾µã°üº¬¸ü¶àµÄÎĵµ£®
+
+ 1.9) ÎÒÈçºÎÁ˽âÒÑÖªµÄ BUG ºÍȱʧµÄÌØÐÔ£¿
+
PostgreSQL Ö§³ÖÒ»¸öÀ©Õ¹Á赀 SQL-92 µÄ×Ó¼¯¡£²ÎÔÄÎÒÃÇµÄ TODO
- www.postgresql.org/docs/todo.html>
- www.postgresql.org/docs/todo.html>ÁÐ±í£¬»ñÈ¡Ò»¸öÒÑÖª³ô³æ£¬È±Ê§ÌØ
- ÐÔºÍδÀ´¼Æ»®¡£ 1.10) ÎÒÓ¦¸ÃÔõÑùѧϰ SQL£¿ ÔÚ
- http://www.postgresql.org/docs/awbook.html µÄ¹ØÓÚ PostgreSQL µÄÊé½ÌÊÚ
- SQL¡££¨Òë×¢£ºÎÒÏÂÔص½±¾µØÁË¡££©ÔÚ http://www.commandprompt.com/ppbook
- www.commandprompt.com/ppbook/> ÓÐÁíÍâÒ»±¾¹ØÓÚ PostgreSQL µÄÊé¡£
- ÔÚhttp://www.intermedia.net/support/sql/sqltut.shtm£¬http:
- //ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM
- ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM> ºÍ
- http://sqlcourse.com sqlcourse.com/> ÓÐÒ»¸ö²»´íµÄÈëÃŽ̡̳£ ÁíÒ»¸öÊÇ
- "Teach Yourself SQL in 21 Days, Second Edition"£¨21Ììѧ»áSQL£¬
- µÚ¶þ°æ£©£¬ÔÚ http://members.tripod.com/er4ebus/sql/index.htm
- members.tripod.com/er4ebus/sql/index.htm> ÎÒÃǵÄÐí¶àÓû§Ï²»¶ /The
- Practical SQL Handbook, Bowman, Judith S., et al., Addison-Wesley ¡£ /
- ÆäËûµÄÓÐ/ The Complete Reference SQL, Groff et al., McGraw-Hill ¡£/
- 1.11) PostgreSQL ÊÇ Y2K ¼æÈݵÄÂ𣿠ÊÇ£¬ÎÒÃǺÜÈÝÒ׿ØÖÆ 2000 AD Ö®ºóºÍ
- 2000 BC ֮ǰµÄÈÕÆÚ¡£ 1.12) ÎÒÓ¦¸ÃÔõÑù¼ÓÈ뿪·¢¶ÓÎ飿
+ ÁÐ±í£¬»ñÈ¡Ò»¸öÒÑÖª³ô³æ£¬È±Ê§ÌØÐÔºÍδÀ´¼Æ»®¡£
+
+ 1.10) ÎÒÓ¦¸ÃÔõÑùѧϰ SQL£¿
+
+ ÔÚ http://www.postgresql.org/docs/awbook.html µÄ¹ØÓÚ PostgreSQL
+ µÄÊé½ÌÊÚ SQL¡££¨Òë×¢£ºÎÒÏÂÔص½±¾µØÁË¡££©ÔÚ
+ http://www.commandprompt.com/ppbook ÓÐÁíÍâÒ»±¾¹ØÓÚ PostgreSQL
+ µÄÊé¡£ÔÚhttp://www.intermedia.net/support/sql/sqltut.shtm£¬http://ourw
+ orld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM ºÍ
+ http://sqlcourse.com ÓÐÒ»¸ö²»´íµÄÈëÃŽ̡̳£
+
+ ÁíÒ»¸öÊÇ "Teach Yourself SQL in 21 Days, Second
+ Edition"£¨21Ììѧ»áSQL£¬µÚ¶þ°æ£©£¬ÔÚ
+ http://members.tripod.com/er4ebus/sql/index.htm
+
+ ÎÒÃǵÄÐí¶àÓû§Ï²»¶ The Practical SQL Handbook, Bowman, Judith S., et
+ al., Addison-Wesley ¡£ ÆäËûµÄÓÐ The Complete Reference SQL, Groff et
+ al., McGraw-Hill ¡£
+
+ 1.11) PostgreSQL ÊÇ Y2K ¼æÈݵÄÂð£¿
+
+ ÊÇ£¬ÎÒÃǺÜÈÝÒ׿ØÖÆ 2000 AD Ö®ºóºÍ 2000 BC ֮ǰµÄÈÕÆÚ¡£
+
+ 1.12) ÎÒÓ¦¸ÃÔõÑù¼ÓÈ뿪·¢¶ÓÎ飿
+
Ê×ÏÈ£¬ÏÂÔØ×îеÄÔ´´úÂë²¢ÔĶÁÎÒÃÇ web Õ¾µã»ò·¢²¼°üÖÐµÄ PostgreSQL
- ¿ª·¢Õß Îĵµ¡£Æä´Î£¬¼ÓÈë pgsql-hackers ºÍ pgsql-patches
+ ¿ª·¢ÕßÎĵµ¡£Æä´Î£¬¼ÓÈë pgsql-hackers ºÍ pgsql-patches
ÓʼþÁÐ±í¡£µÚÈý£¬Ïò pgsql-patches Ìá½»¸ßÖÊÁ¿µÄ²¹¶¡³ÌÐò¡£
+
ÏÖÔÚ´ó¸ÅÓÐÊ®¼¸¸öÈËÓÐ PostgreSQL CVS ¹éµµ COMMIT µÄȨÏÞ¡£ËûÃǶ¼ÒѾ
- Ìá½»ÁË
- ·Ç³£¶à¸ßÖÊÁ¿µÄ²¹¶¡ÁË£¬ÒÔÖÁÓÚÏÖÓеÄÌá½»È˺ÜÄѸúÉϽÚ×࣬²¢ÇÒÎÒÃÇÏàÐÅËûÃÇ
- Ìá ½»µÄ²¹¶¡¶¼ÊǸßÖÊÁ¿µÄ¡£ 1.13) ÎÒÓ¦¸ÃÔõÑùÌá½»Ò»¸öBUG±¨¸æ£¿ Çë·ÃÎÊ
- http://www.PostgreSQL.org/bugs/bugs.php µÄ PostgreSQL BugTool Ò³ Ãæ,
- ÄÇÀï¸ø³öÁËÈçºÎÌá½»Ò»¸öBUG±¨¸æµÄÖ¸ÄÏ¡£ ͬÑùÒ²Òª¿´¿´ÎÒÃÇµÄ ftp Õ¾µã
- ftp://ftp.postgreSQL.org/pub ftp.postgresql.org/pub>£¬¿´ÓÐûÓиüеÄ
- PostgreSQL °æ±¾»ò²¹¶¡¡£ 1.14) PostgreSQL ºÍÆäËû DBMS ±ÈÆðÀ´ÈçºÎ£¿
- ÆÀ¼ÛÈí¼þÓкü¸ÖÖ·½·¨£ºÌØÐÔ£¬ÐÔÄÜ£¬¿É¿¿ÐÔ£¬Ö§³ÖºÍ¼Û¸ñ¡£ *ÌØÐÔ*
- PostgreSQL ÓµÓдóÐÍÉÌÓà DBMS Àï´ó¶àÊýÌØÐÔ£¬ÀýÈ磺ÊÂÎñ£¬×Ó²éѯ£¬´¥·¢
- Æ÷£¬ÊÓͼ£¬Íâ¼ü²Î¿¼ÍêÕûÐԺ͸´ÔÓµÄËøµÈ¡£ÎÒÃÇ»¹ÓÐһЩËüÃÇûÓеÄÌØÐÔ£¬Èç
- Óû§¶¨ÒåÀàÐÍ£¬¼Ì³Ð£¬¹æÔòºÍ¶à°æ±¾²¢ÐпØÖÆÒÔ¼õÉÙËøµÄÕùÓõȡ£ *ÐÔÄÜ*
- PostgreSQL ºÍÆäËûÉÌÓúͿªÔ´µÄÊý¾Ý¿â¾ßÓÐÀàËƵÄÐÔÄÜ¡£¶ÔijЩ´¦ÀíËü±È½Ï
- ¿ì£¬¶ÔÆäËûһЩ´¦ÀíËü±È½ÏÂý¡£Óë MySQL »ò¸üÇá±ãµÄÊý¾Ý¿âϵͳ±È½Ï£¬ÎÒÃÇ ÔÚ
- insert/update ʱÂý£¬ÒòΪÎÒÃÇÓÐÊÂÎñ´¦Àí¡£µ±È» MySQL ²»¾ßÓÐÎÒÃÇÔÚÉÏ
- ÃæµÄ/ÌØÐÔ /¶ÎÀï¸ø³öµÄÈκÎÌØÐÔ¡£ÎÒÃǵÄÖ÷Òª·½ÏòÊÇ¿É¿¿ÐÔºÍÌØÐÔ£¬¾¡¹ÜÎÒ
- ÃÇÔÚÿ´Î·¢²¼Ê±²»¶ÏµØ¸Ä½øÐÔÄÜ¡£ÓÐÒ»¸öºÜÓÐȤµÄÍøÒ³±È½ÏÁË PostgreSQL ºÍ
- MySQL http://openacs.org/why-not-mysql.html¡£ *¿É¿¿ÐÔ* ÎÒÃÇÖªµÀ DBMS
- ±ØÐëÊÇ¿É¿¿µÄ£¬·ñÔòËü¾ÍÒ»µãÓö¼Ã»ÓС£ÎÒÃÇŬÁ¦×öµ½·¢²¼¾
- ¹ýÈÏÕæ²âÊԵģ¬Îȶ¨µÄ³ô³æ×îÉٵĴúÂ롣ÿ¸ö°æ±¾ÖÁÉÙÓÐÒ»¸öÔ嵀 beta ²â
- ÊÔ£¬²¢ÇÒÎÒÃǵķ¢²¼ÀúÊ·ÏÔʾÎÒÃÇ¿ÉÒÔÌṩÎȶ¨µÄ£¬Àι̵ģ¬¿ÉÓÃÓÚÉú²úʹÓÃ
- µÄ°æ±¾¡£ÎÒÃÇÏàÐÅÔÚÕâ·½ÃæÎÒÃÇÓëÆäËûµÄÊý¾Ý¿âÈí¼þÊÇÏ൱µÄ¡£ *Ö§³Ö*
- ÎÒÃǵÄÓʼþÁбíÌṩһ¸ö·Ç³£´óµÄ¿ª·¢ÈËÔ±ºÍÓû§µÄ×éÒÔ°ïÖú½â¾öËùÅöµ½µÄÈÎ
- ºÎÎÊÌâ¡£ÎÒÃDz»Äܱ£Ö¤¿Ï¶¨Äܽâ¾öÎÊÌ⣬Ïà±È֮ϣ¬ÉÌÓà DBMS Ò²²¢²»ÊÇ×ÜÄÜ
- ¹»Ìṩ½â¾ö·½·¨¡£Ö±½ÓÓ뿪·¢ÈËÔ±£¬Óû§Èº£¬ÊÖ²áºÍÔ´³ÌÐò½Ó´¥Áî PostgreSQL
- µÄÖ§³Ö±ÈÆäËû DBMS »¹ÒªºÃ¡£»¹ÓÐһЩÉÌÒµÐÔµÄÔ¤°ü×°µÄÖ§³Ö£¬
- ¿ÉÒÔ¸øÌṩ¸øÄÇЩÐèÒªµÄÈË¡££¨²ÎÔÄÖ§³Ö FAQ Ìõ¿î 1.6 С½Ú¡££© *¼Û¸ñ*
- ÎÒÃǶÔÈκÎÓÃ;¶¼Ãâ·Ñ£¬°üÀ¨ÉÌÓúͷÇÉÌÓÃÄ¿µÄ¡£Äã¿ÉÒÔ²»¼ÓÏÞÖƵØÏòÄãµÄ²ú
- Æ·Àï¼ÓÈëÎÒÃǵĴúÂ룬³ýÁËÄÇЩÎÒÃÇÔÚÉÏÃæµÄ°æȨÉùÃ÷ÀïÉùÃ÷µÄ BSD ·ç¸ñµÄ
- °æȨÍâ¡£ 1.15) ÎÒÓ¦¸ÃÔõÑùÔÞÖú PostgreSQL £¿ ×Ô´Ó1996Ä꿪ʼ£¬PostgreSQL
- ÒѾÓÐÁËÒ»¸öÓÅÐãµÄ×éÖ¯¡£ÕâЩӦ¸Ã¹é¹¦ÓÚ Marc
+ Ìá½»Á˷dz£¶à¸ßÖÊÁ¿µÄ²¹¶¡ÁË£¬ÒÔÖÁÓÚÏÖÓеÄÌá½»È˺ÜÄѸúÉϽÚ×࣬²¢ÇÒÎÒÃÇÏà
+ ÐÅËûÃÇÌá½»µÄ²¹¶¡¶¼ÊǸßÖÊÁ¿µÄ¡£
+
+ 1.13) ÎÒÓ¦¸ÃÔõÑùÌá½»Ò»¸öBUG±¨¸æ£¿
+
+ Çë·ÃÎÊ http://www.PostgreSQL.org/bugs/bugs.php µÄ PostgreSQL BugTool
+ Ò³Ãæ, ÄÇÀï¸ø³öÁËÈçºÎÌá½»Ò»¸öBUG±¨¸æµÄÖ¸ÄÏ¡£
+
+ ͬÑùÒ²Òª¿´¿´ÎÒÃÇµÄ ftp Õ¾µã
+ ftp://ftp.postgreSQL.org/pub£¬¿´ÓÐûÓиüÐ嵀 PostgreSQL °æ±¾»ò²¹¶¡¡£
+
+ 1.14) PostgreSQL ºÍÆäËû DBMS ±ÈÆðÀ´ÈçºÎ£¿
+
+ ÆÀ¼ÛÈí¼þÓкü¸ÖÖ·½·¨£ºÌØÐÔ£¬ÐÔÄÜ£¬¿É¿¿ÐÔ£¬Ö§³ÖºÍ¼Û¸ñ¡£
+
+ ÌØÐÔ
+ PostgreSQL ÓµÓдóÐÍÉÌÓà DBMS
+ Àï´ó¶àÊýÌØÐÔ£¬ÀýÈ磺ÊÂÎñ£¬×Ó²éѯ£¬´¥·¢Æ÷£¬ÊÓͼ£¬Íâ¼ü²Î¿¼ÍêÕûÐÔº
+ ͸´ÔÓµÄËøµÈ¡£ÎÒÃÇ»¹ÓÐһЩËüÃÇûÓеÄÌØÐÔ£¬ÈçÓû§¶¨ÒåÀàÐÍ£¬¼Ì³Ð£¬
+ ¹æÔòºÍ¶à°æ±¾²¢ÐпØÖÆÒÔ¼õÉÙËøµÄÕùÓõȡ£
+
+
+ ÐÔÄÜ
+ PostgreSQL
+ ºÍÆäËûÉÌÓúͿªÔ´µÄÊý¾Ý¿â¾ßÓÐÀàËƵÄÐÔÄÜ¡£¶ÔijЩ´¦ÀíËü±È½Ï¿ì£¬¶ÔÆ
+ äËûһЩ´¦ÀíËü±È½ÏÂý¡£Óë MySQL »ò¸üÇá±ãµÄÊý¾Ý¿âϵͳ±È½Ï£¬ÎÒÃÇÔÚ
+ insert/update ʱÂý£¬ÒòΪÎÒÃÇÓÐÊÂÎñ´¦Àí¡£µ±È» MySQL
+ ²»¾ßÓÐÎÒÃÇÔÚÉÏÃæµÄÌØÐÔ
+ ¶ÎÀï¸ø³öµÄÈκÎÌØÐÔ¡£ÎÒÃǵÄÖ÷Òª·½ÏòÊÇ¿É¿¿ÐÔºÍÌØÐÔ£¬¾¡¹ÜÎÒÃÇÔÚÿ´
+ η¢²¼Ê±²»¶ÏµØ¸Ä½øÐÔÄÜ¡£ÓÐÒ»¸öºÜÓÐȤµÄÍøÒ³±È½ÏÁË PostgreSQL ºÍ
+ MySQL http://openacs.org/why-not-mysql.html¡£
+
+ ¿É¿¿ÐÔ
+ ÎÒÃÇÖªµÀ DBMS
+ ±ØÐëÊÇ¿É¿¿µÄ£¬·ñÔòËü¾ÍÒ»µãÓö¼Ã»ÓС£ÎÒÃÇŬÁ¦×öµ½·¢²¼¾
+ ¹ýÈÏÕæ²âÊԵģ¬Îȶ¨µÄ³ô³æ×îÉٵĴúÂ롣ÿ¸ö°æ±¾ÖÁÉÙÓÐÒ»¸öÔ嵀 beta
+ ²âÊÔ£¬²¢ÇÒÎÒÃǵķ¢²¼ÀúÊ·ÏÔʾÎÒÃÇ¿ÉÒÔÌṩÎȶ¨µÄ£¬Àι̵ģ¬¿ÉÓÃÓÚÉ
+ ú²úʹÓõİ汾¡£ÎÒÃÇÏàÐÅÔÚÕâ·½ÃæÎÒÃÇÓëÆäËûµÄÊý¾Ý¿âÈí¼þÊÇÏ൱µÄ¡£
+
+
+ Ö§³Ö
+ ÎÒÃǵÄÓʼþÁбíÌṩһ¸ö·Ç³£´óµÄ¿ª·¢ÈËÔ±ºÍÓû§µÄ×éÒÔ°ïÖú½â¾öËùÅöµ
+ ½µÄÈκÎÎÊÌâ¡£ÎÒÃDz»Äܱ£Ö¤¿Ï¶¨Äܽâ¾öÎÊÌ⣬Ïà±È֮ϣ¬ÉÌÓà DBMS
+ Ò²²¢²»ÊÇ×ÜÄܹ»Ìṩ½â¾ö·½·¨¡£Ö±½ÓÓ뿪·¢ÈËÔ±£¬Óû§Èº£¬ÊÖ²áºÍÔ´³ÌÐ
+ ò½Ó´¥Áî PostgreSQL µÄÖ§³Ö±ÈÆäËû DBMS
+ »¹ÒªºÃ¡£»¹ÓÐһЩÉÌÒµÐÔµÄÔ¤°ü×°µÄÖ§³Ö£¬¿ÉÒÔ¸øÌṩ¸øÄÇЩÐèÒªµÄÈË¡
+ ££¨²ÎÔÄÖ§³Ö FAQ Ìõ¿î 1.6 С½Ú¡££©
+
+
+ ¼Û¸ñ
+ ÎÒÃǶÔÈκÎÓÃ;¶¼Ãâ·Ñ£¬°üÀ¨ÉÌÓúͷÇÉÌÓÃÄ¿µÄ¡£Äã¿ÉÒÔ²»¼ÓÏÞÖƵØÏòÄ
+ ãµÄ²úÆ·Àï¼ÓÈëÎÒÃǵĴúÂ룬³ýÁËÄÇЩÎÒÃÇÔÚÉÏÃæµÄ°æȨÉùÃ÷ÀïÉùÃ÷µÄ
+ BSD ·ç¸ñµÄ°æȨÍâ¡£
+
+ 1.15) ÎÒÓ¦¸ÃÔõÑùÔÞÖú PostgreSQL £¿
+
+ ×Ô´Ó1996Ä꿪ʼ£¬PostgreSQL ÒѾÓÐÁËÒ»¸öÓÅÐãµÄ×éÖ¯¡£ÕâЩӦ¸Ã¹é¹¦ÓÚ Marc
Fournier£¬ÊÇËû´´½¨Á˲¢ÔÚÕâЩÄêÒ»Ö±¹ÜÀíÕâ¸ö×éÖ¯¡£
+
¶ÔÓÚÒ»¸ö¿ªÔ´ÏîÄ¿À´Ëµ£¬ÖÊÁ¿»ù´¡ÉèÊ©ÊǷdz£ÖØÒªµÄ¡£ËüÄÜ·ÀÖ¹³öÏÖÑÏÖØÑÓ³ÙÏî
- Ä¿ Ç°½øµÄ»ìÂÒ¡£
+ Ä¿Ç°½øµÄ»ìÂÒ¡£
+
ÏÔÈ»£¬Õâ¸ö×éÖ¯µÄÔËת³É±¾²»·Æ¡£Î¬³ÖÆäÇ°½øÓи÷ÖÖÔ¶ȵġ¢Ò»´ÎÐԵĿªÖ§¡£Èç
- ¹û Äã»òÕßÄãµÄ¹«Ë¾ÄܽøÐоèÔùÒÔÖ§³ÖÕâÏîÊÂÒµ£¬Çë·ÃÎÊ
- http://store.pgsql.com/shopping/ store.pgsql.com/shopping/> ½øÐÐ
- ¾èÔù¡£ ËäÈ»¸ÃÍøÒ³Ìá¼°ÁË PostgreSQL ¹«Ë¾£¬ÕâЩ¾èÔù½«½öÓÃÓÚÖ§³Ö
- PostgreSQL ÏîÄ¿£¬
- ²¢²»»áÓÃÓÚ×ÊÖúû¸öÌض¨µÄ¹«Ë¾¡£Èç¹ûÄãÔ¸Ò⣬Ҳ¿ÉÒÔÓʼÄ֧Ʊµ½ÁªÏµµØÖ·¡£
- ----------------------------------------------------------------------
- -- Óû§¿Í»§¶ËÎÊÌâ 2.1) ÓÐ PostgreSQL µÄ ODBC Çý¶¯Ã´£¿ ÓÐÁ½¸ö ODBC
- Çý¶¯¿ÉÒÔ»ñµÃ£¬PsqlODBC ºÍ OpenLink ODBC.
+ ¹ûÄã»òÕßÄãµÄ¹«Ë¾ÄܽøÐоèÔùÒÔÖ§³ÖÕâÏîÊÂÒµ£¬Çë·ÃÎÊ
+ http://store.pgsql.com/shopping/ ½øÐоèÔù¡£
+
+ ËäÈ»¸ÃÍøÒ³Ìá¼°ÁË PostgreSQL ¹«Ë¾£¬ÕâЩ¾èÔù½«½öÓÃÓÚÖ§³Ö PostgreSQL
+ ÏîÄ¿£¬²¢²»»áÓÃÓÚ×ÊÖúû¸öÌض¨µÄ¹«Ë¾¡£Èç¹ûÄãÔ¸Ò⣬Ҳ¿ÉÒÔÓʼÄ֧Ʊµ½ÁªÏµµØ
+ Ö·¡£
+ _________________________________________________________________
+
+ Óû§¿Í»§¶ËÎÊÌâ
+
+ 2.1) ÓÐ PostgreSQL µÄ ODBC Çý¶¯Ã´£¿
+
+ ÓÐÁ½¸ö ODBC Çý¶¯¿ÉÒÔ»ñµÃ£¬PsqlODBC ºÍ OpenLink ODBC.
+
¿ÉÒÔÔÚhttp://gborg.postgresql.org/project/psqlodbc/projdisplay.php
- ÏÂÔØ PsqlODBC ¡£ OpenLink ODBC ¿ÉÒÔ´Ó http://www.openlinksw.com/
- »ñµÃ¡£ËüÓëËûÃǵıê×¼ ODBC
- ¿Í»§¶ËÈí¼þ¼æÈÝ£¬Òò¶øÄã¿ÉÒÔÔÚÈκÎËûÃÇÖ§³ÖµÄ¿Í»§¶Ëƽ̨£¨Win, Mac, Unix,
- VMS£©ÉÏʹÓà PostgreSQL ODBC¡£
+ ÏÂÔØ PsqlODBC ¡£
+
+ OpenLink ODBC ¿ÉÒÔ´Ó http://www.openlinksw.com/ »ñµÃ¡£ËüÓëËûÃǵıê×¼
+ ODBC ¿Í»§¶ËÈí¼þ¼æÈÝ£¬Òò¶øÄã¿ÉÒÔÔÚÈκÎËûÃÇÖ§³ÖµÄ¿Í»§¶Ëƽ̨£¨Win, Mac,
+ Unix, VMS£©ÉÏʹÓà PostgreSQL ODBC¡£
+
ËûÃÇ¿ÉÄܽ«Õâ¸ö²úÆ·ÏúÊÛ¸øÄÇЩÐèÒªÉÌÒµÖ§³ÖµÄÓû§£¬µ«ÊÇ×ÜÊÇÓÐÒ»¸ö
- freeware £¨×ÔÓÉÈí¼þ£©µÄ°æ±¾¿ÉÒԵõ½¡£ÇëѯÎÊ postgres95@openlink.co.uk
- ¡£ 2.2) ÓÐʲô¹¤¾ß¿ÉÒÔ°Ñ PostgreSQL ÓÃÓÚ Web Ò³Ã棿
+ freeware £¨×ÔÓÉÈí¼þ£©µÄ°æ±¾¿ÉÒԵõ½¡£ÇëѯÎÊ
+ postgres95@openlink.co.uk¡£
+
+ 2.2) ÓÐʲô¹¤¾ß¿ÉÒÔ°Ñ PostgreSQL ÓÃÓÚ Web Ò³Ã棿
+
Ò»¸ö½éÉÜÒÔÊý¾Ý¿âΪºǫ́µÄͦ²»´íµÄ Õ¾µãÊÇ£ºhttp://www.webreview.com ¡£
+
¶ÔÓÚ Web ¼¯³É£¬PHP ÊÇÒ»¸ö¼«ºÃµÄ½Ó¿Ú¡£ËüÔÚ£ºhttp://www.php.net/ ¡£
- ¶ÔÓÚ¸´ÔÓµÄÈÎÎñ£¬ºÜ¶àÈ˲ÉÓà Perl ½Ó¿ÚºÍ CGI.pm »ò mod_perl ¡£ 2.3)
- PostgreSQL ÓµÓÐͼÐÎÓû§½çÃæÂ𣿠Êǵġ£Óм¸¸öÊÊÓÃÓÚ PostgreSQL
- µÄͼÐνӿڡ£°üÀ¨PgAccess£¨http: //www.pgaccess.com)£¬PgAdmin II
- £¨http://www.pgadmin.org£¬½öÊÊÓÃÓÚ Win32£©£¬ RHDB Admin
+
+ ¶ÔÓÚ¸´ÔÓµÄÈÎÎñ£¬ºÜ¶àÈ˲ÉÓà Perl ½Ó¿ÚºÍ CGI.pm »ò mod_perl ¡£
+
+ 2.3) PostgreSQL ÓµÓÐͼÐÎÓû§½çÃæÂð£¿
+
+ Êǵġ£Óм¸¸öÊÊÓÃÓÚ PostgreSQL
+ µÄͼÐνӿڡ£°üÀ¨PgAccess£¨http://www.pgaccess.com)£¬PgAdmin II
+ £¨http://www.pgadmin.org£¬½öÊÊÓÃÓÚWin32£©£¬ RHDB Admin
(http://sources.redhat.com/rhdb/£© ÒÔ¼° Rekall
£¨http://www.thekompany.com/products/rekall/£¬
- רÓеÄ/proprietary)¡£»¹ÓÐ PHPPgAdmin
- £¨http://phppgadmin.sourceforge.net/£© phppgadmin.sourceforge.net/>
- £¬Ò»¸ö»ùÓÚ web µÄ PostgreSQL ·ÃÎÊ½Ó ¿Ú¡£
+ רÓеÄ/proprietary)¡£»¹ÓÐPHPPgAdmin
+ £¨http://phppgadmin.sourceforge.net/£© £¬Ò»¸ö»ùÓÚ web µÄ PostgreSQL
+ ·ÃÎʽӿڡ£
+
ÎÒÃÇÓÐÒ»¸ö²»´íµÄͼÐÎÓû§½çÃ棬³ÆΪ PgAccess
- £¬ËüÒ²¿ÉÒÔÓÃ×÷±¨±íÉú³ÉÆ÷¡£Íø Ò³ÊÇ http://www.pgaccess.org/¡£ 2.4)
- ÎÒÃÇ¿ÉÒÔÓÃʲôÓïÑÔºÍ PostgreSQL ´ò½»µÀ£¿ ´ó¶àÊýÁ÷Ðеıà³ÌÓïÑÔ¶¼ÓзÃÎÊ
- PostgreSQL µÄ½Ó¿Ú¡£Çë¼ì²é±à³ÌÓïÑÔµÄÀ©Õ¹Ä£¿é ÁÐ±í¡£ PostgreSQL
- ·¢²¼°üÖаüº¬ÁËÒÔϽӿڣº * C (libpq) * Embedded C (ecpg) * Java (jdbc)
- * Python (PyGreSQL) * TCL (libpgtcl) ÆäËûµÄ½Ó¿ÚÔÚ
- http://gborg.postgresql.org É쵀 /Drivers/Interfaces/ С½Ú¡£
- ----------------------------------------------------------------------
- -- ϵͳ¹ÜÀíÎÊÌâ 3.1) ÎÒÔõÑùÄÜ°Ñ PostgreSQL ×°ÔÚ /usr/local/pgsql
- ÒÔÍâµÄµØ·½£¿ ÔÚÔËÐÐ configure ʱ¼ÓÉÏ --prefix Ñ¡Ïî¡£ 3.2) µ±ÎÒÔËÐÐ
- postmaster ʱ£¬³öÏÖ/ Bad System Call/£¨ÏµÍ³µ÷Óà ´í£©»ò Core Dumped
- ´íÎó¡£ÎªÊ²Ã´£¿ Õâ¿ÉÄÜÊǺܶ෽ÃæµÄÎÊÌ⣬ÇëÏȼì²é²Ù×÷ϵͳºËÐÄÊÇ·ñÖ§³Ö
- System V À©Õ¹¡£ PostgreSQL ÐèÒªÄÚºËÖ§³Ö¹²ÏíÄÚ´æºÍÐźŵơ£ 3.3)
- µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ /IpcMemoryCreate/ ´íÎó¡£Îª ʲô£¿
+ £¬ËüÒ²¿ÉÒÔÓÃ×÷±¨±íÉú³ÉÆ÷¡£ÍøÒ³ÊÇ http://www.pgaccess.org/¡£
+
+ 2.4) ÎÒÃÇ¿ÉÒÔÓÃʲôÓïÑÔºÍ PostgreSQL ´ò½»µÀ£¿
+
+ ´ó¶àÊýÁ÷Ðеıà³ÌÓïÑÔ¶¼ÓзÃÎÊ PostgreSQL
+ µÄ½Ó¿Ú¡£Çë¼ì²é±à³ÌÓïÑÔµÄÀ©Õ¹Ä£¿éÁÐ±í¡£
+
+ PostgreSQL ·¢²¼°üÖаüº¬ÁËÒÔϽӿڣº
+ * C (libpq)
+ * Embedded C (ecpg)
+ * Java (jdbc)
+ * Python (PyGreSQL)
+ * TCL (libpgtcl)
+
+ ÆäËûµÄ½Ó¿ÚÔÚ http://gborg.postgresql.org É쵀 Drivers/Interfaces
+ С½Ú¡£
+ _________________________________________________________________
+
+ ϵͳ¹ÜÀíÎÊÌâ
+
+ 3.1) ÎÒÔõÑùÄÜ°Ñ PostgreSQL ×°ÔÚ /usr/local/pgsql ÒÔÍâµÄµØ·½£¿
+
+ ÔÚÔËÐÐ configure ʱ¼ÓÉÏ --prefix Ñ¡Ïî¡£
+
+ 3.2) µ±ÎÒÔËÐÐ postmaster ʱ£¬³öÏÖ Bad System Call£¨ÏµÍ³µ÷ÓÃ´í£©»ò Core
+ Dumped ´íÎó¡£ÎªÊ²Ã´£¿
+
+ Õâ¿ÉÄÜÊǺܶ෽ÃæµÄÎÊÌ⣬ÇëÏȼì²é²Ù×÷ϵͳºËÐÄÊÇ·ñÖ§³Ö System V
+ À©Õ¹¡£PostgreSQL ÐèÒªÄÚºËÖ§³Ö¹²ÏíÄÚ´æºÍÐźŵơ£
+
+ 3.3) µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ IpcMemoryCreate ´íÎó¡£ÎªÊ²Ã´£¿
+
ÄãҪôÊÇûÓÐÔÚÄÚºËÀïÕýÈ·ÅäÖù²ÏíÄڴ棬ҪôÊÇÄãÐèÒªÀ©´óÄãµÄÄں˵ĿÉÓù²
- Ïí ÄÚ´æ¡£ÐèÒªµÄ¹²ÏíÄÚ´æ¾ßÌåµÄÊýÁ¿È¡¾öÓÚÄãµÄÌåϵ½á¹¹ºÍÄãÅäÖÃÄãµÄ
+ ÏíÄÚ´æ¡£ÐèÒªµÄ¹²ÏíÄÚ´æ¾ßÌåµÄÊýÁ¿È¡¾öÓÚÄãµÄÌåϵ½á¹¹ºÍÄãÅäÖÃÄãµÄ
postmaster
ÔËÐÐʱʹÓõĻº³åÇøºÍºó¶Ë½ø³ÌÊýÄ¿¡£¶Ô´ó¶àÊýϵͳ£¬Ê¹ÓÃȱʡ»º³åÇøºÍ½ø³ÌÊý
- Ä¿ ʱ£¬Äã×îÉÙÐèÒª~1MB¡£Óйع²ÏíÄÚ´æºÍÐźŵƵÄÏêϸÐÅÏ¢Çë²Î¿¼ PostgreSQL
- Administrator's Guide
- www.postgresql.org/idocs/index.php?kernel-resources.html> ¡£ 3.4)
- µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ /IpcSemaphoreCreate/ ´í Îó¡£ÎªÊ²Ã´£¿
- Èç¹û´íÎóÐÅÏ¢ÊÇ /IpcSemaphoreCreate: semget failed (No space left on
- device)/£¬ÄÇôÔÒòÊÇÄãµÄÄÚºËûÓÐÅäÖÃ×ã¹»µÄÐźŵÆ×ÊÔ´¡£Postgres µÄÿ¸öDZ
- Ôڵĺǫ́½ø³Ì¶¼ÐèÒªÒ»¸öÐźŵơ£Ò»¸öÁÙʱµÄ½â¾ö·½·¨ÊÇÒԱȽÏÉٵĺǫ́½ø³ÌÊý
- £¨²ÎÊý£©Æô¶¯ postmaster¡£Ê¹Óÿª¹Ø /-N/ ´øÒ»¸öÉÙÓÚȱʡֵ 32 µÄ²ÎÊýÔËÐÐ
- postmaster¡£¸ü³¤¾ÃµÄ½â¾ö·½·¨ÊǼӴóÄãµÄÄÚºËµÄ SEMMNS ºÍ SEMMNI ²ÎÊý¡£
+ Ŀʱ£¬Äã×îÉÙÐèÒª~1MB¡£Óйع²ÏíÄÚ´æºÍÐźŵƵÄÏêϸÐÅÏ¢Çë²Î¿¼ PostgreSQL
+ Administrator's Guide ¡£
+
+ 3.4) µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ IpcSemaphoreCreate ´íÎó¡£ÎªÊ²Ã´£¿
+
+ Èç¹û´íÎóÐÅÏ¢ÊÇ IpcSemaphoreCreate: semget failed (No space left on
+ device)£¬ÄÇôÔÒòÊÇÄãµÄÄÚºËûÓÐÅäÖÃ×ã¹»µÄÐźŵÆ×ÊÔ´¡£Postgres
+ µÄÿ¸öDZÔڵĺǫ́½ø³Ì¶¼ÐèÒªÒ»¸öÐźŵơ£Ò»¸öÁÙʱµÄ½â¾ö·½·¨ÊÇÒԱȽÏÉٵĺó
+ ̨½ø³ÌÊý£¨²ÎÊý£©Æô¶¯ postmaster¡£Ê¹Óÿª¹Ø -N ´øÒ»¸öÉÙÓÚȱʡֵ 32
+ µÄ²ÎÊýÔËÐÐ postmaster¡£¸ü³¤¾ÃµÄ½â¾ö·½·¨ÊǼӴóÄãµÄÄÚºËµÄ SEMMNS ºÍ
+ SEMMNI ²ÎÊý¡£
+
ÔÚÊý¾Ý¿â·ÃÎÊÁ¿ºÜ´óʱ£¬ÐźŵƲ»¿ÉÓÿÉÄܵ¼ÖÂϵͳ±ÀÀ£¡£
+
Èç¹û´íÎóÐÅÏ¢ÊÇÆäËûµÄʲô¶«Î÷£¬Äã¿ÉÄܾ͸ù±¾Ã»ÓÐÔÚÄÚºËÀïÃæÅäÖÃÐźŵÆÖ§³Ö
- ¡£ Óйع²ÏíÄÚ´æºÍÐźŵƵÄÏêϸÐÅÏ¢Çë²Î¿¼ PostgreSQL Administrator's
- Guide www.postgresql.org/idocs/index.php?kernel-resources.html> ¡£
- 3.5) ÎÒÈçºÎ¿ØÖÆÀ´×ÔÆäËûÖ÷»úµÄÁ¬½Ó£¿ ȱʡʱ£¬PostgreSQL Ö»ÔÊÐíͨ¹ý unix
- ÓòÌ×½Ó×ÖÀ´×Ô±¾»úµÄÁ¬½Ó¡£³ý·ÇÄãʹÓà /-i/ ¿ª¹ØÆô¶¯
- /postmaster/£¬*²¢ÇÒ*ͨ¹ý¶ÔÓ¦µÄ±à¼ /$PGDATA/pg_hba.conf/
+ ¡£Óйع²ÏíÄÚ´æºÍÐźŵƵÄÏêϸÐÅÏ¢Çë²Î¿¼ PostgreSQL Administrator's
+ Guide ¡£
+
+ 3.5) ÎÒÈçºÎ¿ØÖÆÀ´×ÔÆäËûÖ÷»úµÄÁ¬½Ó£¿
+
+ ȱʡʱ£¬PostgreSQL Ö»ÔÊÐíͨ¹ý unix ÓòÌ×½Ó×ÖÀ´×Ô±¾»úµÄÁ¬½Ó¡£³ý·ÇÄãʹÓÃ
+ -i ¿ª¹ØÆô¶¯ postmaster£¬²¢ÇÒͨ¹ý¶ÔÓ¦µÄ±à¼ $PGDATA/pg_hba.conf
Îļþ´ò¿ªÁËÖ÷»úΪ»ù´¡£¨ host-based
- £©µÄÈÏÖ¤£¬·ñÔòÆäËû»úÆ÷ÊDz»ÄÜÓëÄãµÄ»úÆ÷ Á¬½ÓµÄ¡£ÕâÑù½«ÔÊÐí TCP/IP
- Á¬½Ó¡£ 3.6) ÎÒÔõÑùµ÷ÕûÊý¾Ý¿âÒýÇæÒÔ»ñµÃ¸üºÃµÄÐÔÄÜ£¿
+ £©µÄÈÏÖ¤£¬·ñÔòÆäËû»úÆ÷ÊDz»ÄÜÓëÄãµÄ»úÆ÷Á¬½ÓµÄ¡£ÕâÑù½«ÔÊÐí TCP/IP Á¬½Ó¡£
+
+ 3.6) ÎÒÔõÑùµ÷ÕûÊý¾Ý¿âÒýÇæÒÔ»ñµÃ¸üºÃµÄÐÔÄÜ£¿
+
µ±È»£¬Ë÷Òý¿ÉÒÔ¼ÓËÙ²éѯ¡£EXPLAIN ÃüÁîÔÊÐíÄã¹Û²ì PostgreSQL
- ÈçºÎ½âÊÍÄãµÄ²é ѯ£¬ÒÔ¼°Ê¹ÓÃÁËÄÄЩË÷Òý¡£ Èç¹ûÄãÕý´¦ÀíÒ»¶Ñ
- INSERT£¬¿¼ÂÇʹÓà COPY ÃüÁîÒÔ´óÅúÁ¿µÄ·½Ê½½øÐС£ÕâÑù×ö±È µ¥¶ÀµÄÒ»¸ö¸ö
- INSERT ¿ìµÃ¶à¡£Æä´Î£¬Ã»Óд¦ÓÚ BEGIN WORK/COMMIT ÊÂÎñ¿éÖ®¼ä
- µÄÓï¾ä±»ÈÏΪÊôÓÚͬһ¸öÊÂÎñ¡£ÊÔ×ÅÔÚÒ»¸öÊÂÎñ¿éÀïÃæ´¦Àí¸ü¶àµÄÓï¾ä¡£ÕâÑù¿É
- ÒÔ
- ¼õÉÙÊÂÎñ´øÀ´µÄ¶îÍ⿪Ïú¡£Í¬Ñù£¬ÔÚ×ö´óÁ¿µÄÊý¾Ý¸Ä±äʱ¿¼ÂÇɾ³ýºÍÖؽ¨Ë÷Òý¡£
- »¹Óм¸¸öµ÷½ÚµÄÑ¡Ïî¿ÉÒÔʹÓá£Äã¿ÉÒÔͨ¹ý´ø /-o -F/ Ñ¡ÏîÆô¶¯ postmaster
- À´ ½ûÖ¹ fsync()¡£ÕâÑù½«±ÜÃâÿ´ÎÊÂÎñºóµ÷Óà /fsync() /
- °ÑÊý¾Ýˢе½´ÅÅÌÉÏ¡£ Ä㻹¿ÉÒÔʹÓà postmaster -B
- Ñ¡ÏîÔö¼Óºó¶Ë½ø³ÌʹÓõĹ²ÏíÄڴ滺³åµÄÊýÄ¿¡£Èç
- ¹ûÄã°ÑÕâ¸ö²ÎÊýÉèÖõÃÌ«´ó£¬postmaster ¿ÉÄÜÎÞ·¨Æô¶¯£¬ÒòΪÄãÒѾ³¬¹ýÁËÄãµÄ
- ÄÚºËÔÚ¹²ÏíÄÚ´æ¿Õ¼äÉϵÄÏÞÖÆ¡£Ã¿¸ö»º³åÇøÊÇ 8K ²¢ÇÒȱʡ 64 ¸ö»º³åÇø¡£
+ ÈçºÎ½âÊÍÄãµÄ²éѯ£¬ÒÔ¼°Ê¹ÓÃÁËÄÄЩË÷Òý¡£
+
+ Èç¹ûÄãÕý´¦ÀíÒ»¶Ñ INSERT£¬¿¼ÂÇʹÓà COPY
+ ÃüÁîÒÔ´óÅúÁ¿µÄ·½Ê½½øÐС£ÕâÑù×ö±Èµ¥¶ÀµÄÒ»¸ö¸ö INSERT
+ ¿ìµÃ¶à¡£Æä´Î£¬Ã»Óд¦ÓÚ BEGIN WORK/COMMIT
+ ÊÂÎñ¿éÖ®¼äµÄÓï¾ä±»ÈÏΪÊôÓÚͬһ¸öÊÂÎñ¡£ÊÔ×ÅÔÚÒ»¸öÊÂÎñ¿éÀïÃæ´¦Àí¸ü¶àµÄÓï
+ ¾ä¡£ÕâÑù¿ÉÒÔ¼õÉÙÊÂÎñ´øÀ´µÄ¶îÍ⿪Ïú¡£Í¬Ñù£¬ÔÚ×ö´óÁ¿µÄÊý¾Ý¸Ä±äʱ¿¼ÂÇɾ³ý
+ ºÍÖؽ¨Ë÷Òý¡£
+
+ »¹Óм¸¸öµ÷½ÚµÄÑ¡Ïî¿ÉÒÔʹÓá£Äã¿ÉÒÔͨ¹ý´ø -o -F Ñ¡ÏîÆô¶¯ postmaster
+ À´½ûÖ¹ fsync()¡£ÕâÑù½«±ÜÃâÿ´ÎÊÂÎñºóµ÷Óà fsync() °ÑÊý¾Ýˢе½´ÅÅÌÉÏ¡£
+
+ Ä㻹¿ÉÒÔʹÓà postmaster -B
+ Ñ¡ÏîÔö¼Óºó¶Ë½ø³ÌʹÓõĹ²ÏíÄڴ滺³åµÄÊýÄ¿¡£Èç¹ûÄã°ÑÕâ¸ö²ÎÊýÉèÖõÃÌ«´ó£¬
+ postmaster ¿ÉÄÜÎÞ·¨Æô¶¯£¬ÒòΪÄãÒѾ
+ ³¬¹ýÁËÄãµÄÄÚºËÔÚ¹²ÏíÄÚ´æ¿Õ¼äÉϵÄÏÞÖÆ¡£Ã¿¸ö»º³åÇøÊÇ 8K ²¢ÇÒȱʡ 64
+ ¸ö»º³åÇø¡£
+
Ä㻹¿ÉÒÔʹÓúǫ́½ø³ÌµÄ -S
- Ñ¡ÏîÀ´Ôö¼Óÿ¸öºǫ́½ø³ÌÓÃÓÚÁÙʱÅÅÐòÓõÄ×î´óÄÚ´æ ÊýÁ¿¡£-S
- ÖµÊÇÒÔK×ֽڼƵģ¬È±Ê¡ÊÇ 512 £¨Ò²¾ÍÊÇ˵£¬512K£©¡£ Ä㻹¿ÉÒÔʹÓà CLUSTER
- ÃüÁîÀ´°Ñ±íÀïµÄÊý¾Ý°´ÕÕij¸öË÷Òý½øÐоۼ¯´æ·Å¡£²ÎÔÄ CLUSTER
- µÄÊÖ²áÒ³»ñÈ¡¸ü¶àϸ½Ú¡£ 3.7) PostgreSQL Àï¿ÉÒÔ»ñµÃʲôÑùµÄµ÷ÊÔÌØÐÔ£¿
+ Ñ¡ÏîÀ´Ôö¼Óÿ¸öºǫ́½ø³ÌÓÃÓÚÁÙʱÅÅÐòÓõÄ×î´óÄÚ´æÊýÁ¿¡£-S
+ ÖµÊÇÒÔK×ֽڼƵģ¬È±Ê¡ÊÇ 512 £¨Ò²¾ÍÊÇ˵£¬512K£©¡£
+
+ Ä㻹¿ÉÒÔʹÓà CLUSTER ÃüÁîÀ´°Ñ±íÀïµÄÊý¾Ý°´ÕÕij¸öË÷Òý½øÐоۼ¯´æ·Å¡£²ÎÔÄ
+ CLUSTER µÄÊÖ²áÒ³»ñÈ¡¸ü¶àϸ½Ú¡£
+
+ 3.7) PostgreSQL Àï¿ÉÒÔ»ñµÃʲôÑùµÄµ÷ÊÔÌØÐÔ£¿
+
PostgreSQL
Óм¸¸öÌØÐÔÓÃÓÚ±¨¸æ״̬ÐÅÏ¢£¬ÕâЩÐÅÏ¢¿ÉÄܶԵ÷ÊÔÓÃ;ºÜÓаïÖú¡£
- Ê×ÏÈ£¬Í¨¹ý¸½´ø --enable-cassert Ñ¡ÏîÔËÐÐ configure£¬Óкܶà /assert()/
- ¼à ¿Øºǫ́½ø³ÌºÍÔÚ·¢ÉúijЩδÔøÔ¤ÁϵÄÏÖÏóʱֹͣ³ÌÐòÔËÐС£ postmaster ºÍ
- postgres ¶¼ÓÐһЩ¿ÉÓõÄÑ¡Ïî¡£Ê×ÏÈ£¬µ±ÄãÆô¶¯ postmaster
- ʱ£¬È·±£Äã°Ñ±ê×¼Êä³öºÍ±ê×¼´íÎóÊä³ö¶¨Ïòµ½ÁËÒ»¸öÈÕÖ¾ÎļþÀïÈ¥ÁË£¬Ïó£º cd
- /usr/local/pgsql ./bin/postmaster >server.log 2>&1 & ÕâÑù½«ÔÚ
- PostgreSQL ¶¥¼¶Ä¿Â¼ÏÂÊä³öÒ»¸ö server.log Îļþ¡£Õâ¸öÎļþ°üº¬·þÎñ
- Æ÷Åöµ½µÄÎÊÌâºÍ´íÎóµÄÓÐÓÃÐÅÏ¢¡£postmaster ÓÐÒ»¸ö -d
- Ñ¡Ï¸ÃÑ¡ÏîÔÊÐíÎÒÃÇ »ñµÃ¸ü¶àµÄϸ½Ú»ã±¨¡£-d
- Ñ¡Ïî½ÓÊÜÒ»¸öÊý×Ö±êÃ÷µ÷ÊÔ¼¶±ð¡£ÐèÒª¾¯¸æµÄÊǸߵĵ÷
- ÊÔ¼¶±ð¿ÉÄÜ»áÉú³É¾Þ´óµÄÈÕÖ¾Îļþ¡£ Èç¹û postmaster
- ûÓÐÔËÐУ¬Äã¿ÉÒÔÖ±½ÓÔÚÃüÁîÐÐÉÏÆô¶¯ postgres ºǫ́½ø³Ì£¬È» ºóÖ±½Ó¼üÈë
- SQL Óï¾ä¡£ÎÒÃÇ*Ö»* ÍƼöÔÚµ÷ÊÔµÄʱºòÕâô¸É¡£Çë×¢ÒâÕâʱÓû»ÐÐÜÞ
- ¶ø²»ÊǷֺűíʾÓï¾ä½áβ¡£Èç¹ûÄã´ø×ŵ÷ÊÔ·ûºÅ±àÒ룬Äã¿ÉÒÔʹÓÃÒ»¸öµ÷ÊÔÆ÷¹Û
- ¿´ ·¢ÉúÁËʲôÊÂÇé¡£ÒòΪºǫ́½ø³ÌûÓÐÓÉ postmaster
- Æô¶¯µÄ£¬Ëü²»ÊǺÍʵ¼ÊµÄÔËÐÐ
- »·¾³Ò»Ö£¬¶øÇÒËø¶¨/ºǫ́½»»¥ÎÊÌâ¿ÉÄܲ»ÄÜÖØÏÖ¡£ Èç¹û postmaster ÒѾ
- ÔËÐУ¬¿ÉÔÚÒ»¸ö´°¿ÚÖÐÆô¶¯ /psql/£¬È»ºóÕÒ³ö /psql/ ¶Ô Ó¦µÄ /postgres/
- ½ø³ÌµÄ PID¡£Ê¹ÓÃÒ»¸öµ÷ÊÔÆ÷¸½×ÅÔÚÕâ¸ö /postgres /PID ÉÏ¡£
- Äã¿ÉÒÔÔÚµ÷ÊÔÆ÷ÀïÉèÖöϵ㲢ÇÒ´Ó /psql/ ÀïÖ´Ðвéѯ¡£Èç¹ûÄãÔÚµ÷ÊÔ
- /postgres/ µÄÆô¶¯£¬Äã¿ÉÒÔÉèÖà PGOPTIONS="-W n"£¬È»ºóÆô¶¯
- /psql/¡£ÕâÑù½« µ¼ÖÂÆô¶¯ÑÓ³Ù /n/
- Ã룬ÕâÑùÄã¾Í¿ÉÒÔ¸½¼ÓÒ»¸öµ÷ÊÔÆ÷²¢ÇÒ¸ú×ÙÆô¶¯Ë³ÐòµÄ¹ý³Ì¡£ postgres ³ÌÐòÓÐ
- -s£¬-A£¬ºÍ -t Ñ¡Ïî¿ÉÄÜÔÚµ÷ÊÔºÍÐÔÄܲâÁ¿µÄʱºò·Ç³£ÓÐÓᣠÄ㻹¿ÉÒÔ´ø
- profiling Ö§³Ö±àÒëºǫ́£¬ÒÔ±ã¹Û²ìÄÄЩº¯ÊýÕ¼ÓõÄÖ´ÐÐʱ¼ä½Ï¶à¡£ profile
- Îļþ½«·ÅÔÚ pgsql/data/base/dbname Ŀ¼Ï¡£¿Í»§¶Ë profile Îļþ½«
- ·ÅÔÚ¿Í»§¶Ëµ±Ç°Ä¿Â¼Ï¡£ÔÚ Linux ÏÂÖ§³Ö profiling ÒªÔÚ±àÒëʱ¼ÓÉÏ/-
- DLINUX_PROFILE / ¡£ 3.8) ΪʲôÔÚÊÔͼÁ¬½ÓµÇ¼ʱÊÕµ½¡°Sorry, too many
- clients¡±ÏûÏ¢£¿ ÄãÐèÒªÔö´ó postmaster Æô¶¯Ê±Ö§³ÖµÄ²¢·¢ºǫ́½ø³ÌÊý¡£
- ȱʡÏÞÖÆÊÇ 32 ½ø³Ì¡£Äã¿ÉÒÔͨ¹ý´ø×ÅÊʵ±µÄ /-N/ Öµ¿ª¹ØÆô¶¯ postmaster
- Ôö¼Ó Õâ¸öÊýÄ¿¡£»òÕßÐÞ¸Ä /postgresql.conf/ Îļþ¡£ ҪעÒâÈç¹ûÄã°Ñ /-N/
- ÉèÖÃΪ´óÓÚ 32£¬Äã±ØÐëͬÑùÔö´ó /-B/£¬³¬¹ýËüȱʡµÄ 64£»-B ±ØÐë×îÉÙÊÇ -N
- µÄÁ½±¶£¬¶øÇÒΪÁ˸üºÃµÄÐÔÄÜ¿ÉÄÜÒª±ÈÄǸöÊý×ÖÒª´ó¡£¶Ô
- ÓÚ´óÊýÄ¿µÄºó¶Ë½ø³Ì£¬Äã¿ÉÄÜ»¹»á·¢ÏÖÄ㻹ÐèÒªÔö¼ÓÐí¶à Unix
- ÄÚºËÅäÖòÎÊýÖµ¡£
- Òª¼ì²éµÄ¶«Î÷°üÀ¨¹²ÏíÄÚ´æ¿éµÄ×î´ó³ß´ç£¬SHMMAX£¬ÐźŵƵÄ×î´óÊýÄ¿£¬SEMMNS
- ºÍ
- SEMMNI£¬×î´óµÄ½ø³ÌÊý£¬NPROC£¬µ¥Óû§×î´ó½ø³ÌÊý£¬MAXUPRC£¬ÒÔ¼°´ò¿ªÎļþ
- µÄ×î´óÊýÄ¿£¬NFILE ºÍ NINODE ¡£Postgres ¶ÔÔÊÐíµÄºǫ́½ø³ÌÊýÓÐÏÞÖƵÄÔÒòÊÇ
- ΪÁËÈ·±£ÄãµÄϵͳ²»»áÓùâ×ÊÔ´¡£ ÔÚ Postgres ÔçÓÚ 6.5
- µÄ°æ±¾£¬×î´óºǫ́½ø³ÌÊýȱʡÊÇ 64£¬²¢ÇÒ¶ÔËüµÄÐÞ¸ÄÊ×ÏÈ ÐèÒªÐÞ¸Ä
- /include/storage/sinvaladt.h/ ÀïµÄ MaxBackendId ³£Á¿£¬È»ºóÖØРBUILD¡£
- 3.9) pgsql_tmp Ŀ¼ÀﶼÓÐЩʲô£¿
+
+ Ê×ÏÈ£¬Í¨¹ý¸½´ø --enable-cassert Ñ¡ÏîÔËÐÐ configure£¬Óкܶà assert()
+ ¼à¿Øºǫ́½ø³ÌºÍÔÚ·¢ÉúijЩδÔøÔ¤ÁϵÄÏÖÏóʱֹͣ³ÌÐòÔËÐС£
+
+ postmaster ºÍ postgres ¶¼ÓÐһЩ¿ÉÓõÄÑ¡Ïî¡£Ê×ÏÈ£¬µ±ÄãÆô¶¯ postmaster
+ ʱ£¬È·±£Äã°Ñ±ê×¼Êä³öºÍ±ê×¼´íÎóÊä³ö¶¨Ïòµ½ÁËÒ»¸öÈÕÖ¾ÎļþÀïÈ¥ÁË£¬Ïó£º
+ cd /usr/local/pgsql
+ ./bin/postmaster >server.log 2>&1 &
+
+ ÕâÑù½«ÔÚ PostgreSQL ¶¥¼¶Ä¿Â¼ÏÂÊä³öÒ»¸ö server.log
+ Îļþ¡£Õâ¸öÎļþ°üº¬·þÎñÆ÷Åöµ½µÄÎÊÌâºÍ´íÎóµÄÓÐÓÃÐÅÏ¢¡£postmaster ÓÐÒ»¸ö
+ -d Ñ¡Ï¸ÃÑ¡ÏîÔÊÐíÎÒÃÇ»ñµÃ¸ü¶àµÄϸ½Ú»ã±¨¡£-d
+ Ñ¡Ïî½ÓÊÜÒ»¸öÊý×Ö±êÃ÷µ÷ÊÔ¼¶±ð¡£ÐèÒª¾¯¸æµÄÊǸߵĵ÷ÊÔ¼¶±ð¿ÉÄÜ»áÉú³É¾Þ´óµÄ
+ ÈÕÖ¾Îļþ¡£
+
+ Èç¹û postmaster ûÓÐÔËÐУ¬Äã¿ÉÒÔÖ±½ÓÔÚÃüÁîÐÐÉÏÆô¶¯ postgres
+ ºǫ́½ø³Ì£¬È»ºóÖ±½Ó¼üÈë SQL Óï¾ä¡£ÎÒÃÇÖ»
+ ÍƼöÔÚµ÷ÊÔµÄʱºòÕâô¸É¡£Çë×¢ÒâÕâʱÓû»ÐÐÜÞ¶ø²»ÊǷֺűíʾÓï¾ä½áβ¡£Èç¹û
+ Äã´ø×ŵ÷ÊÔ·ûºÅ±àÒ룬Äã¿ÉÒÔʹÓÃÒ»¸öµ÷ÊÔÆ÷¹Û¿´·¢ÉúÁËʲôÊÂÇé¡£ÒòΪºǫ́½ø
+ ³ÌûÓÐÓÉ postmaster
+ Æô¶¯µÄ£¬Ëü²»ÊǺÍʵ¼ÊµÄÔËÐл·¾³Ò»Ö£¬¶øÇÒËø¶¨/ºǫ́½»»¥ÎÊÌâ¿ÉÄܲ»ÄÜÖØÏÖ¡
+ £
+
+ Èç¹û postmaster ÒѾÔËÐУ¬¿ÉÔÚÒ»¸ö´°¿ÚÖÐÆô¶¯ psql£¬È»ºóÕÒ³ö psql ¶ÔÓ¦µÄ
+ postgres ½ø³ÌµÄ PID¡£Ê¹ÓÃÒ»¸öµ÷ÊÔÆ÷¸½×ÅÔÚÕâ¸ö postgres PID
+ ÉÏ¡£Äã¿ÉÒÔÔÚµ÷ÊÔÆ÷ÀïÉèÖöϵ㲢ÇÒ´Ó psql ÀïÖ´Ðвéѯ¡£Èç¹ûÄãÔÚµ÷ÊÔ
+ postgres µÄÆô¶¯£¬Äã¿ÉÒÔÉèÖà PGOPTIONS="-W n"£¬È»ºóÆô¶¯
+ psql¡£ÕâÑù½«µ¼ÖÂÆô¶¯ÑÓ³Ù n
+ Ã룬ÕâÑùÄã¾Í¿ÉÒÔ¸½¼ÓÒ»¸öµ÷ÊÔÆ÷²¢ÇÒ¸ú×ÙÆô¶¯Ë³ÐòµÄ¹ý³Ì¡£
+
+ postgres ³ÌÐòÓÐ -s£¬-A£¬ºÍ -t Ñ¡Ïî¿ÉÄÜÔÚµ÷ÊÔºÍÐÔÄܲâÁ¿µÄʱºò·Ç³£ÓÐÓá£
+
+ Ä㻹¿ÉÒÔ´ø profiling
+ Ö§³Ö±àÒëºǫ́£¬ÒÔ±ã¹Û²ìÄÄЩº¯ÊýÕ¼ÓõÄÖ´ÐÐʱ¼ä½Ï¶à¡£profile Îļþ½«·ÅÔÚ
+ pgsql/data/base/dbname Ŀ¼Ï¡£¿Í»§¶Ë profile
+ Îļþ½«·ÅÔÚ¿Í»§¶Ëµ±Ç°Ä¿Â¼Ï¡£ÔÚ Linux ÏÂÖ§³Ö profiling
+ ÒªÔÚ±àÒëʱ¼ÓÉÏ-DLINUX_PROFILE ¡£
+
+ 3.8) ΪʲôÔÚÊÔͼÁ¬½ÓµÇ¼ʱÊÕµ½¡°Sorry, too many clients¡±ÏûÏ¢£¿
+
+ ÄãÐèÒªÔö´ó postmaster Æô¶¯Ê±Ö§³ÖµÄ²¢·¢ºǫ́½ø³ÌÊý¡£
+
+ ȱʡÏÞÖÆÊÇ 32 ½ø³Ì¡£Äã¿ÉÒÔͨ¹ý´ø×ÅÊʵ±µÄ -N Öµ¿ª¹ØÆô¶¯ postmaster
+ Ôö¼ÓÕâ¸öÊýÄ¿¡£»òÕßÐÞ¸Ä postgresql.conf Îļþ¡£
+
+ ҪעÒâÈç¹ûÄã°Ñ -N ÉèÖÃΪ´óÓÚ 32£¬Äã±ØÐëͬÑùÔö´ó -B£¬³¬¹ýËüȱʡµÄ
+ 64£»-B ±ØÐë×îÉÙÊÇ -N
+ µÄÁ½±¶£¬¶øÇÒΪÁ˸üºÃµÄÐÔÄÜ¿ÉÄÜÒª±ÈÄǸöÊý×ÖÒª´ó¡£¶ÔÓÚ´óÊýÄ¿µÄºó¶Ë½ø³Ì£¬
+ Äã¿ÉÄÜ»¹»á·¢ÏÖÄ㻹ÐèÒªÔö¼ÓÐí¶à Unix
+ ÄÚºËÅäÖòÎÊýÖµ¡£Òª¼ì²éµÄ¶«Î÷°üÀ¨¹²ÏíÄÚ´æ¿éµÄ×î´ó³ß´ç£¬SHMMAX£¬ÐźŵƵÄ
+ ×î´óÊýÄ¿£¬SEMMNS ºÍ
+ SEMMNI£¬×î´óµÄ½ø³ÌÊý£¬NPROC£¬µ¥Óû§×î´ó½ø³ÌÊý£¬MAXUPRC£¬ÒÔ¼°´ò¿ªÎļþµÄ
+ ×î´óÊýÄ¿£¬NFILE ºÍ NINODE ¡£Postgres ¶ÔÔÊÐíµÄºǫ́½ø³ÌÊýÓÐÏÞÖƵÄÔ
+ ÒòÊÇΪÁËÈ·±£ÄãµÄϵͳ²»»áÓùâ×ÊÔ´¡£
+
+ ÔÚ Postgres ÔçÓÚ 6.5 µÄ°æ±¾£¬×î´óºǫ́½ø³ÌÊýȱʡÊÇ
+ 64£¬²¢ÇÒ¶ÔËüµÄÐÞ¸ÄÊ×ÏÈÐèÒªÐÞ¸Ä include/storage/sinvaladt.h ÀïµÄ
+ MaxBackendId ³£Á¿£¬È»ºóÖØРBUILD¡£
+
+ 3.9) pgsql_tmp Ŀ¼ÀﶼÓÐЩʲô£¿
+
¸ÃĿ¼Ï±£´æÁ˲éѯִÐÐÆ÷Éú³ÉµÄÁÙʱÎļþ¡£ÀýÈ磬Èç¹ûÐèҪΪÂú×ã ORDER BY
- Ìõ ¼þ×öÅÅÐò£¬²¢ÇÒÅÅÐòÐèÒª±Èºǫ́µÄ -S
- ²ÎÊý¸ø³öµÄ¸ü¶àµÄ¿Õ¼ä£¬ÄÇô¾Í»á´´½¨Ò»¸ö ÁÙʱÎļþ±£´æ¶à³öÀ´µÄÊý¾Ý¡£
+ Ìõ¼þ×öÅÅÐò£¬²¢ÇÒÅÅÐòÐèÒª±Èºǫ́µÄ -S
+ ²ÎÊý¸ø³öµÄ¸ü¶àµÄ¿Õ¼ä£¬ÄÇô¾Í»á´´½¨Ò»¸öÁÙʱÎļþ±£´æ¶à³öÀ´µÄÊý¾Ý¡£
+
ÁÙʱÎļþÓ¦¸Ã×Ô¶¯É¾³ý£¬²»¹ýÈç¹ûÔÚÅÅÐò¹ý³ÌÖкǫ́±ÀÀ£Á˾ͿÉÄÜÁôÏÂÀ´¡£Í£Ö¹
- ²¢ ÖØÆð postmaster ½«»áɾ³ýÕâЩÎļþ¡£ 3.10) ΪʲôҪÔÚÉý¼¶ PostgreSQL
- ·¢²¼°æ±¾Ê±×ö dump ºÍ restore £¿ PostgreSQL
- ¿ª·¢×é¶Ôÿ´ÎСµÄÉý¼¶½ö×öÁ˽ÏÉÙµÄÐÞ¸Ä,Òò´Ë´Ó 7.2 Éý¼¶µ½ 7.2.1 ²»ÐèÒª
- dump ºÍ restore¡£µ«ÊÇÖ÷ÒªµÄÉý¼¶£¨ÀýÈç´Ó 7.2 µ½ 7.3£©Í¨³£»áÐÞ¸Äϵ
- ͳ±íºÍÊý¾Ý±íµÄÄÚ²¿¸ñʽ¡£ÕâЩ±ä»¯Ò»°ã±È½Ï¸´ÔÓ£¬Òò´ËÎÒÃDz»Î¬Êý¾ÝÎļþµÄÏò
- ºó ¼æÈÝ¡£dump
+ ²¢ÖØÆð postmaster ½«»áɾ³ýÕâЩÎļþ¡£
+
+ 3.10) ΪʲôҪÔÚÉý¼¶ PostgreSQL ·¢²¼°æ±¾Ê±×ö dump ºÍ restore £¿
+
+ PostgreSQL ¿ª·¢×é¶Ôÿ´ÎСµÄÉý¼¶½ö×öÁ˽ÏÉÙµÄÐÞ¸Ä,Òò´Ë´Ó 7.2 Éý¼¶µ½
+ 7.2.1 ²»ÐèÒª dump ºÍ restore¡£µ«ÊÇÖ÷ÒªµÄÉý¼¶£¨ÀýÈç´Ó 7.2 µ½
+ 7.3£©Í¨³£»áÐÞ¸Äϵͳ±íºÍÊý¾Ý±íµÄÄÚ²¿¸ñʽ¡£ÕâЩ±ä»¯Ò»°ã±È½Ï¸´ÔÓ£¬Òò´ËÎÒÃ
+ Dz»Î¬Êý¾ÝÎļþµÄÏòºó¼æÈÝ¡£dump
½«Êý¾Ý°´ÕÕͨÓõĸñʽÊä³ö£¬Ëæºó¿ÉÒÔ±»ÖØмÓÔز¢Ê¹ÓÃеÄÄÚ²¿¸ñʽ¡£
- ´ÅÅÌÎļþ¸ñʽûÓб仯µÄÉý¼¶£¬¿ÉÒÔÓà /pg_upgrade/ ½Å±¾£¬¶ø²»ÐèÒª×ö dump
- ºÍ restor¡£·¢²¼ËµÃ÷script »áÖ¸Ã÷ /pg_upgrade/ ¶Ô¸Ã´ÎÉý¼¶ÊÇ·ñ¿ÉÓá£
- ----------------------------------------------------------------------
- -- ²Ù×÷ÎÊÌâ 4.1) ¶þ½øÖÆÓαêºÍÆÕͨÓαêÖ®¼äµÄÇø±ðÊÇʲô£¿ ²ÎÔÄ DECLARE
- ÊÖ²áÒ³»ñÈ¡ÐÅÏ¢¡£ 4.2)ÈçºÎÖ» SELECT Ò»¸ö²éѯ½á¹ûµÄÍ·¼¸ÐУ¿ ²ÎÔÄ FETCH
- ÊÖ²áÒ³£¬»òÕßʹÓà SELECT ... LIMIT....
- ¼´Ê¹ÄãÖ»ÐèÒª¿ªÍ·µÄ¼¸ÐУ¬Ò²»áÉæ¼°µ½Õû¸ö²éѯ¡£ÊÔ×ÅʹÓôøÓÐ ORDER BY µÄ²é
- ѯ¡£Èç¹ûÓÐÒ»¸öË÷ÒýÓë ORDER BY Æ¥Å䣬PostgreSQL
- ¿ÉÄܾÍÖ»´¦ÀíÒªÇóµÄÍ·¼¸Ìõ
- ¼Ç¼£¬·ñÔò½«¶ÔÕû¸ö²éѯ½øÐд¦ÀíÖ±µ½Éú³ÉÐèÒªµÄÐС£ 4.3)
- ÎÒÈçºÎ»ñÈ¡Ò»¸ö±íµÄÁÐ±í£¬»òÕßÊÇÆäËûÎÒÄÜÔÚ /psql/ Àï¿´µ½µÄ¶«Î÷£¿
- Äã¿ÉÒÔÔĶÁ /psql/ µÄÔ´´úÂëÎļþ/pgsql/src/bin/psql/describe.c/
- ¡£Ëü°üÀ¨Îª Éú³É psql µÄ·´Ð±¸ÜÃüÁîµÄÊä³öµÄ SQL ÃüÁî¡£Ä㻹¿ÉÒÔ´ø /-E/
- Ñ¡ÏîÆô¶¯ /psql/£¬ÕâÑùËü½«´òÓ¡³öÖ´ÐÐÄã¸ø³öµÄÃüÁîËùÓõIJéѯ¡£ 4.4)
- ÔõÑù´Ó±íÀïÃæɾ³ýÒ»ÁУ¿ 7.3 ÀïÔö¼ÓÁË ALTER TABLE DROP
- COLUMN£¬ÒÔÖ§³Ö´ËÏÄÜ¡£ÔÚÒÔÇ°µÄ°æ±¾ÖУ¬¿É ÒÔÕâÑù×ö£º BEGIN; LOCK
- TABLE old_table; SELECT ... -- select all columns but the one you want
- to remove INTO TABLE new_table FROM old_table; DROP TABLE old_table;
- ALTER TABLE new_table RENAME TO old_table; COMMIT; 4.5)
- Ò»ÐУ¬Ò»¸ö±í£¬Ò»¸ö¿âµÄ×î´ó³ß´çÊǶàÉÙ£¿ ÏÂÃæÊÇһЩÏÞÖÆ£º
- Ò»¸öÊý¾Ý¿â×î´ó³ß´ç£¿ ÎÞÏÞÖÆ£¨´æÔÚ 1TB µÄÊý¾Ý¿â£© Ò»¸ö±íµÄ×î´ó³ß´ç£¿
- 16TB Ò»ÐеÄ×î´ó³ß´ç£¿ 1.6TB Ò»¸ö×ֶεÄ×î´ó³ß´ç? 1GB Ò»¸ö±íÀï×î´óÐÐÊý£¿
- ÎÞÏÞÖÆ Ò»¸ö±íÀï×î´óÁÐÊý£¿ ¸úÁÐÀàÐÍÓйØ,250-1600
- Ò»¸ö±íÀïµÄ×î´óË÷ÒýÊýÁ¿£¿ÎÞÏÞÖÆ
+
+ ´ÅÅÌÎļþ¸ñʽûÓб仯µÄÉý¼¶£¬¿ÉÒÔÓà pg_upgrade ½Å±¾£¬¶ø²»ÐèÒª×ö dump ºÍ
+ restor¡£·¢²¼ËµÃ÷script »áÖ¸Ã÷ pg_upgrade ¶Ô¸Ã´ÎÉý¼¶ÊÇ·ñ¿ÉÓá£
+ _________________________________________________________________
+
+ ²Ù×÷ÎÊÌâ
+
+ 4.1) ¶þ½øÖÆÓαêºÍÆÕͨÓαêÖ®¼äµÄÇø±ðÊÇʲô£¿
+
+ ²ÎÔÄ DECLARE ÊÖ²áÒ³»ñÈ¡ÐÅÏ¢¡£
+
+ 4.2)ÈçºÎÖ» SELECT Ò»¸ö²éѯ½á¹ûµÄÍ·¼¸ÐУ¿
+
+ ²ÎÔÄ FETCH ÊÖ²áÒ³£¬»òÕßʹÓà SELECT ... LIMIT....
+
+ ¼´Ê¹ÄãÖ»ÐèÒª¿ªÍ·µÄ¼¸ÐУ¬Ò²»áÉæ¼°µ½Õû¸ö²éѯ¡£ÊÔ×ÅʹÓôøÓÐ ORDER BY
+ µÄ²éѯ¡£Èç¹ûÓÐÒ»¸öË÷ÒýÓë ORDER BY Æ¥Å䣬PostgreSQL
+ ¿ÉÄܾÍÖ»´¦ÀíÒªÇóµÄÍ·¼¸Ìõ¼Ç¼£¬·ñÔò½«¶ÔÕû¸ö²éѯ½øÐд¦ÀíÖ±µ½Éú³ÉÐèÒªµÄÐÐ
+ ¡£
+
+ 4.3) ÎÒÈçºÎ»ñÈ¡Ò»¸ö±íµÄÁÐ±í£¬»òÕßÊÇÆäËûÎÒÄÜÔÚ psql Àï¿´µ½µÄ¶«Î÷£¿
+
+ Äã¿ÉÒÔÔĶÁ psql µÄÔ´´úÂëÎļþpgsql/src/bin/psql/describe.c
+ ¡£Ëü°üÀ¨ÎªÉú³É psql µÄ·´Ð±¸ÜÃüÁîµÄÊä³öµÄ SQL ÃüÁî¡£Ä㻹¿ÉÒÔ´ø -E
+ Ñ¡ÏîÆô¶¯ psql£¬ÕâÑùËü½«´òÓ¡³öÖ´ÐÐÄã¸ø³öµÄÃüÁîËùÓõIJéѯ¡£
+
+ 4.4) ÔõÑù´Ó±íÀïÃæɾ³ýÒ»ÁУ¿
+
+ 7.3 ÀïÔö¼ÓÁË ALTER TABLE DROP
+ COLUMN£¬ÒÔÖ§³Ö´ËÏÄÜ¡£ÔÚÒÔÇ°µÄ°æ±¾ÖУ¬¿ÉÒÔÕâÑù×ö£º
+ BEGIN;
+ LOCK TABLE old_table;
+ SELECT ... -- select all columns but the one you want to remove
+ INTO TABLE new_table
+ FROM old_table;
+ DROP TABLE old_table;
+ ALTER TABLE new_table RENAME TO old_table;
+ COMMIT;
+
+ 4.5) Ò»ÐУ¬Ò»¸ö±í£¬Ò»¸ö¿âµÄ×î´ó³ß´çÊǶàÉÙ£¿
+
+ ÏÂÃæÊÇһЩÏÞÖÆ£º
+ Ò»¸öÊý¾Ý¿â×î´ó³ß´ç£¿ ÎÞÏÞÖÆ£¨´æÔÚ 1TB µÄÊý¾Ý¿â£©
+ Ò»¸ö±íµÄ×î´ó³ß´ç£¿ 16TB
+ Ò»ÐеÄ×î´ó³ß´ç£¿ 1.6TB
+ Ò»¸ö×ֶεÄ×î´ó³ß´ç? 1GB
+ Ò»¸ö±íÀï×î´óÐÐÊý£¿ ÎÞÏÞÖÆ
+ Ò»¸ö±íÀï×î´óÁÐÊý£¿ ¸úÁÐÀàÐÍÓйØ,250-1600
+ Ò»¸ö±íÀïµÄ×î´óË÷ÒýÊýÁ¿£¿ÎÞÏÞÖÆ
+
µ±È»£¬Êµ¼ÊÉÏûÓÐÕæÕýµÄÎÞÏÞÖÆ£¬»¹ÊÇÒªÊÜ¿ÉÓôÅÅ̿ռ䡢¿ÉÓÃÄÚ´æ/½»»»ÇøµÄÖ
- ÆÔ¼¡£ ±íµÄ×î´ó³ß´ç 16 TB ²»ÐèÒª²Ù×÷ϵͳ¶Ô´óÎļþµÄÖ§³Ö¡£´ó±íÓöà¸ö 1 GB
- µÄÎļþ ´æ´¢£¬Òò´ËÎļþϵͳ³ß´çµÄÏÞÖÆÊDz»ÖØÒªµÄ¡£ Èç¹ûȱʡµÄ¿é´óСÔö³¤µ½
- 32K £¬×î´óµÄ±í³ß´çºÍ×î´óÁÐÊý¿ÉÒÔÔö¼Ó¡£
- 4.6)´æ´¢Ò»¸öµäÐ͵ÄƽÃæÎļþÀïµÄÊý¾ÝÐèÒª¶àÉÙ´ÅÅ̿ռ䣿 Ò»¸ö Postgres
- Êý¾Ý¿â×î¶à¿ÉÄÜÐèÒªÏ൱ÓÚÔÚÒ»¸öƽÃæÎļþÀï´æ´¢ÏàͬÊý¾ÝµÄ5±¶ µÄ´ÅÅ̿ռ䡣
+ ÆÔ¼¡£
+
+ ±íµÄ×î´ó³ß´ç 16 TB ²»ÐèÒª²Ù×÷ϵͳ¶Ô´óÎļþµÄÖ§³Ö¡£´ó±íÓöà¸ö 1 GB
+ µÄÎļþ´æ´¢£¬Òò´ËÎļþϵͳ³ß´çµÄÏÞÖÆÊDz»ÖØÒªµÄ¡£
+
+ Èç¹ûȱʡµÄ¿é´óСÔö³¤µ½ 32K £¬×î´óµÄ±í³ß´çºÍ×î´óÁÐÊý¿ÉÒÔÔö¼Ó¡£
+
+ 4.6)´æ´¢Ò»¸öµäÐ͵ÄƽÃæÎļþÀïµÄÊý¾ÝÐèÒª¶àÉÙ´ÅÅ̿ռ䣿
+
+ Ò»¸ö Postgres
+ Êý¾Ý¿â×î¶à¿ÉÄÜÐèÒªÏ൱ÓÚÔÚÒ»¸öƽÃæÎļþÀï´æ´¢ÏàͬÊý¾ÝµÄ5±¶µÄ´ÅÅ̿ռ䡣
+
ÀýÈ磬¼ÙÉèÓÐÒ»¸ö 100,000
- ÐеÄÎļþ£¬Ã¿ÐÐÓÐÒ»¸öÕûÊýºÍÒ»¸öÎı¾ÃèÊö¡£¼ÙÉèÎÄ
- ±¾´®µÄƽ¾ù³¤¶Èλ20×Ö½Ú¡£Æ½ÃæÎļþÕ¼Óà 2.8 MB¡£´æ·ÅÕâЩÊý¾ÝµÄ PostgreSQL
- Êý¾Ý¿âÎļþ´óÔ¼ÊÇ 6.4 MB: 36 ×Ö½Ú: ÿÐеÄÍ·£¨¹À¼ÆÖµ£© 24 ×Ö½Ú:
- Ò»¸öint×ֶκÍÒ»¸öÎı¾ÐÍ×ֶΠ+ 4 ×Ö½Ú: Ò³ÃæÄÚÖ¸ÏòÔª×éµÄÖ¸Õë
- ---------------------------------------- 64 ×Ö½ÚÿÐÐ PostgreSQL
- Êý¾ÝÒ³µÄ´óСÊÇ 8192 ×Ö½Ú (8 KB)£¬Ôò£º 8192 ×Ö½Úÿҳ
- ------------------- = 128 ÐÐ/Êý¾ÝÒ³£¨ÏòÏÂÈ¡Õû£© 64 ×Ö½ÚÿÐÐ 100000
- Êý¾ÝÐÐ -------------------- = 782 Êý¾ÝÒ³£¨ÏòÉÏÈ¡Õû£© 128 ÐÐÿҳ 782
- Êý¾ÝÒ³ * 8192 ×Ö½Ú/Ò³ = 6,406,144 ×Ö½Ú£¨6.4 MB£©
+ ÐеÄÎļþ£¬Ã¿ÐÐÓÐÒ»¸öÕûÊýºÍÒ»¸öÎı¾ÃèÊö¡£¼ÙÉèÎı¾´®µÄƽ¾ù³¤¶Èλ20×Ö½Ú¡£
+ ƽÃæÎļþÕ¼Óà 2.8 MB¡£´æ·ÅÕâЩÊý¾ÝµÄ PostgreSQL Êý¾Ý¿âÎļþ´óÔ¼ÊÇ 6.4
+ MB:
+ 36 ×Ö½Ú: ÿÐеÄÍ·£¨¹À¼ÆÖµ£©
+ 24 ×Ö½Ú: Ò»¸öint×ֶκÍÒ»¸öÎı¾ÐÍ×Ö¶Î
+ + 4 ×Ö½Ú: Ò³ÃæÄÚÖ¸ÏòÔª×éµÄÖ¸Õë
+ ----------------------------------------
+ 64 ×Ö½ÚÿÐÐ
+
+ PostgreSQL Êý¾ÝÒ³µÄ´óСÊÇ 8192 ×Ö½Ú (8 KB)£¬Ôò£º
+
+ 8192 ×Ö½Úÿҳ
+ ------------------- = 128 ÐÐ/Êý¾ÝÒ³£¨ÏòÏÂÈ¡Õû£©
+ 64 ×Ö½ÚÿÐÐ
+
+ 100000 Êý¾ÝÐÐ
+ -------------------- = 782 Êý¾ÝÒ³£¨ÏòÉÏÈ¡Õû£©
+ 128 ÐÐÿҳ
+
+ 782 Êý¾ÝÒ³ * 8192 ×Ö½Ú/Ò³ = 6,406,144 ×Ö½Ú£¨6.4 MB£©
+
Ë÷Òý²»ÐèÒªÕâô¶àµÄ¶îÍâÏûºÄ£¬µ«Ò²È·Êµ°üÀ¨±»Ë÷ÒýµÄÊý¾Ý£¬Òò´ËËüÃÇÒ²¿ÉÄܺÜ
- ´ó¡£ ¿ÕÖµ´æ·ÅÔÚλͼÖУ¬Òò´ËÕ¼ÓúÜÉٵĿռ䡣 4.7)
- ÈçºÎ²é¿´±í¡¢Ë÷Òý¡¢Êý¾Ý¿âÒÔ¼°Óû§µÄ¶¨Ò壿 / psql/
- ÓÐÐí¶à·´Ð±¸ÜÃüÁîÓÃÓÚÏÔʾÕâЩÐÅÏ¢¡£Óà \? ¿´¿´¶¼ÓÐÄÄЩ¡£ÒÔ pg_ ´ò
- Í·µÄϵͳ±íÒ²ÃèÊöÁËÕâЩÐÅÏ¢¡£ psql -l ¿ÉÒÔÁгöËùÓеÄÊý¾Ý¿â¡£
+ ´ó¡£
+
+ ¿ÕÖµ´æ·ÅÔÚλͼÖУ¬Òò´ËÕ¼ÓúÜÉٵĿռ䡣
+
+ 4.7) ÈçºÎ²é¿´±í¡¢Ë÷Òý¡¢Êý¾Ý¿âÒÔ¼°Óû§µÄ¶¨Ò壿
+
+ psql ÓÐÐí¶à·´Ð±¸ÜÃüÁîÓÃÓÚÏÔʾÕâЩÐÅÏ¢¡£Óà \? ¿´¿´¶¼ÓÐÄÄЩ¡£ÒÔ pg_
+ ´òÍ·µÄϵͳ±íÒ²ÃèÊöÁËÕâЩÐÅÏ¢¡£ psql -l ¿ÉÒÔÁгöËùÓеÄÊý¾Ý¿â¡£
+
Ò²¿ÉÒÔÊÔÊÔÎļþ
- /pgsql/src/tutorial/syscat.source/¡£ËüÑÝʾÁËÐí¶à´ÓÊý¾Ý¿â
- ϵͳ±íÀï»ñÈ¡ÐÅÏ¢ÐèÒªµÄ SELECT¡£ 4.8)
- ÎҵIJéѯºÜÂý»òÕßûÓÐÀûÓÃË÷Òý¡£ÎªÊ²Ã´£¿
+ pgsql/src/tutorial/syscat.source¡£ËüÑÝʾÁËÐí¶à´ÓÊý¾Ý¿âϵͳ±íÀï»ñÈ¡ÐÅÏ¢
+ ÐèÒªµÄ SELECT¡£
+
+ 4.8) ÎҵIJéѯºÜÂý»òÕßûÓÐÀûÓÃË÷Òý¡£ÎªÊ²Ã´£¿
+
²¢·Çÿ¸ö²éѯ¶¼»á×Ô¶¯Ê¹ÓÃË÷Òý¡£Ö»ÓÐÔÚ±íµÄ´óС³¬¹ýÒ»¸ö×îСֵ£¬²¢ÇÒ²éѯֻ
- ѡ
- Ôñ±íÖнÏС±ÈÀýµÄÐÐʱ²ÉÓÃʹÓÃË÷Òý¡£ÕâÊÇÒòΪË÷ÒýɨÃèÒýÆðµÄËæ¼´´ÅÅÌ´æÈ¡¿É
- ÄÜ ±ÈÖ±½ÓµØ¶ÁÈ¡±í£¨Ë³ÐòɨÃ裩¸üÂý¡£ÎªÁËÅжÏÊÇ·ñʹÓÃË÷Òý£¬PostgreSQL
- ±ØÐë»ñ µÃÓйرíµÄͳ¼ÆÖµ¡£ÕâЩͳ¼ÆÖµ¿ÉÒÔʹÓà VACUUM ANALYZE£¬»ò ANALYZE
- »ñµÃ¡£Ê¹
- ÓÃͳ¼ÆÖµ£¬ÓÅ»¯Æ÷ÖªµÀ±íÖÐÓжàÉÙÐУ¬¾ÍÄܹ»¸üºÃµØÅжÏÊÇ·ñÀûÓÃË÷Òý¡£Í³¼ÆÖµ
- ¶Ô
- È·¶¨ÓÅ»¯µÄÁ¬½Ó˳ÐòºÍÁ¬½Ó·½·¨Ò²ºÜÓÐÓá£ÔÚ±íµÄÄÚÈÝ·¢Éú±ä»¯Ê±£¬Ó¦¶¨ÆÚ½øÐÐ
- ͳ ¼ÆÖµµÄ»ñÈ¡¡£ Ë÷Òýͨ³£²»ÓÃÓÚ ORDER BY
- »òÖ´ÐÐÁ¬½Ó¡£¶ÔÒ»¸ö´ó±íµÄÒ»´Î˳ÐòɨÃ裬ÔÙ×öÒ»¸öÏÔ
- ʽµÄÅÅÐòͨ³£±ÈË÷ÒýɨÃèÒª¿ì¡£ µ«ÊÇ£¬ÔÚ LIMIT ºÍ ORDER BY ½áºÏʹÓÃʱ¾
- ³£»áʹÓÃË÷Òý£¬ÒòΪֻ»á·µ»Ø±íµÄÒ» С²¿·Ö¡£Êµ¼ÊÉÏ£¬ËäÈ» MAX() ºÍ MIN()
+ Ñ¡Ôñ±íÖнÏС±ÈÀýµÄÐÐʱ²ÉÓÃʹÓÃË÷Òý¡£ÕâÊÇÒòΪË÷ÒýɨÃèÒýÆðµÄËæ¼´´ÅÅÌ´æÈ¡
+ ¿ÉÄܱÈÖ±½ÓµØ¶ÁÈ¡±í£¨Ë³ÐòɨÃ裩¸üÂý¡£ÎªÁËÅжÏÊÇ·ñʹÓÃË÷Òý£¬PostgreSQL
+ ±ØÐë»ñµÃÓйرíµÄͳ¼ÆÖµ¡£ÕâЩͳ¼ÆÖµ¿ÉÒÔʹÓà VACUUM ANALYZE£¬»ò ANALYZE
+ »ñµÃ¡£Ê¹ÓÃͳ¼ÆÖµ£¬ÓÅ»¯Æ÷ÖªµÀ±íÖÐÓжàÉÙÐУ¬¾ÍÄܹ»¸üºÃµØÅжÏÊÇ·ñÀûÓÃË÷Òý
+ ¡£Í³¼ÆÖµ¶ÔÈ·¶¨ÓÅ»¯µÄÁ¬½Ó˳ÐòºÍÁ¬½Ó·½·¨Ò²ºÜÓÐÓá£ÔÚ±íµÄÄÚÈÝ·¢Éú±ä»¯Ê±£¬
+ Ó¦¶¨ÆÚ½øÐÐͳ¼ÆÖµµÄ»ñÈ¡¡£
+
+ Ë÷Òýͨ³£²»ÓÃÓÚ ORDER BY
+ »òÖ´ÐÐÁ¬½Ó¡£¶ÔÒ»¸ö´ó±íµÄÒ»´Î˳ÐòɨÃ裬ÔÙ×öÒ»¸öÏÔʽµÄÅÅÐòͨ³£±ÈË÷ÒýɨÃè
+ Òª¿ì¡£
+
+ µ«ÊÇ£¬ÔÚ LIMIT ºÍ ORDER BY ½áºÏʹÓÃʱ¾
+ ³£»áʹÓÃË÷Òý£¬ÒòΪֻ»á·µ»Ø±íµÄһС²¿·Ö¡£Êµ¼ÊÉÏ£¬ËäÈ» MAX() ºÍ MIN()
²¢²»Ê¹ÓÃË÷Òý£¬Í¨¹ý¶Ô ORDER BY ºÍ LLIMIT
- ʹÓÃË÷ÒýÈ¡µÃ×î´óÖµºÍ×îСֵҲÊÇ¿ÉÒԵģº SELECT col FROM tab ORDER BY
- col [ DESC ] LIMIT 1; µ±Ê¹ÓÃͨÅä·û²Ù×÷£¬ÀýÈç LIKE »ò ~
- ʱ£¬Ë÷ÒýÖ»ÄÜÔÚÌض¨µÄÇé¿öÏÂʹÓ㺠*
- ×Ö·û´®µÄ¿ªÊ¼²¿·Ö±ØÐëÊÇÆÕͨ×Ö·û´®£¬Ò²¾ÍÊÇ˵£º o LIKE ģʽ²»ÄÜÒÔ %
- ´òÍ·¡£ o ~ £¨ÕýÔò±í´ïʽ£©Ä£Ê½±ØÐëÒÔ ^ ´òÍ·¡£ *
- ×Ö·û´®²»ÄÜÒÔÆ¥Åä¶à¸ö×Ö·ûµÄģʽÀà´òÍ·£¬ÀýÈç [a-e]¡£ *
- ´óСдÎ޹صIJéÕÒ£¬Èç ILIKE ºÍ ~* µÈ²»Ê¹ÓÃË÷Òý¡£µ«¿ÉÒÔÓà 4.12 ½ÚÃè
- ÊöµÄº¯ÊýË÷Òý¡£ * ÔÚ×ö initdb ʱ±ØÐë²ÉÓÃȱʡµÄ±¾µØÉèÖà C locale¡£ 4.9)
- ÎÒÈçºÎ²ÅÄÜ¿´µ½²éѯÓÅ»¯Æ÷ÊÇÔõÑù´¦ÀíÎҵIJéѯµÄ£¿ ²Î¿¼ EXPLAIN ÊÖ²áÒ³¡£
- 4.10) R-tree Ë÷ÒýÊÇʲô£¿ R-tree
- Ë÷ÒýÓÃÓÚË÷Òý¿Õ¼äÊý¾Ý¡£Ò»¸ö¹þÏ£Ë÷ÒýÎÞ·¨´¦Àí·¶Î§ËÑË÷¡£¶ø B-tree Ë÷
- ÒýÖ»ÄÜ´¦ÀíһάµÄ·¶Î§ËÑË÷¡£R-tree
- Ë÷Òý¿ÉÒÔ´¦Àí¶àάÊý¾Ý¡£ÀýÈ磬Èç¹û¿ÉÒÔÔÚ Ò»¸öÀàÐÍΪ point
- µÄ×Ö¶ÎÉϽ¨Á¢Ò»¸ö R-tree Ë÷Òý£¬ÄÇôϵͳÄܸü¸ßЧµØ»Ø´ðÀà ËÆ
- ¡°Ñ¡ÔñÔÚÒ»¸ö³¤·½Ðη¶Î§ÄÚµÄËùÓе㡱¡£ ÃèÊö×î³õµÄ R-Tree
- Éè¼ÆµÄÕýʽÂÛÎÄÊÇ£º Guttman, A. "R-Trees: A Dynamic Index Structure for
- Spatial Searching." Proc of the 1984 ACM SIGMOD Int'l Conf on Mgmt of
- Data, 45-57. Ä㻹¿ÉÒÔÔÚ Stonebraker µÄ¡°Readings in Database
- Systems¡±ÀïÕÒµ½ÕâƪÎÄÕ¡£ ϵͳÄÚÖÃµÄ R-Tree
- ¿ÉÒÔ´¦Àí¶à±ßÐκͷ½ÐΡ£ÀíÂÛÉÏ˵£¬R-tree ¿ÉÒÔÀ©Õ¹Îª´¦Àí
- ¸ü¶àάÊý¡£²»¹ýÔÚʵ¼ùÉÏ£¬À©Õ¹ R-trees
- ÐèÒªÒ»¶¨µÄ¹¤×÷Á¿£¬¶øÎÒÃÇĿǰûÓÐÈç ºÎ×öµÄÎĵµ¡£ 4.11)
- ʲôÊÇ»ùÒò²éѯÓÅ»¯£¨Genetic Query Optimization£©£¿ GEQO
- Ä£¿é²ÉÓûùÒòËã·¨£¨Genetic Algorithm£¬GA£©¼Ó¿ì¶à±íÁ¬½ÓµÄ²éѯÓÅ»¯¡£Ëü
- ÔÊÐíͨ¹ý·ÇÇî¾ÙËÑË÷´¦Àí´óµÄÁ¬½Ó²éѯ¡£ 4.12)
- ÎÒÔõÑù×öÕýÔò±í´ïʽËÑË÷ºÍ´óСдÎ޹صÄÕýÔò±í´ïʽËÑË÷£¿ÔõÑùÀû
- ÓÃË÷Òý½øÐдóСдÎÞ¹ØËÑË÷£¿ ²Ù×÷·û ~ ´¦ÀíÕýÔò±í´ïʽƥÅ䣬¶ø ~*
- ´¦Àí´óСдÎ޹صÄÕýÔò±í´ïʽƥÅä¡£´óд ЩÎÞ¹ØµÄ LIKE ±äÖÖ³ÉΪ ILIKE¡£
- ´óСдÎ޹صĵÈʽ±È½Ïͨ³£Ð´×ö£º SELECT * FROM tab WHERE lower(col) =
- 'abc'; ÕâÑù½«²»»áʹÓñê×¼µÄË÷Òý¡£µ«ÊÇ¿ÉÒÔ´´½¨Ò»¸ö¿É±»ÀûÓõĺ¯ÊýË÷Òý:
- CREATE INDEX tabindex ON tab (lower(col)); 4.13)
- ÔÚÒ»¸ö²éѯÀÎÒÔõÑù¼ì²âÒ»¸ö×Ö¶ÎÊÇ·ñΪ NULL£¿ Óà IS NULL ºÍ IS NOT
- NULL ²âÊÔÕâ¸ö×ֶΡ£ 4.14) ¸÷ÖÖ×Ö·ûÀàÐÍÖ®¼äÓÐʲô²»Í¬£¿ ÀàÐÍ ÄÚ²¿Ãû³Æ
- ˵Ã÷ -------------------------------------------------- "char" char
- 1¸ö×Ö·û character CHAR(#) bpchar
- ¶¨³¤×Ö·û´®£¬Êµ¼ÊÊý¾Ý²»×㶨Ò峤¶Èʱ£¬ÒÔ¿Õ¸ñ²¹Æë VARCHAR(#) varchar
- Ö¸¶¨ÁË×î´ó³¤¶È£¬±ä³¤×Ö·û´®£¬²»×㶨Ò峤¶ÈµÄ²¿·Ö ²»²¹Æë TEXT text
- ´®³¤¶È½öÊÜÐеÄ×î´ó³¤¶ÈÏÞÖÆ BYTEA bytea
- ±ä³¤×Ö½ÚÐòÁУ¨±ä³¤µÄ¶þ½øÖÆÊý¾Ý£©
+ ʹÓÃË÷ÒýÈ¡µÃ×î´óÖµºÍ×îСֵҲÊÇ¿ÉÒԵģº
+ SELECT col
+ FROM tab
+ ORDER BY col [ DESC ]
+ LIMIT 1;
+
+ µ±Ê¹ÓÃͨÅä·û²Ù×÷£¬ÀýÈç LIKE »ò ~ ʱ£¬Ë÷ÒýÖ»ÄÜÔÚÌض¨µÄÇé¿öÏÂʹÓãº
+ * ×Ö·û´®µÄ¿ªÊ¼²¿·Ö±ØÐëÊÇÆÕͨ×Ö·û´®£¬Ò²¾ÍÊÇ˵£º
+
+ * LIKE ģʽ²»ÄÜÒÔ % ´òÍ·¡£
+ * ~ £¨ÕýÔò±í´ïʽ£©Ä£Ê½±ØÐëÒÔ ^ ´òÍ·¡£
+
+ ×Ö·û´®²»ÄÜÒÔÆ¥Åä¶à¸ö×Ö·ûµÄģʽÀà´òÍ·£¬ÀýÈç [a-e]¡£
+
+ ´óСдÎ޹صIJéÕÒ£¬Èç ILIKE ºÍ ~* µÈ²»Ê¹ÓÃË÷Òý¡£µ«¿ÉÒÔÓà 4.12
+ ½ÚÃèÊöµÄº¯ÊýË÷Òý¡£
+
+ ÔÚ×ö initdb ʱ±ØÐë²ÉÓÃȱʡµÄ±¾µØÉèÖà C locale¡£
+
+ 4.9) ÎÒÈçºÎ²ÅÄÜ¿´µ½²éѯÓÅ»¯Æ÷ÊÇÔõÑù´¦ÀíÎҵIJéѯµÄ£¿
+
+ ²Î¿¼ EXPLAIN ÊÖ²áÒ³¡£
+
+ 4.10) R-tree Ë÷ÒýÊÇʲô£¿
+
+ R-tree Ë÷ÒýÓÃÓÚË÷Òý¿Õ¼äÊý¾Ý¡£Ò»¸ö¹þÏ£Ë÷ÒýÎÞ·¨´¦Àí·¶Î§ËÑË÷¡£¶ø B-tree
+ Ë÷ÒýÖ»ÄÜ´¦ÀíһάµÄ·¶Î§ËÑË÷¡£R-tree
+ Ë÷Òý¿ÉÒÔ´¦Àí¶àάÊý¾Ý¡£ÀýÈ磬Èç¹û¿ÉÒÔÔÚÒ»¸öÀàÐÍΪ point
+ µÄ×Ö¶ÎÉϽ¨Á¢Ò»¸ö R-tree Ë÷Òý£¬ÄÇôϵͳÄܸü¸ßЧµØ»Ø´ðÀàËÆ
+ ¡°Ñ¡ÔñÔÚÒ»¸ö³¤·½Ðη¶Î§ÄÚµÄËùÓе㡱¡£
+ ÃèÊö×î³õµÄ R-Tree Éè¼ÆµÄÕýʽÂÛÎÄÊÇ£º
+ Guttman, A. "R-Trees: A Dynamic Index Structure for Spatial
+ Searching." Proc of the 1984 ACM SIGMOD Int'l Conf on Mgmt of Data,
+ 45-57.
+ Ä㻹¿ÉÒÔÔÚ Stonebraker µÄ¡°Readings in Database
+ Systems¡±ÀïÕÒµ½ÕâƪÎÄÕ¡£
+ ϵͳÄÚÖÃµÄ R-Tree ¿ÉÒÔ´¦Àí¶à±ßÐκͷ½ÐΡ£ÀíÂÛÉÏ˵£¬R-tree
+ ¿ÉÒÔÀ©Õ¹Îª´¦Àí¸ü¶àάÊý¡£²»¹ýÔÚʵ¼ùÉÏ£¬À©Õ¹ R-trees
+ ÐèÒªÒ»¶¨µÄ¹¤×÷Á¿£¬¶øÎÒÃÇĿǰûÓÐÈçºÎ×öµÄÎĵµ¡£
+
+ 4.11) ʲôÊÇ»ùÒò²éѯÓÅ»¯£¨Genetic Query Optimization£©£¿
+
+ GEQO Ä£¿é²ÉÓûùÒòËã·¨£¨Genetic
+ Algorithm£¬GA£©¼Ó¿ì¶à±íÁ¬½ÓµÄ²éѯÓÅ»¯¡£ËüÔÊÐíͨ¹ý·ÇÇî¾ÙËÑË÷´¦Àí´óµÄÁ¬½
+ Ó²éѯ¡£
+
+ 4.12)
+ ÎÒÔõÑù×öÕýÔò±í´ïʽËÑË÷ºÍ´óСдÎ޹صÄÕýÔò±í´ïʽËÑË÷£¿ÔõÑùÀûÓÃË÷Òý½øÐдóСдÎ
+ Þ¹ØËÑË÷£¿
+
+ ²Ù×÷·û ~ ´¦ÀíÕýÔò±í´ïʽƥÅ䣬¶ø ~*
+ ´¦Àí´óСдÎ޹صÄÕýÔò±í´ïʽƥÅä¡£´óдЩÎÞ¹ØµÄ LIKE ±äÖÖ³ÉΪ ILIKE¡£
+ ´óСдÎ޹صĵÈʽ±È½Ïͨ³£Ð´×ö£º
+ SELECT *
+ FROM tab
+ WHERE lower(col) = 'abc';
+ ÕâÑù½«²»»áʹÓñê×¼µÄË÷Òý¡£µ«ÊÇ¿ÉÒÔ´´½¨Ò»¸ö¿É±»ÀûÓõĺ¯ÊýË÷Òý:
+ CREATE INDEX tabindex ON tab (lower(col));
+
+ 4.13) ÔÚÒ»¸ö²éѯÀÎÒÔõÑù¼ì²âÒ»¸ö×Ö¶ÎÊÇ·ñΪ NULL£¿
+
+ Óà IS NULL ºÍ IS NOT NULL ²âÊÔÕâ¸ö×ֶΡ£
+
+ 4.14) ¸÷ÖÖ×Ö·ûÀàÐÍÖ®¼äÓÐʲô²»Í¬£¿
+
+ ÀàÐÍ ÄÚ²¿Ãû³Æ ˵Ã÷
+ --------------------------------------------------
+ "char" char 1¸ö×Ö·û character
+ CHAR(#) bpchar
+ ¶¨³¤×Ö·û´®£¬Êµ¼ÊÊý¾Ý²»×㶨Ò峤¶Èʱ£¬ÒÔ¿Õ¸ñ²¹Æë
+ VARCHAR(#) varchar
+ Ö¸¶¨ÁË×î´ó³¤¶È£¬±ä³¤×Ö·û´®£¬²»×㶨Ò峤¶ÈµÄ²¿·Ö²»²¹Æë
+ TEXT text ´®³¤¶È½öÊÜÐеÄ×î´ó³¤¶ÈÏÞÖÆ
+ BYTEA bytea ±ä³¤×Ö½ÚÐòÁУ¨±ä³¤µÄ¶þ½øÖÆÊý¾Ý£©
ÔÚϵͳ±íºÍÔÚһЩ´íÎóÐÅÏ¢ÀïÄ㽫¿´µ½ÄÚ²¿Ãû³Æ¡£
- ÉÏÃæ×îºóËÄÖÖÀàÐÍÊÇ"varlena"£¨±ä³¤£©ÀàÐÍ£¨Ò²¾ÍÊÇ˵£¬¿ªÍ·µÄËĸö×Ö½ÚÊdz¤
- ¶È£¬ºóÃæ²ÅÊÇÊý¾Ý£©¡£ÓÚÊÇʵ¼ÊÕ¼ÓõĿռä±ÈÉùÃ÷µÄ´óСҪ¶àһЩ¡£È»¶øÕâЩÀà
- ÐÍ ¶¼¿ÉÒÔ±»Ñ¹Ëõ´æ´¢£¬Ò²¿ÉÒÔÓà TOAST
- ÍÑ»ú´æ´¢£¬Òò´Ë´ÅÅÌ¿Õ¼äÒ²¿ÉÄܱÈÔ¤ÏëµÄÒªÉÙ¡£ CHAR(n)
- ×îÊʺÏÓÚ´æ´¢³¤¶È»ù±¾²î²»¶àµÄ×Ö·û´®¡£VARCHAR(n) ÔÚ´æ´¢ÏÞÖÆÁË×î´ó
- ³¤¶ÈµÄ±ä³¤×Ö·û´®ÊÇ×îºÃµÄ¡£TEXT ÊÊÓÃÓÚ´æ´¢²»ÏÞÖƳ¤¶ÈµÄ×Ö·û´®£¬×î´ó¿É´ï
- 1G¡£BYTEA ÓÃÓÚ´æ´¢¶þ½øÖÆÊý¾Ý£¬ÓÈÆäÊÇ°üº¬ NULL
- ×Ö½Ú£¨¶þ½øÖƵÄ0£©µÄÖµ¡£Õâ ЩÀàÐ;ßÓÐÀàÐ͵ÄÐÔÄÜ¡£ 4.15.1)
- ÎÒÔõÑù´´½¨Ò»¸öÐòÁкÅ/×Ô¶¯µÝÔöµÄ×ֶΣ¿ PostgreSQL Ö§³Ö SERIAL
- Êý¾ÝÀàÐÍ¡£ËüÔÚ×Ö¶ÎÉÏ×Ô¶¯´´½¨Ò»¸öÐòÁкÍË÷Òý¡£ÀýÈ磬 CREATE TABLE person
- ( id SERIAL, name TEXT ); »á×Ô¶¯×ª»»Îª£º CREATE SEQUENCE
- person_id_seq; CREATE TABLE person ( id INT4 NOT NULL DEFAULT
- nextval('person_id_seq'), name TEXT ); CREATE UNIQUE INDEX
- person_id_key ON person ( id ); ²Î¿¼ create_sequence
- ÊÖ²áÒ³»ñÈ¡¹ØÓÚÐòÁеĸü¶àÐÅÏ¢¡£Ä㻹¿ÉÒÔÓÃÿÐÐµÄ oid
- ×Ö¶Î×÷Ϊһ¸öΨһֵ¡£²»¹ý£¬Èç¹ûÄãÐèÒªÇãµ¹ºÍÖØÔØÊý¾Ý¿â£¬ÄãÐèҪʹÓÃ
- pg_dump µÄ -o Ñ¡Ïî»òÕß COPY WITH OIDS Ñ¡ÏîÒÔ±£Áô OID¡£ 4.15.2)
- ÎÒÈçºÎ»ñµÃÒ»¸ö²åÈëµÄÐòÁкŵÄÖµ£¿ Ò»ÖÖ·½·¨ÊÇÔÚ²åÈë֮ǰÏÈÓú¯Êý
- nextval() ´ÓÐòÁжÔÏóÀï¼ìË÷³öÏÂÒ»¸ö SERIAL Öµ£¬È»ºóÔÙÏÔʽ²åÈ롣ʹÓÃ
- 4.15.1 <#4.15.1> ÀïµÄÀý±í£¬¿ÉÓÃαÂëÕâÑùÃèÊö£º new_id = execute("SELECT
- nextval('person_id_seq')"); execute("INSERT INTO person (id, name)
- VALUES (new_id, 'Blaise Pascal')"); ÕâÑù»¹ÄÜÔÚÆäËû²éѯÖÐʹÓôæ·ÅÔÚ
- new_id ÀïµÄÐÂÖµ£¨ÀýÈ磬×÷Ϊ person ±íµÄÍâ ¼ü£©¡£×¢Òâ×Ô¶¯´´½¨µÄ
- SEQUENCE ¶ÔÏóµÄÃû³Æ½«»áÊÇ
-
- __seq£¬ÕâÀï table ºÍ serialcolumn ·Ö±ðÊÇÄãµÄ±íµÄÃû ³ÆºÍÄãµÄ SERIAL
- ×ֶεÄÃû³Æ¡£ ÀàËƵģ¬ÔÚ SERIAL ¶ÔÏóȱʡ²åÈëºóÄã¿ÉÒÔÓú¯Êý currval()
- ¼ìË÷¸Õ¸³ÖµµÄ SERIAL Öµ£¬ÀýÈ磬 execute("INSERT INTO person (name)
- VALUES ('Blaise Pascal')"); new_id = execute("SELECT
- currval('person_id_seq')"); ×îºó£¬Äã¿ÉÒÔʹÓÃ´Ó INSERT Óï¾ä·µ»ØµÄ OID
- <4.16> ²éÕÒȱʡֵ£¬¾¡¹ÜÕâ¿ÉÄÜÊÇ ×îȱ·¦ÒÆÖ²ÐԵķ½·¨¡£ÔÚ Perl
- ÀʹÓôøÓÐ Edmund Mergl µÄ DBD::Pg Ä£¿éµÄ DBI£¬oid Öµ¿ÉÒÔͨ¹ý
- $sth->execute() ºóµÄ $sth->{pg_oid_status} »ñµÃ¡£ 4.15.3) ʹÓÃ
- currval() ºÍ nextval() »áµ¼ÖÂÒ»¸öÓëÆäËûÓû§Ö®¼äµÄÎÉ ÂÒÇé¿öÂð£¿
- ²»»á¡£currval() ·µ»Øºǫ́½ø³Ì¶ø²»ÊÇËùÓÐÓû§¸³ÓèµÄµ±Ç°Öµ¡£ 4.15.4)
- Ϊʲô²»ÔÚÊÂÎñÒì³£ÖÐÖ¹ºóÖØÓÃÐòÁкÅÄØ£¿ÎªÊ²Ã´ÔÚÐòÁкÅ×Ö¶Î
- µÄÈ¡ÖµÖдæÔÚ¼ä¶ÏÄØ£¿
+ ÉÏÃæ×îºóËÄÖÖÀàÐÍÊÇ"varlena"£¨±ä³¤£©ÀàÐÍ£¨Ò²¾ÍÊÇ˵£¬¿ªÍ·µÄËĸö×Ö½ÚÊdz¤¶
+ È£¬ºóÃæ²ÅÊÇÊý¾Ý£©¡£ÓÚÊÇʵ¼ÊÕ¼ÓõĿռä±ÈÉùÃ÷µÄ´óСҪ¶àһЩ¡£È»¶øÕâЩÀàÐ
+ Ͷ¼¿ÉÒÔ±»Ñ¹Ëõ´æ´¢£¬Ò²¿ÉÒÔÓà TOAST
+ ÍÑ»ú´æ´¢£¬Òò´Ë´ÅÅÌ¿Õ¼äÒ²¿ÉÄܱÈÔ¤ÏëµÄÒªÉÙ¡£
+ CHAR(n) ×îÊʺÏÓÚ´æ´¢³¤¶È»ù±¾²î²»¶àµÄ×Ö·û´®¡£VARCHAR(n)
+ ÔÚ´æ´¢ÏÞÖÆÁË×î´ó³¤¶ÈµÄ±ä³¤×Ö·û´®ÊÇ×îºÃµÄ¡£TEXT
+ ÊÊÓÃÓÚ´æ´¢²»ÏÞÖƳ¤¶ÈµÄ×Ö·û´®£¬×î´ó¿É´ï 1G¡£BYTEA
+ ÓÃÓÚ´æ´¢¶þ½øÖÆÊý¾Ý£¬ÓÈÆäÊÇ°üº¬ NULL
+ ×Ö½Ú£¨¶þ½øÖƵÄ0£©µÄÖµ¡£ÕâЩÀàÐ;ßÓÐÀàÐ͵ÄÐÔÄÜ¡£
+
+ 4.15.1) ÎÒÔõÑù´´½¨Ò»¸öÐòÁкÅ/×Ô¶¯µÝÔöµÄ×ֶΣ¿
+
+ PostgreSQL Ö§³Ö SERIAL
+ Êý¾ÝÀàÐÍ¡£ËüÔÚ×Ö¶ÎÉÏ×Ô¶¯´´½¨Ò»¸öÐòÁкÍË÷Òý¡£ÀýÈ磬
+ CREATE TABLE person (
+ id SERIAL,
+ name TEXT
+ );
+ »á×Ô¶¯×ª»»Îª£º
+
+ CREATE SEQUENCE person_id_seq;
+ CREATE TABLE person (
+ id INT4 NOT NULL DEFAULT nextval('person_id_seq'),
+ name TEXT
+ );
+ CREATE UNIQUE INDEX person_id_key ON person ( id );
+ ²Î¿¼ create_sequence ÊÖ²áÒ³»ñÈ¡¹ØÓÚÐòÁеĸü¶àÐÅÏ¢¡£Ä㻹¿ÉÒÔÓÃÿÐеÄ
+ oid ×Ö¶Î×÷Ϊһ¸öΨһֵ¡£²»¹ý£¬Èç¹ûÄãÐèÒªÇãµ¹ºÍÖØÔØÊý¾Ý¿â£¬ÄãÐèҪʹÓÃ
+ pg_dump µÄ -o Ñ¡Ïî»òÕß COPY WITH OIDS Ñ¡ÏîÒÔ±£Áô OID¡£
+
+ 4.15.2) ÎÒÈçºÎ»ñµÃÒ»¸ö²åÈëµÄÐòÁкŵÄÖµ£¿
+
+ Ò»ÖÖ·½·¨ÊÇÔÚ²åÈë֮ǰÏÈÓú¯Êý nextval() ´ÓÐòÁжÔÏóÀï¼ìË÷³öÏÂÒ»¸ö SERIAL
+ Öµ£¬È»ºóÔÙÏÔʽ²åÈ롣ʹÓà 4.15.1 ÀïµÄÀý±í£¬¿ÉÓÃαÂëÕâÑùÃèÊö£º
+ new_id = execute("SELECT nextval('person_id_seq')");
+ execute("INSERT INTO person (id, name) VALUES (new_id, 'Blaise
+ Pascal')");
+ ÕâÑù»¹ÄÜÔÚÆäËû²éѯÖÐʹÓôæ·ÅÔÚ new_id ÀïµÄÐÂÖµ£¨ÀýÈ磬×÷Ϊ person
+ ±íµÄÍâ¼ü£©¡£×¢Òâ×Ô¶¯´´½¨µÄ SEQUENCE ¶ÔÏóµÄÃû³Æ½«»áÊÇ
+ <table>_<serialcolumn>_seq£¬ÕâÀï table ºÍ serialcolumn
+ ·Ö±ðÊÇÄãµÄ±íµÄÃû³ÆºÍÄãµÄ SERIAL ×ֶεÄÃû³Æ¡£
+ ÀàËƵģ¬ÔÚ SERIAL ¶ÔÏóȱʡ²åÈëºóÄã¿ÉÒÔÓú¯Êý currval() ¼ìË÷¸Õ¸³ÖµµÄ
+ SERIAL Öµ£¬ÀýÈ磬
+ execute("INSERT INTO person (name) VALUES ('Blaise Pascal')");
+ new_id = execute("SELECT currval('person_id_seq')");
+ ×îºó£¬Äã¿ÉÒÔʹÓÃ´Ó INSERT Óï¾ä·µ»ØµÄ OID
+ ²éÕÒȱʡֵ£¬¾¡¹ÜÕâ¿ÉÄÜÊÇ×îȱ·¦ÒÆÖ²ÐԵķ½·¨¡£ÔÚ Perl ÀʹÓôøÓÐ
+ Edmund Mergl µÄ DBD::Pg Ä£¿éµÄ DBI£¬oid Öµ¿ÉÒÔͨ¹ý $sth->execute()
+ ºóµÄ $sth->{pg_oid_status} »ñµÃ¡£
+
+ 4.15.3) ʹÓà currval() ºÍ nextval() »áµ¼ÖÂÒ»¸öÓëÆäËûÓû§Ö®¼äµÄÎÉÂÒÇé¿öÂð£¿
+
+ ²»»á¡£currval() ·µ»Øºǫ́½ø³Ì¶ø²»ÊÇËùÓÐÓû§¸³ÓèµÄµ±Ç°Öµ¡£
+
+ 4.15.4)
+ Ϊʲô²»ÔÚÊÂÎñÒì³£ÖÐÖ¹ºóÖØÓÃÐòÁкÅÄØ£¿ÎªÊ²Ã´ÔÚÐòÁкÅ×ֶεÄÈ¡ÖµÖдæÔÚ¼ä¶ÏÄØ£
+ ¿
+
ΪÁËÌá¸ß²¢·¢ÐÔ£¬ÐòÁкÅÔÚÐèÒªµÄʱºò¸³ÓèÕýÔÚÔËÐеÄÊÂÎñ£¬²¢ÇÒÖ»ÔÚÊÂÎñ½áÊø
- Ö® Ç°²»·âËø¡£Õâ¾Í»áµ¼ÖÂزÕÛÊÂÎñºóµÄÐòÁкųöÏÖ¼ä¸ô¡£ 4.16) ʲôÊÇ
- OID£¿Ê²Ã´ÊÇ TID£¿ OID ÊÇ PostgreSQL ÖÐÐеÄΨһ±êʶ¡£PostgreSQL
- Àï´´½¨µÄÿһÐж¼»ñµÃÒ»¸öΨ Ò»µÄ OID¡£ËùÓÐÔÚ initdb ¹ý³ÌÖд´½¨µÄ OID
+ ֮ǰ²»·âËø¡£Õâ¾Í»áµ¼ÖÂزÕÛÊÂÎñºóµÄÐòÁкųöÏÖ¼ä¸ô¡£
+
+ 4.16) ʲôÊÇ OID£¿Ê²Ã´ÊÇ TID£¿
+
+ OID ÊÇ PostgreSQL ÖÐÐеÄΨһ±êʶ¡£PostgreSQL
+ Àï´´½¨µÄÿһÐж¼»ñµÃÒ»¸öΨһµÄ OID¡£ËùÓÐÔÚ initdb ¹ý³ÌÖд´½¨µÄ OID
¶¼Ð¡ÓÚ 16384 £¨²Î¼û include/access/transam.h£©¡£ËùÓÐÓû§´´½¨µÄ OID
- ¶¼´óÓÚ»òµÈÓÚÕâ¸öÖµ¡£È±Ê¡ ʱ£¬ËùÓÐÕâЩ OID
+ ¶¼´óÓÚ»òµÈÓÚÕâ¸öÖµ¡£È±Ê¡Ê±£¬ËùÓÐÕâЩ OID
²»½öÔÚÒ»¸ö±í»òÒ»¸öÊý¾Ý¿âÀïÃæΨһ£¬¶øÇÒÔÚÕû¸ö PostgreSQL
- °²×°ÀïÒ²ÊÇΨһµÄ¡£ PostgreSQL ÔÚËüµÄÄÚ²¿ÏµÍ³±íÀïʹÓà OID
- ÔÚ±íÖ®¼ä½¨Á¢ÁªÏµ¡£ÕâЩ OID ¿ÉÒÔÓÃ
- ÓÚ±êʶÌض¨µÄÓû§ÐÐÒÔ¼°ÓÃÔÚÁ¬½ÓÀï¡£½¨ÒéʹÓÃ×Ö¶ÎÀàÐÍ OID ´æ´¢ OID
- Öµ¡£¿ÉÒÔ ÔÚ OID ×Ö¶ÎÉÏ´´½¨Ò»¸öË÷ÒýÒÔ¿ìËÙ·ÃÎÊ¡£ OID
- ´ÓÒ»¸ö±»ËùÓÐÊý¾Ý¿âʹÓõÄÖÐÐÄÇøÓòÀ︳ֵ¸øËùÓÐÐÂÐС£Èç¹ûÄãÏë°Ñ OID ¸Ä
- ³É±ðµÄÖµ£¬»òÕßÏë×öÒ»·Ý±íµÄ´øÔʼ OID µÄ¿½±´£¬Äã¿ÉÒÔ×öµ½£º CREATE TABLE
- new(old_oid oid, mycol int); SELECT old_oid, mycol INTO new FROM old;
- COPY new TO '/tmp/pgtable'; DELETE FROM new; COPY new WITH OIDS FROM
- '/tmp/pgtable'; OID
- ÓÃ4×Ö½ÚµÄÕûÊý±£´æ£¬ÔÚ³¬¹ý40ÒÚʱ½«Òç³ö¡£Ã»ÓÐÈ˱¨¸æ³öÏÖ¹ýÒç³ö£¬¶øÎÒÃÇ
- ´òËãÔÚÓÐÈ˱¨¸æ֮ǰÏû³ýÕâ¸öÏÞÖÆ¡£ TID
- ÓÃÓÚ±êʶ´ø×ÅÊý¾Ý¿é£¨µØÖ·£©ºÍ£¨¿éÄÚ£©Æ«ÒƵÄÌض¨µÄÎïÀíÐС£TID ÔÚÐб»¸ü
- ¸Ä»òÖØÔغó·¢Éú¸Ä±ä¡£Ë÷ÒýÈë¿ÚʹÓÃËüÃÇÖ¸ÏòÎïÀíÐС£ 4.17) PostgreSQL
- ʹÓõÄһЩÊõÓïµÄº¬ÒåÊÇʲô£¿
+ °²×°ÀïÒ²ÊÇΨһµÄ¡£
+ PostgreSQL ÔÚËüµÄÄÚ²¿ÏµÍ³±íÀïʹÓà OID ÔÚ±íÖ®¼ä½¨Á¢ÁªÏµ¡£ÕâЩ OID
+ ¿ÉÒÔÓÃÓÚ±êʶÌض¨µÄÓû§ÐÐÒÔ¼°ÓÃÔÚÁ¬½ÓÀï¡£½¨ÒéʹÓÃ×Ö¶ÎÀàÐÍ OID ´æ´¢ OID
+ Öµ¡£¿ÉÒÔÔÚ OID ×Ö¶ÎÉÏ´´½¨Ò»¸öË÷ÒýÒÔ¿ìËÙ·ÃÎÊ¡£
+ OID ´ÓÒ»¸ö±»ËùÓÐÊý¾Ý¿âʹÓõÄÖÐÐÄÇøÓòÀ︳ֵ¸øËùÓÐÐÂÐС£Èç¹ûÄãÏë°Ñ OID
+ ¸Ä³É±ðµÄÖµ£¬»òÕßÏë×öÒ»·Ý±íµÄ´øÔʼ OID µÄ¿½±´£¬Äã¿ÉÒÔ×öµ½£º
+ CREATE TABLE new(old_oid oid, mycol int);
+ SELECT old_oid, mycol INTO new FROM old;
+ COPY new TO '/tmp/pgtable';
+ DELETE FROM new;
+ COPY new WITH OIDS FROM '/tmp/pgtable';
+ OID
+ ÓÃ4×Ö½ÚµÄÕûÊý±£´æ£¬ÔÚ³¬¹ý40ÒÚʱ½«Òç³ö¡£Ã»ÓÐÈ˱¨¸æ³öÏÖ¹ýÒç³ö£¬¶øÎÒÃÇ´òË
+ ãÔÚÓÐÈ˱¨¸æ֮ǰÏû³ýÕâ¸öÏÞÖÆ¡£
+ TID ÓÃÓÚ±êʶ´ø×ÅÊý¾Ý¿é£¨µØÖ·£©ºÍ£¨¿éÄÚ£©Æ«ÒƵÄÌض¨µÄÎïÀíÐС£TID
+ ÔÚÐб»¸ü¸Ä»òÖØÔغó·¢Éú¸Ä±ä¡£Ë÷ÒýÈë¿ÚʹÓÃËüÃÇÖ¸ÏòÎïÀíÐС£
+
+ 4.17) PostgreSQL ʹÓõÄһЩÊõÓïµÄº¬ÒåÊÇʲô£¿
+
һЩԴ´úÂëºÍһЩ¾ÉÒ»µãµÄÎĵµÊ¹ÓÃһЩÓиü³£ÓÃÓ÷¨µÄÊõÓï¡£ÏÂÃæÊÇÆäÖÐÒ»²¿
- ·Ö£º table, relation, class row, record, tuple column, field,
- attribute retrieve, select replace, update append, insert OID, serial
- value portal, cursor range variable, table name, table alias
- ÓÐÒ»¸öͨÓÃÊý¾Ý¿âÊõÓïµÄÁÐ±í£ºhttp://hea-
- www.harvard.edu/MST/simul/software/docs/pkgs/pgsql/glossary/glossary.h
- tml ¡£ 4.18) ΪʲôÎÒÊÕµ½´íÎó¡°/ERROR: Memory exhausted in
- AllocSetAlloc()/¡±£¿
+ ·Ö£º
+ table, relation, class
+ row, record, tuple
+ column, field, attribute
+ retrieve, select
+ replace, update
+ append, insert
+ OID, serial value
+ portal, cursor
+ range variable, table name, table alias
+ ÓÐÒ»¸öͨÓÃÊý¾Ý¿âÊõÓïµÄÁÐ±í£ºhttp://hea-www.harvard.edu/MST/simul/softw
+ are/docs/pkgs/pgsql/glossary/glossary.html ¡£
+
+ 4.18) ΪʲôÎÒÊÕµ½´íÎó¡°ERROR: Memory exhausted in AllocSetAlloc()¡±£¿
+
ÕâºÜ¿ÉÄÜÊÇϵͳµÄÐéÄâÄÚ´æÓùâÁË£¬»òÕßÄں˶ÔijЩ×ÊÔ´Óнϵ͵ÄÏÞÖÆÖµ¡£ÔÚÆô
- ¶¯ postmaster ֮ǰÊÔÊÔÏÂÃæµÄÃüÁ ulimit -d 262144 limit datasize
- 256m È¡¾öÓÚÄãÓõÄ
- shell£¬ÉÏÃæÃüÁîÖ»ÓÐÒ»ÌõÄܳɹ¦£¬µ«ÊÇËü½«°ÑÄãµÄ½ø³ÌÊý¾Ý¶ÎÏÞÖÆ
- ÉèµÃ±È½Ï¸ß£¬Òò¶øÒ²ÐíÄÜÈòéѯÍê³É¡£ÕâÌõÃüÁîÓ¦ÓÃÓÚµ±Ç°½ø³Ì£¬ÒÔ¼°ËùÓÐÔÚÕâ
- Ìõ
- ÃüÁîÔËÐк󴴽¨µÄ×Ó½ø³Ì¡£Èç¹ûÄãÊÇÔÚÔËÐÐSQL¿Í»§¶ËʱÒòΪºǫ́·µ»ØÁËÌ«¶àµÄÊ
- ý ¾Ý¶ø³öÏÖÎÊÌ⣬ÇëÔÚÔËÐпͻ§¶Ë֮ǰִÐÐÉÏÊöÃüÁî¡£ 4.19)
- ÎÒÈçºÎ²ÅÄÜÖªµÀËùÔËÐÐµÄ PostgreSQL µÄ°æ±¾£¿ ´Ó psql À¼üÈë SELECT
- version()£» 4.20) ΪʲôÎҵĴó¶ÔÏó²Ù×÷µ¼Ö´íÎó¡°/invalid large obj
- descriptor¡±£¨·Ç·¨µÄ´ó¶ÔÏóÃèÊö·û£©/£¿
+ ¶¯ postmaster ֮ǰÊÔÊÔÏÂÃæµÄÃüÁ
+ ulimit -d 262144
+ limit datasize 256m
+ È¡¾öÓÚÄãÓõÄ
+ shell£¬ÉÏÃæÃüÁîÖ»ÓÐÒ»ÌõÄܳɹ¦£¬µ«ÊÇËü½«°ÑÄãµÄ½ø³ÌÊý¾Ý¶ÎÏÞÖÆÉèµÃ±È½Ï¸ß£
+ ¬Òò¶øÒ²ÐíÄÜÈòéѯÍê³É¡£ÕâÌõÃüÁîÓ¦ÓÃÓÚµ±Ç°½ø³Ì£¬ÒÔ¼°ËùÓÐÔÚÕâÌõÃüÁîÔËÐк
+ ó´´½¨µÄ×Ó½ø³Ì¡£Èç¹ûÄãÊÇÔÚÔËÐÐSQL¿Í»§¶ËʱÒòΪºǫ́·µ»ØÁËÌ«¶àµÄÊý¾Ý¶ø³öÏÖ
+ ÎÊÌ⣬ÇëÔÚÔËÐпͻ§¶Ë֮ǰִÐÐÉÏÊöÃüÁî¡£
+
+ 4.19) ÎÒÈçºÎ²ÅÄÜÖªµÀËùÔËÐÐµÄ PostgreSQL µÄ°æ±¾£¿
+
+ ´Ó psql À¼üÈë SELECT version()£»
+
+ 4.20) ΪʲôÎҵĴó¶ÔÏó²Ù×÷µ¼Ö´íÎó¡°invalid large obj
+ descriptor¡±£¨·Ç·¨µÄ´ó¶ÔÏóÃèÊö·û£©£¿
+
ÄãÐèÒªÔÚʹÓÃÈκδó¶ÔÏó¾ä±úµÄÇ°ºó·ÅÉÏ BEGIN WORK ºÍ
- COMMIT£¬Ò²¾ÍÊÇ˵£¬°ü Χ lo_open ... lo_close¡£ Ä¿Ç° PostgreSQL
- Ç¿ÖÆʵʩÕâÌõ¹æÔò£ºÔÚÊÂÎñÌύʱ¹Ø±Õ´ó¶ÔÏó¾ä±ú£¬ÕâÑù£¬£¨Ã»
- ÓвÉÓÃÊÂÎñʱ£©£¬Ê״ζԴó¶ÔÏó¾ä±ú×öÈκÎÊÂÇéµÄÆóͼ¶¼»áµ¼ÖÂÒ»¸ö invalid
- large obj
- descriptor¡£ËùÒÔ£¬Èç¹ûÄãûÓÐʹÓÃÒ»¸öÊÂÎñ£¬ÒÔÇ°Äܹ¤×÷µÄ´úÂ루ÖÁ
- ÉÙÊÇ´ó¶àÊýʱ¼ä£©½«»áÉú³ÉÕâôһ¸ö´íÎóÐÅÏ¢¡£ Èç¹ûÄãʹÓÿͻ§¶Ë½Ó¿Ú£¬Èç
- ODBC£¬Äã¿ÉÄÜÐèÒª set auto-commit off¡£ 4.21)
- ÎÒÈçºÎ´´½¨Ò»¸öȱʡֵÊǵ±Ç°Ê±¼äµÄ×ֶΣ¿ ʹÓà CURRENT_TIMESTAMP£º CREATE
- TABLE test(x int, modtime timestamp DEFAULT CURRENT_TIMESTAMP); 4.22)
- ΪʲôʹÓà IN µÄ×Ó²éѯÕâôÂý£¿
+ COMMIT£¬Ò²¾ÍÊÇ˵£¬°üΧ lo_open ... lo_close¡£
+ Ŀǰ PostgreSQL
+ Ç¿ÖÆʵʩÕâÌõ¹æÔò£ºÔÚÊÂÎñÌύʱ¹Ø±Õ´ó¶ÔÏó¾ä±ú£¬ÕâÑù£¬£¨Ã»ÓвÉÓÃÊÂÎñʱ£©
+ £¬Ê״ζԴó¶ÔÏó¾ä±ú×öÈκÎÊÂÇéµÄÆóͼ¶¼»áµ¼ÖÂÒ»¸ö invalid large obj
+ descriptor¡£ËùÒÔ£¬Èç¹ûÄãûÓÐʹÓÃÒ»¸öÊÂÎñ£¬ÒÔÇ°Äܹ¤×÷µÄ´úÂ루ÖÁÉÙÊÇ´ó¶à
+ Êýʱ¼ä£©½«»áÉú³ÉÕâôһ¸ö´íÎóÐÅÏ¢¡£
+ Èç¹ûÄãʹÓÿͻ§¶Ë½Ó¿Ú£¬Èç ODBC£¬Äã¿ÉÄÜÐèÒª set auto-commit off¡£
+
+ 4.21) ÎÒÈçºÎ´´½¨Ò»¸öȱʡֵÊǵ±Ç°Ê±¼äµÄ×ֶΣ¿
+
+ ʹÓà CURRENT_TIMESTAMP£º
+ CREATE TABLE test(x int, modtime timestamp DEFAULT
+ CURRENT_TIMESTAMP);
+
+ 4.22) ΪʲôʹÓà IN µÄ×Ó²éѯÕâôÂý£¿
+
Ä¿Ç°£¬ÎÒÃÇͨ¹ýΪÍâ²éѯµÄÿһÐÐ˳ÐòɨÃè×Ó²éѯµÄ½á¹ûÀ´Á¬½Ó×Ó²éѯºÍÍâ²éѯ
- ¡£ Èç¹û×Ó²éѯ·µ»ØÉÙÊý¼¸ÐУ¬¶øÍâ²éѯ·µ»ØºÜ¶àÐУ¬IN
- Ö´Ðеúܿ졣ΪÁ˼ӿìÆäËû IN ²éѯµÄÖ´ÐУ¬¿ÉÒÔÓà EXISTS Ìæ»» IN£º SELECT
- * FROM tab WHERE col IN (SELECT subcol FROM subtab); ¸ÄΪ£º SELECT *
- FROM tab WHERE EXISTS (SELECT subcol FROM subtab WHERE subcol = col);
+ ¡£Èç¹û×Ó²éѯ·µ»ØÉÙÊý¼¸ÐУ¬¶øÍâ²éѯ·µ»ØºÜ¶àÐУ¬IN
+ Ö´Ðеúܿ졣ΪÁ˼ӿìÆäËû IN ²éѯµÄÖ´ÐУ¬¿ÉÒÔÓà EXISTS Ìæ»» IN£º
+ SELECT *
+ FROM tab
+ WHERE col IN (SELECT subcol FROM subtab);
+ ¸ÄΪ£º
+ SELECT *
+ FROM tab
+ WHERE EXISTS (SELECT subcol FROM subtab WHERE subcol = col);
ºóÕßÒªÏëÖ´Ðеøü¿ì£¬subcol
- Ó¦¸ÃÊÇÒ»¸öË÷ÒýÁС£ÎÒÃÇÏ£ÍûÔÚδÀ´µÄ·¢²¼°æ±¾ÖÐ ÐÞ²¹Õâ¸öÏÞÖÆ¡£ 4.23)
- ÎÒÔõÑù½øÐÐ outer join £¨ÍâÁ¬½Ó£©£¿ PostgreSQL ²ÉÓñê×¼µÄ SQL
- Óï·¨Ö§³ÖÍâÁ¬½Ó¡£ÕâÀïÊÇÁ½¸öÀý×Ó£º SELECT * FROM t1 LEFT OUTER JOIN t2
- ON (t1.col = t2.col); »ò SELECT * FROM t1 LEFT OUTER JOIN t2 USING
- (col); ÕâÁ½¸öµÈ¼ÛµÄ²éѯÔÚ t1.col ºÍ t2.col ÉÏ×öÁ¬½Ó£¬²¢ÇÒ·µâ»?t1
- ÖÐËùÓÐδÁ¬½ÓµÄ ÐУ¨ÄÇЩÔÚ t2 ÖÐûÓÐÆ¥ÅäµÄÐУ©¡£ÓÒ[Íâ]Á¬½Ó(RIGHT OUTER
- JOIN)½«·µ»Ø t2 ÖРδÁ¬½ÓµÄÐС£ÍêÈ«ÍâÁ¬½Ó£¨FULL OUTER JOIN£©½«·µ»Ø t1
- ºÍ t2 ÖÐδÁ¬½ÓµÄÐС£ ¹Ø¼ü×Ö OUTER
- ÔÚ×ó[Íâ]Á¬½Ó¡¢ÓÒ[Íâ]Á¬½ÓºÍÍêÈ«[Íâ]Á¬½ÓÖÐÊÇ¿ÉÑ¡µÄ£¬ÆÕͨÁ¬½Ó
- ±»³ÉΪÄÚÁ¬½Ó£¨INNER JOIN£©¡£ ÔÚ´ËÇ°µÄ°æ±¾ÖУ¬ÍâÁ¬½Ó¿ÉÒÔÓà UNION ºÍ NOT
- IN À´Ä£Äâ¡£ÀýÈ磬ÏÂÃæµÄÀý×ÓÔÚ ±í tab1 ºÍ tab2 Ö®¼ä×öÍâÁ¬½Ó£º SELECT
- tab1.col1, tab2.col2 FROM tab1, tab2 WHERE tab1.col1 = tab2.col1 UNION
- ALL SELECT tab1.col1, NULL FROM tab1 WHERE tab1.col1 NOT IN (SELECT
- tab2.col1 FROM tab2) ORDER BY col1 4.24)
- ÈçºÎʹÓÃÉæ¼°¶à¸öÊý¾Ý¿âµÄ²éѯ£¿
+ Ó¦¸ÃÊÇÒ»¸öË÷ÒýÁС£ÎÒÃÇÏ£ÍûÔÚδÀ´µÄ·¢²¼°æ±¾ÖÐÐÞ²¹Õâ¸öÏÞÖÆ¡£
+
+ 4.23) ÎÒÔõÑù½øÐÐ outer join £¨ÍâÁ¬½Ó£©£¿
+
+ PostgreSQL ²ÉÓñê×¼µÄ SQL Óï·¨Ö§³ÖÍâÁ¬½Ó¡£ÕâÀïÊÇÁ½¸öÀý×Ó£º
+ SELECT *
+ FROM t1 LEFT OUTER JOIN t2 ON (t1.col = t2.col);
+ »ò
+ SELECT *
+ FROM t1 LEFT OUTER JOIN t2 USING (col);
+ ÕâÁ½¸öµÈ¼ÛµÄ²éѯÔÚ t1.col ºÍ t2.col ÉÏ×öÁ¬½Ó£¬²¢ÇÒ·µâ»?t1
+ ÖÐËùÓÐδÁ¬½ÓµÄÐУ¨ÄÇЩÔÚ t2 ÖÐûÓÐÆ¥ÅäµÄÐУ©¡£ÓÒ[Íâ]Á¬½Ó(RIGHT OUTER
+ JOIN)½«·µ»Ø t2 ÖÐδÁ¬½ÓµÄÐС£ÍêÈ«ÍâÁ¬½Ó£¨FULL OUTER JOIN£©½«·µ»Ø t1 ºÍ
+ t2 ÖÐδÁ¬½ÓµÄÐС£¹Ø¼ü×Ö OUTER
+ ÔÚ×ó[Íâ]Á¬½Ó¡¢ÓÒ[Íâ]Á¬½ÓºÍÍêÈ«[Íâ]Á¬½ÓÖÐÊÇ¿ÉÑ¡µÄ£¬ÆÕͨÁ¬½Ó±»³ÉΪÄÚÁ¬½Ó
+ £¨INNER JOIN£©¡£
+ ÔÚ´ËÇ°µÄ°æ±¾ÖУ¬ÍâÁ¬½Ó¿ÉÒÔÓà UNION ºÍ NOT IN
+ À´Ä£Äâ¡£ÀýÈ磬ÏÂÃæµÄÀý×ÓÔÚ±í tab1 ºÍ tab2 Ö®¼ä×öÍâÁ¬½Ó£º
+ SELECT tab1.col1, tab2.col2
+ FROM tab1, tab2
+ WHERE tab1.col1 = tab2.col1
+ UNION ALL
+ SELECT tab1.col1, NULL
+ FROM tab1
+ WHERE tab1.col1 NOT IN (SELECT tab2.col1 FROM tab2)
+ ORDER BY col1
+
+ 4.24) ÈçºÎʹÓÃÉæ¼°¶à¸öÊý¾Ý¿âµÄ²éѯ£¿
+
ûÓа취²éѯµ±Ç°Êý¾Ý¿âÖ®ÍâµÄÊý¾Ý¿â¡£ÒòΪ PostgreSQL
- ¼ÓÔØÊý¾Ý¿âÏà¹ØµÄϵͳ Ŀ¼£¨ÏµÍ³±í£©£¬¿çÊý¾Ý¿âµÄ²éѯÈçºÎÖ´ÐÐҲδÃ÷È·¡£
+ ¼ÓÔØÊý¾Ý¿âÏà¹ØµÄϵͳĿ¼£¨ÏµÍ³±í£©£¬¿çÊý¾Ý¿âµÄ²éѯÈçºÎÖ´ÐÐҲδÃ÷È·¡£
contrib/dblink
- ÔÊÐí²ÉÓú¯Êýµ÷ÓÃʵÏÖ¿ç¿â²éѯ¡£µ±È»¿ÉÒÔͬʱÁ¬½Óµ½²»Í¬µÄÊý
- ¾Ý¿â²¢ÔÚ¿Í»§¶ËºÏ²¢½á¹û¡£ 4.25) ÈçºÎÈú¯Êý·µ»Ø¶àÐлò¶àÁУ¿ ¿ÉÒÔÔÚ
- PL/pgSQL º¯ÊýÖÐʹÓà refcursors ·µ»Ø½á¹û¼¯¡£²Î¿´
- http://www.PostgreSQL.org/idocs/index.php?plpgsql-cursors.html
- www.PostgreSQL.org/idocs/index.php?plpgsql-cursors.html>, 23.7.3.3½Ú¡£
- 4.26) ΪʲôÔÚ PL/PgSQL º¯ÊýÖв»ÄÜ¿É¿¿µØ´´½¨»òɾ³ýÁÙʱ±í£¿ PL/PgSQL
- »º´æº¯ÊýµÄÄÚÈÝ£¬ÓÉ´Ë´øÀ´µÄÒ»¸ö²»ºÃµÄ¸±×÷ÓÃÊÇÈôÒ»¸ö PL/PgSQL º¯
- Êý·ÃÎÊÁËÒ»¸öÁÙʱ±í£¬È»ºó¸Ã±í±»É¾³ý²¢Öؽ¨ÁË£¬ÔòÔٴε÷Óøú¯Êý½«Ê§°Ü£¬Òò
- Ϊ »º´æµÄº¯ÊýÄÚÈÝÈÔȻָÏò¾ÉµÄÁÙʱ±í¡£½â¾öµÄ·½·¨ÊÇÔÚ PL/PgSQL ÖÐÓÃ
- EXECUTE ¶ÔÁÙʱ±í½øÐзÃÎÊ¡£ÕâÑù»á±£Ö¤²éѯÔÚÖ´ÐÐÇ°×ÜÊÇÖØзÖÎö¡£ 4.27)
- ÓÐÄÄЩÊý¾Ý¸´ÖÆÑ¡Ï
+ ÔÊÐí²ÉÓú¯Êýµ÷ÓÃʵÏÖ¿ç¿â²éѯ¡£µ±È»¿ÉÒÔͬʱÁ¬½Óµ½²»Í¬µÄÊý¾Ý¿â²¢ÔÚ¿Í»§¶Ë
+ ºÏ²¢½á¹û¡£
+
+ 4.25) ÈçºÎÈú¯Êý·µ»Ø¶àÐлò¶àÁУ¿
+
+ ¿ÉÒÔÔÚ PL/pgSQL º¯ÊýÖÐʹÓà refcursors ·µ»Ø½á¹û¼¯¡£²Î¿´
+ http://www.PostgreSQL.org/idocs/index.php?plpgsql-cursors.html,
+ 23.7.3.3½Ú¡£
+
+ 4.26) ΪʲôÔÚ PL/PgSQL º¯ÊýÖв»ÄÜ¿É¿¿µØ´´½¨»òɾ³ýÁÙʱ±í£¿
+
+ PL/PgSQL »º´æº¯ÊýµÄÄÚÈÝ£¬ÓÉ´Ë´øÀ´µÄÒ»¸ö²»ºÃµÄ¸±×÷ÓÃÊÇÈôÒ»¸ö PL/PgSQL
+ º¯Êý·ÃÎÊÁËÒ»¸öÁÙʱ±í£¬È»ºó¸Ã±í±»É¾³ý²¢Öؽ¨ÁË£¬ÔòÔٴε÷Óøú¯Êý½«Ê§°Ü£¬
+ ÒòΪ»º´æµÄº¯ÊýÄÚÈÝÈÔȻָÏò¾ÉµÄÁÙʱ±í¡£½â¾öµÄ·½·¨ÊÇÔÚ PL/PgSQL ÖÐÓÃ
+ EXECUTE ¶ÔÁÙʱ±í½øÐзÃÎÊ¡£ÕâÑù»á±£Ö¤²éѯÔÚÖ´ÐÐÇ°×ÜÊÇÖØзÖÎö¡£
+
+ 4.27) ÓÐÄÄЩÊý¾Ý¸´ÖÆÑ¡Ï
+
Óм¸ÖÖÖ÷/´Ó·½Ê½µÄ¸´ÖÆÑ¡Ïî¡£ÕâЩѡÏîÖ»ÔÊÐíÖ÷Êý¾Ý¿â½øÐиüУ¬´ÓÊý¾Ý¿âÖ»Ä
- Ü ½øÐжÁ¡£ÍøÒ³
+ ܽøÐжÁ¡£ÍøÒ³
http://gborg.PostgreSQL.org/genpage?replication_research
µÄ×îºóÁгöÁËÕâЩѡÏî¡£ÔÚ
http://gborg.PostgreSQL.org/project/pgreplication/projdisplay.php
- gborg.PostgreSQL.org/project/pgreplication/projdisplay.php> ÕýÔÚ
- ½øÐÐÒ»¸ö¶àÖ÷±¾¸´ÖƵĽâ¾ö·½°¸¡£ 4.28) ÓÐÄÄЩÊý¾Ý¼ÓÃÜÑ¡Ï
+ ÕýÔÚ½øÐÐÒ»¸ö¶àÖ÷±¾¸´ÖƵĽâ¾ö·½°¸¡£
+
+ 4.28) ÓÐÄÄЩÊý¾Ý¼ÓÃÜÑ¡Ï
+
contrib/pgcrypto °üº¬Á˺ܶàÔÚ SQL
- ²éѯÖÐʹÓõļÓÃܺ¯Êý¡£¼ÓÃÜ¿Í»§¶Ëµ½·þÎñ Æ÷¶Ë´«ÊäÊý¾ÝµÄΨһ·½·¨ÊÇÔÚ
- pg_hba.conf ÖвÉÓà hostss ¡£ 7.3
- °æ±¾ÖÐ×Ô¶¯¶ÔÊý¾Ý¿âÓû§ÃÜÂë½øÐмÓÃÜ¡£ÔÚÒÔÇ°µÄ°æ±¾ÖУ¬±ØÐëÔÚ
+ ²éѯÖÐʹÓõļÓÃܺ¯Êý¡£¼ÓÃÜ¿Í»§¶Ëµ½·þÎñÆ÷¶Ë´«ÊäÊý¾ÝµÄΨһ·½·¨ÊÇÔÚ
+ pg_hba.conf ÖвÉÓà hostss ¡£
+ 7.3 °æ±¾ÖÐ×Ô¶¯¶ÔÊý¾Ý¿âÓû§ÃÜÂë½øÐмÓÃÜ¡£ÔÚÒÔÇ°µÄ°æ±¾ÖУ¬±ØÐëÔÚ
postgresql.conf Öдò¿ª PASSWORD_ENCRYPTION
- Ñ¡Ïî¡£·þÎñÆ÷¿ÉÒÔÔËÐÐÔÚ¼ÓÃÜµÄ ÎļþϵͳÉÏ£¨ÒÔ´ïµ½¼ÓÃܵÄÄ¿µÄ£©¡£
+ Ñ¡Ïî¡£·þÎñÆ÷¿ÉÒÔÔËÐÐÔÚ¼ÓÃܵÄÎļþϵͳÉÏ£¨ÒÔ´ïµ½¼ÓÃܵÄÄ¿µÄ£©¡£
----------------------------------------------------------------------
- ---------- À©Õ¹ PostgreSQL 5.1) ÎÒдÁËÒ»¸öÓû§¶¨Ò庯Êý¡£µ±ÎÒÔÚ psql
- ÀïÔËÐÐʱ£¬ÎªÊ²Ã´»áµ¼Ö core dump£¿ ²úÉúÕâ¸öÎÊÌâµÄÔ
- ÒòºÜ¶à¡£ÇëÏÈÔÚÒ»¸öµ¥¶ÀµÄ²âÊÔ³ÌÐòÖвâÊÔÄãµÄ×Ô¶¨Ò庯Êý¡£ 5.2) ÎÒÈçºÎÄܸø
- PostgreSQL ¹±Ï×һЩͦ²»´íµÄÐÂÀàÐͺͺ¯Êý£¿ ½«ÄãµÄÀ©Õ¹·¢Ë͵½
- pgsql-hackers ÓʼþÁÐ±í£¬ËüÃÇ×îÖջᱻ·Åµ½ contrib/ ×ÓĿ¼¡£ 5.3)
- ÎÒÔõÑùдһ¸ö·µ»ØÒ»ÌõÔª×éµÄ C º¯Êý£¿ ÔÚ PostgreSQL 7.3 ÒÔºóµÄ°æ±¾ÖУ¬C,
- PL/PgSQL ºÍ SQL ÍêÈ«Ö§³Ö·µ»ØֵΪ±íµÄ º¯Êý¡£¸ü¶àÐÅÏ¢Çë²Î¿¼
- ³ÌÐòÔ±Ö¸ÄÏ£¨the Programmer's Guide£©¡£ÔÚ contrib/tablefunc
- ÖÐÓÐÒ»¸öÀý×ÓÊÇÓà C дµÄ·µ»ØֵΪ±íµÄº¯Êý¡£ 5.4)
- ÎÒÐÞ¸ÄÁËÒ»¸öÔ´Îļþ£¬ÎªÊ²Ã´ÖØбàÒëºóûÓп´µ½¸Ä±ä£¿ Makefiles
- ÖÐûÓаüº¬Í·ÎļþµÄÕýÈ·ÒÀÀµ¡£Äú±ØÐëÏÈ×ömake clean£¬ ÔÙ×öÒ»´Î make
- ¡£Èç¹ûÄúʹÓõÄÊÇ GCC £¬Ôò¿ÉÒÔ²ÉÓÃÑ¡Ïî --enable-depend ÈñàÒëÆ÷×Ô¶¯
- Éú³ÉÍ·ÎļþµÄÒÀÀµ¹Øϵ¡£
+ ----------
+
+ À©Õ¹ PostgreSQL
+
+ 5.1) ÎÒдÁËÒ»¸öÓû§¶¨Ò庯Êý¡£µ±ÎÒÔÚ psql ÀïÔËÐÐʱ£¬ÎªÊ²Ã´»áµ¼Ö core dump£¿
+
+ ²úÉúÕâ¸öÎÊÌâµÄÔÒòºÜ¶à¡£ÇëÏÈÔÚÒ»¸öµ¥¶ÀµÄ²âÊÔ³ÌÐòÖвâÊÔÄãµÄ×Ô¶¨Ò庯Êý¡£
+
+ 5.2) ÎÒÈçºÎÄܸø PostgreSQL ¹±Ï×һЩͦ²»´íµÄÐÂÀàÐͺͺ¯Êý£¿
+
+ ½«ÄãµÄÀ©Õ¹·¢Ë͵½ pgsql-hackers ÓʼþÁÐ±í£¬ËüÃÇ×îÖջᱻ·Åµ½ contrib/
+ ×ÓĿ¼¡£
+
+ 5.3) ÎÒÔõÑùдһ¸ö·µ»ØÒ»ÌõÔª×éµÄ C º¯Êý£¿
+
+ ÔÚ PostgreSQL 7.3 ÒÔºóµÄ°æ±¾ÖУ¬C, PL/PgSQL ºÍ SQL
+ ÍêÈ«Ö§³Ö·µ»ØֵΪ±íµÄº¯Êý¡£¸ü¶àÐÅÏ¢Çë²Î¿¼ ³ÌÐòÔ±Ö¸ÄÏ£¨the Programmer's
+ Guide£©¡£ÔÚ contrib/tablefunc ÖÐÓÐÒ»¸öÀý×ÓÊÇÓà C
+ дµÄ·µ»ØֵΪ±íµÄº¯Êý¡£
+
+ 5.4) ÎÒÐÞ¸ÄÁËÒ»¸öÔ´Îļþ£¬ÎªÊ²Ã´ÖØбàÒëºóûÓп´µ½¸Ä±ä£¿
+
+ Makefiles ÖÐûÓаüº¬Í·ÎļþµÄÕýÈ·ÒÀÀµ¡£Äú±ØÐëÏÈ×ömake clean£¬ ÔÙ×öÒ»´Î
+ make ¡£Èç¹ûÄúʹÓõÄÊÇ GCC £¬Ôò¿ÉÒÔ²ÉÓÃÑ¡Ïî --enable-depend
+ ÈñàÒëÆ÷×Ô¶¯Éú³ÉÍ·ÎļþµÄÒÀÀµ¹Øϵ¡£
-\r
- PostgreSQL ³£¼ûÎÊÌ⣨FAQ£©\r
-\r
-×î½ü¸üУº2003 Äê 01 Ô 06 ÈÕ ÐÇÆÚÒ» 22:27:35 CST\r
-\r
-Ŀǰά»¤ÈËÔ±£ºBruce Momjian (pgman@candle.pha.pa.us\r
-<mailto:pgman@candle.pha.pa.us>)\r
-ÖÐÎÄ°æά»¤ÈËÔ±£ººÎΰƽ £¨laser@pgsqldb.com £©\r
-\r
-±¾ÎĵµµÄ×îа汾¿ÉÒÔÔÚhttp:\r
-//www.postgresql.org/files/documentation/faqs/FAQ.html ²é¿´¡£\r
-\r
-²Ù×÷ϵͳƽ̨Ïà¹ØµÄÎÊÌâÔÚhttp://www.postgresql.org/docs/faq/Àï»Ø´ð¡£\r
-\r
-------------------------------------------------------------------------\r
-\r
-\r
- ³£¼ûÎÊÌâ\r
-\r
-1.1 <#1.1>) PostgreSQL ÊÇʲô£¿¸ÃÔõô·¢Òô£¿\r
-1.2 <#1.2>) PostgreSQL µÄ°æȨÊÇʲô?\r
-1.3 <#1.3>) PostgreSQL ÔËÐÐÔÚʲô Unix ƽ̨ÉÏ£¿\r
-1.4 <#1.4>) ¿ÉÓÃµÄ·Ç Unix ƽ̨ÓÐÄÇЩ£¿\r
-1.5 <#1.5>) ÎÒ´ÓÄÄÀïÄܵõ½ PostgreSQL£¿\r
-1.6 <#1.6>) ÎÒ´ÓÄÄÀïÄܵõ½¶Ô PostgreSQL µÄÖ§³Ö£¿\r
-1.7 <#1.7>) PostgreSQL ×îеİ汾ÊÇʲô£¿\r
-1.8 <#1.8>) ÓÐÄÄЩ¿ÉÓÃµÄ PostgreSQL µÄÎĵµ£¿\r
-1.9 <#1.9>) ÎÒÈçºÎÁ˽âÒÑÖªµÄ BUG »òȱʧµÄÌØÐÔ£¿\r
-1.10 <#1.10>) ÎÒÓ¦¸ÃÔõÑùѧϰ SQL £¿\r
-1.11 <#1.11>) PostgreSQL ÊÇ Y2K ¼æÈݵÄÂð£¿\r
-1.12 <#1.12>) ÎÒÓ¦¸ÃÔõÑù¼ÓÈ뿪·¢¶ÓÎ飿\r
-1.13 <#1.13>) ÎÒÓ¦¸ÃÔõÑùÌá½»Ò»¸ö BUG ±¨¸æ£¿\r
-1.14 <#1.14>) PostgreSQL ºÍÆäËû DBMS ±ÈÆðÀ´ÈçºÎ£¿\r
-1.15 <#1.15>) ÎÒÓ¦¸ÃÔõÑùÔÞÖú PostgreSQL £¿\r
-\r
-\r
- Óû§¿Í»§¶ËÎÊÌâ\r
-\r
-2.1 <#2.1>) ÓÐ PostgreSQL µÄ ODBC Çý¶¯³ÌÐòô£¿\r
-2.2 <#2.2>) ÓÐʲô¹¤¾ß¿ÉÒÔ°Ñ PostgreSQL ÓÃÓÚ Web Ò³Ã棿\r
-2.3 <#2.3>) PostgreSQL ÓµÓÐͼÐÎÓû§½çÃæÂð£¿\r
-2.4 <#2.4>) ÎÒÃÇ¿ÉÒÔÓÃʲôÓïÑÔºÍ PostgreSQL ´ò½»µÀ£¿\r
-\r
-\r
- ϵͳ¹ÜÀíÎÊÌâ\r
-\r
-3.1 <#3.1>) ÎÒÔõÑùÄÜ°Ñ PostgreSQL ×°ÔÚ /usr/local/pgsql ÒÔÍâµÄµØ·½£¿\r
-3.2 <#3.2>) µ±ÎÒÔËÐÐ postmaster ʱ£¬³öÏÖ/ Bad System Call/£¨ÏµÍ³µ÷ÓÃ´í£©\r
-»ò Core Dumped ´íÎó¡£ÎªÊ²Ã´£¿\r
-3.3 <#3.3>) µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ /IpcMemoryCreate/ ´íÎó¡£Îª\r
-ʲô£¿\r
-3.4 <#3.4>) µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ /IpcSemaphoreCreate/ ´íÎó¡£\r
-Ϊʲô£¿\r
-3.5 <#3.5>) ÎÒÈçºÎ¿ØÖÆÀ´×ÔÆäËûÖ÷»úµÄÁ¬½Ó£¿\r
-3.6 <#3.6>) ÎÒÔõÑùµ÷ÕûÊý¾Ý¿âÒýÇæÒÔ»ñµÃ¸üºÃµÄÐÔÄÜ£¿\r
-3.7 <#3.7>) PostgreSQL Àï¿ÉÒÔ»ñµÃʲôÑùµÄµ÷ÊÔÌØÐÔ£¿\r
-3.8 <#3.8>) ΪʲôÔÚÊÔͼÁ¬½ÓµÇ¼ʱÊÕµ½¡°Sorry, too many clients¡± ÏûÏ¢£¿\r
-3.9 <#3.9>) pgsql_tmp Ŀ¼ÀﶼÓÐЩʲô£¿\r
-3.10 <#3.10>) ΪʲôҪÔÚÉý¼¶ PostgreSQL ·¢²¼°æ±¾Ê±×ö dump ºÍ restore £¿\r
-\r
-\r
- ²Ù×÷ÎÊÌâ\r
-\r
-4.1 <#4.1>) ¶þ½øÖÆÓαêºÍÆÕͨÓαêÖ®¼äµÄÇø±ðÊÇʲô£¿\r
-4.2 <#4.2>) ÈçºÎֻѡÔñÒ»¸ö²éѯ½á¹ûµÄÍ·¼¸ÐУ¿\r
-4.3 <#4.3>) ÎÒÈçºÎ»ñÈ¡Ò»¸öÊý¾Ý¿âÖбíµÄÁÐ±í£¬»òÕßÊÇÆäËûÎÒÄÜÔÚ /psql /Àï¿´\r
-µ½µÄ¶«Î÷£¿\r
-4.4 <#4.4>) ÔõÑù´Ó±íÀïÃæɾ³ýÒ»ÁУ¿\r
-4.5 <#4.5>) Ò»ÐУ¬Ò»¸ö±í£¬Ò»¸ö¿âµÄ×î´ó³ß´çÊǶàÉÙ£¿\r
-4.6 <#4.6>) ´æ´¢Ò»¸öµäÐ͵ÄÎı¾ÎļþÀïµÄÊý¾ÝÐèÒª¶àÉÙ´ÅÅ̿ռ䣿\r
-4.7 <#4.7>) ÈçºÎ²é¿´±í¡¢Ë÷Òý¡¢Êý¾Ý¿âÒÔ¼°Óû§µÄ¶¨Ò壿\r
-4.8 <#4.8>) ÎҵIJéѯºÜÂý»òÕßûÓÐÀûÓÃË÷Òý¡£ÎªÊ²Ã´£¿\r
-4.9 <#4.9>) ÎÒÈçºÎ²ÅÄÜ¿´µ½²éѯÓÅ»¯Æ÷ÊÇÔõÑù´¦ÀíÎҵIJéѯµÄ£¿\r
-4.10 <#4.10>) R-tree Ë÷ÒýÊÇʲô£¿\r
-4.11 <#4.11>) ʲôÊÇ»ùÒò²éѯÓÅ»¯£¨Genetic Query Optimization£©£¿\r
-4.12 <#4.12>) ÎÒÔõÑù×öÕýÔò±í´ïʽËÑË÷ºÍ´óСдÎ޹صÄÕýÔò±í´ïʽ²éÕÒ£¿ÔõÑùÀû\r
-ÓÃË÷Òý½øÐдóСдÎ޹زéÕÒ£¿\r
-4.13 <#4.13>) ÔÚÒ»¸ö²éѯÀÎÒÔõÑù¼ì²âÒ»¸ö×Ö¶ÎÊÇ·ñΪ NULL£¿\r
-4.14 <#4.14>) ¸÷ÖÖ×Ö·ûÀàÐÍÖ®¼äÓÐʲô²»Í¬£¿\r
-4.15.1 <#4.15.1>) ÎÒÔõÑù´´½¨Ò»¸öÐòÁкÅ/×Ô¶¯µÝÔöµÄ×ֶΣ¿\r
-4.15.2 <#4.15.2>) ÎÒÈçºÎ»ñµÃÒ»¸ö²åÈëµÄÐòÁкŵÄÖµ£¿\r
-4.15.3 <#4.15.3>) ʹÓà currval() ºÍ nextval() »áµ¼ÖºÍÆäËûÓû§µÄÎÉÂÒÇé¿ö\r
-£¨race condition£©Âð£¿\r
-4.15.4 <#4.15.4>) Ϊʲô²»ÔÚÊÂÎñÒì³£ÖÐÖ¹ºóÖØÓÃÐòÁкÅÄØ£¿ÎªÊ²Ã´ÔÚÐòÁкÅ×Ö\r
-¶ÎµÄÈ¡ÖµÖдæÔÚ¼ä¶ÏÄØ£¿\r
-4.16 <#4.16>) ʲôÊÇ OID£¿Ê²Ã´ÊÇ TID £¿\r
-4.17 <#4.17>) PostgreSQL ʹÓõÄһЩÊõÓïµÄº¬ÒåÊÇʲô£¿\r
-4.18 <#4.18>) ΪʲôÎÒÊÕµ½´íÎó¡°/ERROR: Memory exhausted in\r
-AllocSetAlloc()/¡±£¿\r
-4.19 <#4.19>) ÎÒÈçºÎ²ÅÄÜÖªµÀËùÔËÐÐµÄ PostgreSQL µÄ°æ±¾£¿\r
-4.20 <#4.20>) ΪʲôÎҵĴó¶ÔÏó²Ù×÷µ¼Ö´íÎó¡°/invalid large obj\r
-descriptor¡±£¨·Ç·¨µÄ´ó¶ÔÏóÃèÊö·û£©/£¿\r
-4.21 <#4.21>) ÎÒÈçºÎ´´½¨Ò»¸öȱʡֵÊǵ±Ç°Ê±¼äµÄ×ֶΣ¿\r
-4.22 <#4.22>) ΪʲôʹÓà IN µÄ×Ó²éѯÕâôÂý£¿\r
-4.23 <#4.23>) ÈçºÎ½øÐÐ outer join £¨ÍâÁ¬½Ó£©£¿\r
-4.24 <#4.24>) ÈçºÎʹÓÃÉæ¼°¶à¸öÊý¾Ý¿âµÄ²éѯ£¿\r
-\r
-4.25 <#4.25>) ÈçºÎÈú¯Êý·µ»Ø¶àÐлò¶àÁУ¿\r
-\r
-4.26 <#4.26>) ΪʲôÔÚ PL/PgSQL º¯ÊýÖв»ÄÜ¿É¿¿µØ´´½¨»òɾ³ýÁÙʱ±í£¿\r
-\r
-4.27 <#4.27>) ÓÐÄÄЩÊý¾Ý¸´ÖÆÑ¡Ï\r
-4.28 <#4.28>) ÓÐÄÄЩÊý¾Ý¼ÓÃÜÑ¡Ï\r
-\r
-\r
- À©Õ¹ PostgreSQL\r
-\r
-5.1 <#5.1>) ÎÒдÁËÒ»¸öÓû§¶¨Ò庯Êý¡£µ±ÎÒÔÚ/ psql/ ÀïÔËÐÐʱ£¬ÎªÊ²Ã´»áµ¼ÖÂ\r
-core dump£¿\r
-5.2 <#5.2>) ÎÒÈçºÎÄܸø PostgreSQL ¹±Ï×һЩͦ²»´íµÄÐÂÀàÐͺͺ¯Êý£¿\r
-5.3 <#5.3>) ÎÒÔõÑùдһ¸ö·µ»ØÒ»Ìõ¼Ç¼µÄ C º¯Êý£¿\r
-5.4 <#5.4>) ÎÒÐÞ¸ÄÁËÒ»¸öÔ´Îļþ£¬ÎªÊ²Ã´ÖØбàÒëºóûÓп´µ½¸Ä±ä£¿\r
-------------------------------------------------------------------------\r
-\r
-\r
- ³£¼ûÎÊÌâ\r
-\r
-\r
- 1.1) PostgreSQL ÊÇʲô£¿¸ÃÔõô·¢Òô£¿\r
-\r
-PostgreSQL ¶Á×÷ /Post-Gres-Q-L// ¡£/\r
-\r
-PostgreSQL ÊÇÏÂÒ»´ú DBMS µÄÑо¿ÔÐÍ POSTGRES Êý¾Ý¿â¹ÜÀíϵͳµÄÔöÇ¿°æ¡£\r
-PostgreSQL ÔÚ±£³Ö POSTGRES µÄÇ¿´óµÄÊý¾ÝÄ£ÐͺͷḻµÄÊý¾ÝÀàÐ͵Ļù´¡ÉÏ£¬ÓÃ\r
-Ò»¸öÀ©Õ¹Á赀 SQL ×Ó¼¯È¡´úÁËÔÏ鵀 PostQuel ²éѯÓïÑÔ¡£PostgreSQL ÊÇ×ÔÓɵÄ\r
-²¢ÇÒËùÓÐÔ´´úÂ붼¿ÉÒÔ»ñµÃ¡£\r
-\r
-PostgreSQL µÄ¿ª·¢ÓÉ²Î¼Ó PostgreSQL ¿ª·¢ÓʼþÁбíµÄÒ»¸ö¿ª·¢ÈËԱС×é½øÐС£\r
-Ä¿Ç°µÄе÷ÈËÊÇ Marc G. Fournier £¨scrappy@postgreSQL.org\r
-<mailto:scrappy@postgreSQL.org> £©¡££¨¹ØÓÚÈçºÎ¼ÓÈë²Î¼û1.6½Ú£©¡£Õâ¸ö¶ÓÎé\r
-ÏÖÔÚ¸ºÔð PostgreSQL µÄËùÓпª·¢¡£\r
-\r
-PostgreSQL 1.01 µÄ×÷ÕßÊÇ Andrew Yu ºÍ Jolly Chen¡£»¹ÓÐÐí¶àÆäËûÈËΪÒÆÖ²£¬\r
-²âÊÔ£¬µ÷ÊÔºÍÔöÇ¿´úÂë×öÁË´óÁ¿¹±Ïס£PostgreSQL µÄ×î³õÆðÔ´ Postgres£¬ÊÇÔÚ¼Ó\r
-ÖÝ´óѧ²®¿ËÀû·ÖУµÄ Michael Stonebraker ½ÌÊÚµÄÖ¸µ¼Ï£¬ÓÉÐí¶àÑо¿Éú£¬±¾¿Æ\r
-ÉúºÍ±à³ÌÖ°Ô±Íê³ÉµÄ¡£\r
-\r
-Õâ¸öÈí¼þ×î³õÔÚ²®¿ËÀûµÄÃû×ÖÊÇ Postgres¡£ÔÚ 1995 Ä꣬µ±Ôö¼ÓÁË SQL ¹¦Äܺó£¬\r
-ËüµÄÃû×Ö¸Ä³É Postgres95¡£ÔÚ 1996ÄêÄ©£¬²Å¸ÄÃûΪ PostgreSQL¡£\r
-\r
-\r
- 1.2) PostgreSQL µÄ°æȨÊÇʲô?\r
-\r
-PostgreSQL ÊÜÏÂÃæµÄ°æȨԼÊø¡£\r
-\r
-PostgreSQL Êý¾Ý¿â¹ÜÀíϵͳ\r
-\r
-£¨PostgreSQL Data Base Management System£©\r
-\r
-²¿·Ö°æȨ£¨c£©1996-2002£¬PostgreSQL È«Çò¿ª·¢Ð¡×é\r
-²¿·Ö°æȨ£¨c£©1994-6 ¼ÓÖÝ´óѧ¶ÊÂ\r
-\r
-£¨Portions copyright (c) 1996-2002, PostgreSQL Global Development Group\r
- Portions Copyright (c) 1994-6 Regents of the University of California£©\r
-\r
-ÔÊÐíΪÈκÎÄ¿µÄʹÓ㬿½±´£¬Ð޸ĺͷַ¢Õâ¸öÈí¼þºÍËüµÄÎĵµ¶ø²»ÊÕÈ¡ÈκηÑÓã¬\r
-²¢ÇÒÎÞÐëÇ©ÊðÒò´Ë¶ø²úÉúµÄÖ¤Ã÷£¬Ç°ÌáÊÇÉÏÃæµÄ°æȨÉùÃ÷ºÍ±¾¶ÎÒÔ¼°ÏÂÃæÁ½¶ÎÎÄ×Ö\r
-³öÏÖÔÚËùÓп½±´ÖС£\r
-\r
-£¨Permission to use, copy, modify, and distribute this software and its\r
-documentation for any purpose, without fee, and without a written\r
-agreement is hereby granted, provided that the above copyright notice\r
-and this paragraph and the following two paragraphs appear in all copies.£©\r
-\r
-ÔÚÈκÎÇé¿öÏ£¬¼ÓÖÝ´óѧ¶¼²»³Ðµ£ÒòʹÓôËÈí¼þ¼°ÆäÎĵµ¶øµ¼ÖµĶÔÈκε±ÊÂÈ˵Ä\r
-Ö±½ÓµÄ£¬¼ä½ÓµÄ£¬ÌØÊâµÄ£¬¸½¼ÓµÄ»òÕßÏà°é¶øÉúµÄË𻵣¬°üÀ¨ÀûÒæËðʧµÄÔðÈΣ¬¼´\r
-ʹ¼ÓÖÝ´óѧÒѾ½¨ÒéÁËÕâЩËðʧµÄ¿ÉÄÜÐÔʱҲÊÇÈç´Ë¡£\r
-\r
-£¨IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY\r
-FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,\r
-INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS\r
-DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF\r
-THE POSSIBILITY OF SUCH DAMAGE.£©\r
-\r
-¼ÓÖÝ´óѧÃ÷È··ÅÆúÈκα£Ö¤£¬°üÀ¨µ«²»¾ÖÏÞÓÚijһÌض¨ÓÃ;µÄÉÌÒµºÍÀûÒæµÄÒþº¬±£\r
-Ö¤¡£ÕâÀïÌṩµÄÕâ·ÝÈí¼þÊÇ»ùÓÚ¡°µ±×÷ÊÇ¡±µÄ»ù´¡µÄ£¬Òò¶ø¼ÓÖÝ´óѧûÓÐÔðÈÎÌṩά\r
-»¤£¬Ö§³Ö£¬¸üУ¬ÔöÇ¿»òÕßÐ޸ĵķþÎñ¡£\r
-\r
-£¨THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,\r
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\r
-AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\r
-ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS\r
-TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.£©\r
-\r
-ÉÏÃæ¾ÍÊÇ BSD °æȨÉùÃ÷£¬Ò»¸ö¾µäµÄ¿ªÔ´°æȨÉùÃ÷¡£Ëü¶ÔÔ´´úÂëµÄʹÓÃδ×÷ÈκÎ\r
-ÏÞÖÆ¡£ÎÒÃÇϲ»¶Ëü²¢ÇÒ²»´òËã¸Ä±äËü¡£\r
-\r
-\r
- 1.3) PostgreSQL ÔËÐÐÔÚʲô Unix ƽ̨ÉÏ£¿\r
-\r
-Ò»°ã˵À´£¬Ò»¸öÏÖ´úµÄ UNIX ¼æÈݵÄƽ̨¶¼ÄÜÔËÐÐ PostgreSQL ¡£ÔÚ°²×°Ö¸ÄÏÀïÁÐ\r
-³öÁË·¢²¼Ê±¾¹ýÃ÷È·²âÊÔµÄƽ̨¡£\r
-\r
-\r
- 1.4) ¿ÉÓÃµÄ·Ç Unix ƽ̨ÓÐÄÄЩ£¿\r
-\r
-¿Í»§¶Ë\r
-\r
-°Ñ libpq C ¿â£¬psql£¬ÆäËû½Ó¿ÚºÍ¿Í»§¶ËÓ¦ÓóÌÐò±àÒë³É¿ÉÒÔÔÚ MS Windows ƽ\r
-̨ÉÏÔËÐÐÊÇ¿ÉÄܵġ£ÕâÖÖÇé¿öÏ£¬¿Í»§¶ËÔÚ MS Windows ÉÏÔËÐУ¬²¢ÇÒͨ¹ý\r
-TCP/IP ÓëÒ»¸öÔËÐÐÔÚÎÒÃÇÖ§³ÖµÄ Unix ƽ̨ÉϵķþÎñÆ÷½øÐÐͨѶ¡£·¢²¼°æ±¾Öаü\r
-º¬Ò»¸öÎļþ win32.mak ÓÃÓÚÉú³É Win32 libpq ¿âºÍ psql ¡£PostgreSQL Ò²¿ÉÒÔ\r
-ºÍ ODBC ¿Í»§¶ËͨѶ¡£\r
-\r
-·þÎñÆ÷\r
-\r
-Êý¾Ý¿â·þÎñÆ÷ÏÖÔÚ¿ÉÒÔͨ¹ý Cygwin £¬Cygnus µÄ Unix/NT ÒÆÖ²¿âÔÚ Windows NT\r
-ºÍ Win2k ÉÏÔËÐС£²ÎÔÄ·¢²¼°æ±¾ÀïµÄ See /pgsql/doc/FAQ_MSWIN/ Îļþ»ò\r
-http://www.PostgreSQL.org/docs/faq-mswin.html ¡£\r
-\r
-ÒÆÖ²µ½ MS Win NT/2000/XP µÄ±¾»ú°æµÄ¹¤×÷ÕýÔÚ½øÐС£\r
-\r
-\r
- 1.5) ÎÒ´ÓÄÄÀïÄܵõ½ PostgreSQL£¿\r
-\r
-PostgreSQL µÄÖ÷ÄäÃûFTPÕ¾µãÊÇ ftp://ftp.PostgreSQL.org/pub£¬¾µÏñÕ¾µã¿ÉÒÔ\r
-²Î¿¼ÎÒÃÇÍøÕ¾µÄÖ÷Ò³¡£\r
-\r
-\r
- 1.6) ÎÒ´ÓÄÄÀïÄܵõ½¶Ô PostgreSQL µÄÖ§³Ö£¿\r
-\r
-Ö÷ÒªµÄÓʼþÁбíÊÇ£ºpgsql-general@postgreSQL.org\r
-<mailto:pgsql-general@postgreSQL.org>¡£¿ÉÒÔÔÚÄÇÀïÌÖÂÛÓÐ¹Ø PostgreSQL µÄ\r
-ÎÊÌâ¡£Òª¼ÓÈëÁÐ±í£¬·¢Ò»·âÓʼþÄÚÈÝ£¨²»ÊÇÖ÷ÌâÐУ©Îª\r
-\r
- subscribe\r
- end\r
-\r
-µÄÓʼþµ½ pgsql-general-request@postgreSQL.org\r
-<mailto:pgsql-general-request@postgreSQL.org> ¡£\r
-\r
-»¹¿ÉÒÔ»ñÈ¡ÕªÒªÁÐ±í¡£Òª¼ÓÈëÕâ¸öÁÐ±í£¬·¢Óʼþµ½£ºpgsql-general-digest-\r
-request@postgreSQL.org\r
-<mailto:pgsql-general-digest-request@postgreSQL.org>£¬ÆäÄÚÈÝΪ£º\r
-\r
- subscribe\r
- end\r
-\r
-ÿµ±Ö÷Áбí´ïµ½´óÔ¼ 30k µÄÏûÏ¢ÄÚÈÝʱ£¬ÕªÒª¾Í·¢Ë͸øÕâ¸öÁбíµÄ³ÉÔ±¡£\r
-\r
-»¹¿ÉÒԲμӳô³æÓʼþÁÐ±í¡£Òª¼ÓÈëÕâ¸öÁÐ±í£¬·¢ËÍÒ»¸öÓʼþµ½\r
-bugs-request@postgreSQL.org <mailto:bugs-request@postgreSQL.org>£¬ÄÚÈÝΪ£º\r
-\r
- subscribe\r
- end\r
-\r
-»¹¿ÉÒԲμӿª·¢ÈËÔ±ÓʼþÁÐ±í¡£Òª¼ÓÈëÕâ¸öÁÐ±í£¬·¢ËÍÒ»¸öÓʼþµ½\r
-hackers-request@postgreSQL.org <mailto:hackers-request@postgreSQL.org>£¬\r
-ÄÚÈÝΪ£º\r
-\r
- subscribe\r
- end\r
-\r
-ÆäËûµÄ¹ØÓÚ PostgreSQL ÓʼþÁбíºÍÆäËûÐÅÏ¢¿ÉÒÔÔÚ PostgreSQL µÄ WWW Ö÷Ò³ÕÒµ½£º\r
-\r
- http://postgresql.org/\r
-\r
-ÔÚ EFNet ÀﻹÓÐÒ»¸ö IRC ƵµÀ£¬ÆµµÀ #PostgreSQL¡£ÎÒÓà unix ÃüÁîirc -c\r
-'#PostgreSQL' "$USER" irc.phoenix.net\r
-\r
-ÉÌÒµÖ§³Ö¹«Ë¾µÄÁбíÔÚ\r
-http://www.PostgreSQL.org/users-lounge/commercial-support.html ¡£\r
-\r
-\r
- 1.7) PostgreSQL ×îеİ汾ÊÇʲô£¿\r
-\r
-PostgreSQL ×îеİ汾ÊÇ°æ±¾ 7.2.3¡££¨Òë×¢£ºÏÖÔÚÓ¦¸ÃÊÇ 7.3.1 ÁË¡££©\r
-\r
-ÎÒÃǼƻ®Ã¿ËĸöÔ·¢²¼Ò»¸öÖ÷Òª°æ±¾¡£\r
-\r
-\r
- 1.8) ÓÐÄÄЩ¿ÉÓÃµÄ PostgreSQL µÄÎĵµ£¿\r
-\r
-ÔÚ·¢²¼°üÀïÓÐһЩÊֲᣬÊÖ²áÒ³ºÍһЩСµÄ²âÊÔÀý×Ó¡£²Î¼û /doc Ŀ¼¡££¨Òë×¢£º\r
-ӦΪ $PGHOME/doc£©¡£Ä㻹¿ÉÒÔÔÚÏßä¯ÀÀ PostgreSQL µÄÊֲᣬÔÚ\r
-http://www.PostgreSQL.org/users-lounge/docs/ ¡£\r
-\r
-ÓÐÁ½±¾¹ØÓÚ PostgreSQL µÄÊéÔÚÏßÌṩ£¬ÔÚ\r
-http://www.PostgreSQL.org/docs/awbook.html\r
-<http://www.PostgreSQL.org/docs/awbook.html> ºÍ\r
-http://www.commandprompt.com/ppbook/\r
-<http://www.commandprompt.com/ppbook/> ¡£ÔÚ\r
-http://www.ca.PostgreSQL.org/books/\r
-<http://www.ca.PostgreSQL.org/books/> ÉÏÓйØÓÚ PostgreSQL µÄ¿É¹ºÊé¼®µÄÁÐ\r
-±í¡£ÔÚ http://techdocs.PostgreSQL.org/ <http://techdocs.PostgreSQL.org/>\r
-ÉÏÊÕ¼¯ÁËÓÐ¹Ø PostgreSQL µÄ¼¼ÊõÎÄÕ¡£\r
-\r
-/psql/ ÓÐһЩ²»´íµÄ \d ÃüÁÏÔʾ¹ØÓÚÀàÐÍ£¬²Ù×÷·û£¬º¯Êý£¬¾Û¼¯µÈµÄÐÅÏ¢¡£\r
-\r
-ÎÒÃÇµÄ web Õ¾µã°üº¬¸ü¶àµÄÎĵµ£®\r
-\r
-\r
- 1.9) ÎÒÈçºÎÁ˽âÒÑÖªµÄ BUG ºÍȱʧµÄÌØÐÔ£¿\r
-\r
-PostgreSQL Ö§³ÖÒ»¸öÀ©Õ¹Á赀 SQL-92 µÄ×Ó¼¯¡£²ÎÔÄÎÒÃÇµÄ TODO\r
-<http://www.postgresql.org/docs/todo.html>\r
-<http://www.postgresql.org/docs/todo.html>ÁÐ±í£¬»ñÈ¡Ò»¸öÒÑÖª³ô³æ£¬È±Ê§ÌØ\r
-ÐÔºÍδÀ´¼Æ»®¡£\r
-\r
-\r
- 1.10) ÎÒÓ¦¸ÃÔõÑùѧϰ SQL£¿\r
-\r
-ÔÚ http://www.postgresql.org/docs/awbook.html µÄ¹ØÓÚ PostgreSQL µÄÊé½ÌÊÚ\r
-SQL¡££¨Òë×¢£ºÎÒÏÂÔص½±¾µØÁË¡££©ÔÚ http://www.commandprompt.com/ppbook\r
-<http://www.commandprompt.com/ppbook/> ÓÐÁíÍâÒ»±¾¹ØÓÚ PostgreSQL µÄÊé¡£\r
-ÔÚhttp://www.intermedia.net/support/sql/sqltut.shtm£¬http:\r
-//ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM \r
-<http://ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM>\r
-ºÍ http://sqlcourse.com <http://sqlcourse.com/> ÓÐÒ»¸ö²»´íµÄÈëÃŽ̡̳£\r
-\r
-ÁíÒ»¸öÊÇ "Teach Yourself SQL in 21 Days, Second Edition"£¨21Ììѧ»áSQL£¬\r
-µÚ¶þ°æ£©£¬ÔÚ http://members.tripod.com/er4ebus/sql/index.htm\r
-<http://members.tripod.com/er4ebus/sql/index.htm>\r
-\r
-ÎÒÃǵÄÐí¶àÓû§Ï²»¶ /The Practical SQL Handbook, Bowman, Judith S., et\r
-al., Addison-Wesley ¡£ / ÆäËûµÄÓÐ/ The Complete Reference SQL, Groff et\r
-al., McGraw-Hill ¡£/\r
-\r
-\r
- 1.11) PostgreSQL ÊÇ Y2K ¼æÈݵÄÂð£¿\r
-\r
-ÊÇ£¬ÎÒÃǺÜÈÝÒ׿ØÖÆ 2000 AD Ö®ºóºÍ 2000 BC ֮ǰµÄÈÕÆÚ¡£\r
-\r
-\r
- 1.12) ÎÒÓ¦¸ÃÔõÑù¼ÓÈ뿪·¢¶ÓÎ飿\r
-\r
-Ê×ÏÈ£¬ÏÂÔØ×îеÄÔ´´úÂë²¢ÔĶÁÎÒÃÇ web Õ¾µã»ò·¢²¼°üÖÐµÄ PostgreSQL ¿ª·¢Õß\r
-Îĵµ¡£Æä´Î£¬¼ÓÈë pgsql-hackers ºÍ pgsql-patches ÓʼþÁÐ±í¡£µÚÈý£¬Ïò\r
-pgsql-patches Ìá½»¸ßÖÊÁ¿µÄ²¹¶¡³ÌÐò¡£\r
-\r
-ÏÖÔÚ´ó¸ÅÓÐÊ®¼¸¸öÈËÓÐ PostgreSQL CVS ¹éµµ COMMIT µÄȨÏÞ¡£ËûÃǶ¼ÒѾÌá½»ÁË\r
-·Ç³£¶à¸ßÖÊÁ¿µÄ²¹¶¡ÁË£¬ÒÔÖÁÓÚÏÖÓеÄÌá½»È˺ÜÄѸúÉϽÚ×࣬²¢ÇÒÎÒÃÇÏàÐÅËûÃÇÌá\r
-½»µÄ²¹¶¡¶¼ÊǸßÖÊÁ¿µÄ¡£\r
-\r
-\r
- 1.13) ÎÒÓ¦¸ÃÔõÑùÌá½»Ò»¸öBUG±¨¸æ£¿\r
-\r
-Çë·ÃÎÊ http://www.PostgreSQL.org/bugs/bugs.php µÄ PostgreSQL BugTool Ò³\r
-Ãæ, ÄÇÀï¸ø³öÁËÈçºÎÌá½»Ò»¸öBUG±¨¸æµÄÖ¸ÄÏ¡£\r
-\r
-ͬÑùÒ²Òª¿´¿´ÎÒÃÇµÄ ftp Õ¾µã ftp://ftp.postgreSQL.org/pub\r
-<ftp://ftp.postgresql.org/pub>£¬¿´ÓÐûÓиüÐ嵀 PostgreSQL °æ±¾»ò²¹¶¡¡£\r
-\r
-\r
- 1.14) PostgreSQL ºÍÆäËû DBMS ±ÈÆðÀ´ÈçºÎ£¿\r
-\r
-ÆÀ¼ÛÈí¼þÓкü¸ÖÖ·½·¨£ºÌØÐÔ£¬ÐÔÄÜ£¬¿É¿¿ÐÔ£¬Ö§³ÖºÍ¼Û¸ñ¡£\r
-\r
-*ÌØÐÔ*\r
- PostgreSQL ÓµÓдóÐÍÉÌÓà DBMS Àï´ó¶àÊýÌØÐÔ£¬ÀýÈ磺ÊÂÎñ£¬×Ó²éѯ£¬´¥·¢\r
- Æ÷£¬ÊÓͼ£¬Íâ¼ü²Î¿¼ÍêÕûÐԺ͸´ÔÓµÄËøµÈ¡£ÎÒÃÇ»¹ÓÐһЩËüÃÇûÓеÄÌØÐÔ£¬Èç\r
- Óû§¶¨ÒåÀàÐÍ£¬¼Ì³Ð£¬¹æÔòºÍ¶à°æ±¾²¢ÐпØÖÆÒÔ¼õÉÙËøµÄÕùÓõȡ£\r
- \r
-*ÐÔÄÜ*\r
- PostgreSQL ºÍÆäËûÉÌÓúͿªÔ´µÄÊý¾Ý¿â¾ßÓÐÀàËƵÄÐÔÄÜ¡£¶ÔijЩ´¦ÀíËü±È½Ï\r
- ¿ì£¬¶ÔÆäËûһЩ´¦ÀíËü±È½ÏÂý¡£Óë MySQL »ò¸üÇá±ãµÄÊý¾Ý¿âϵͳ±È½Ï£¬ÎÒÃÇ\r
- ÔÚ insert/update ʱÂý£¬ÒòΪÎÒÃÇÓÐÊÂÎñ´¦Àí¡£µ±È» MySQL ²»¾ßÓÐÎÒÃÇÔÚÉÏ\r
- ÃæµÄ/ÌØÐÔ /¶ÎÀï¸ø³öµÄÈκÎÌØÐÔ¡£ÎÒÃǵÄÖ÷Òª·½ÏòÊÇ¿É¿¿ÐÔºÍÌØÐÔ£¬¾¡¹ÜÎÒ\r
- ÃÇÔÚÿ´Î·¢²¼Ê±²»¶ÏµØ¸Ä½øÐÔÄÜ¡£ÓÐÒ»¸öºÜÓÐȤµÄÍøÒ³±È½ÏÁË PostgreSQL ºÍ\r
- MySQL http://openacs.org/why-not-mysql.html¡£\r
-*¿É¿¿ÐÔ*\r
- ÎÒÃÇÖªµÀ DBMS ±ØÐëÊÇ¿É¿¿µÄ£¬·ñÔòËü¾ÍÒ»µãÓö¼Ã»ÓС£ÎÒÃÇŬÁ¦×öµ½·¢²¼¾\r
- ¹ýÈÏÕæ²âÊԵģ¬Îȶ¨µÄ³ô³æ×îÉٵĴúÂ롣ÿ¸ö°æ±¾ÖÁÉÙÓÐÒ»¸öÔ嵀 beta ²â\r
- ÊÔ£¬²¢ÇÒÎÒÃǵķ¢²¼ÀúÊ·ÏÔʾÎÒÃÇ¿ÉÒÔÌṩÎȶ¨µÄ£¬Àι̵ģ¬¿ÉÓÃÓÚÉú²úʹÓÃ\r
- µÄ°æ±¾¡£ÎÒÃÇÏàÐÅÔÚÕâ·½ÃæÎÒÃÇÓëÆäËûµÄÊý¾Ý¿âÈí¼þÊÇÏ൱µÄ¡£\r
- \r
-*Ö§³Ö*\r
- ÎÒÃǵÄÓʼþÁбíÌṩһ¸ö·Ç³£´óµÄ¿ª·¢ÈËÔ±ºÍÓû§µÄ×éÒÔ°ïÖú½â¾öËùÅöµ½µÄÈÎ\r
- ºÎÎÊÌâ¡£ÎÒÃDz»Äܱ£Ö¤¿Ï¶¨Äܽâ¾öÎÊÌ⣬Ïà±È֮ϣ¬ÉÌÓà DBMS Ò²²¢²»ÊÇ×ÜÄÜ\r
- ¹»Ìṩ½â¾ö·½·¨¡£Ö±½ÓÓ뿪·¢ÈËÔ±£¬Óû§Èº£¬ÊÖ²áºÍÔ´³ÌÐò½Ó´¥Áî\r
- PostgreSQL µÄÖ§³Ö±ÈÆäËû DBMS »¹ÒªºÃ¡£»¹ÓÐһЩÉÌÒµÐÔµÄÔ¤°ü×°µÄÖ§³Ö£¬\r
- ¿ÉÒÔ¸øÌṩ¸øÄÇЩÐèÒªµÄÈË¡££¨²ÎÔÄÖ§³Ö FAQ Ìõ¿î 1.6 С½Ú¡££©\r
- \r
-*¼Û¸ñ*\r
- ÎÒÃǶÔÈκÎÓÃ;¶¼Ãâ·Ñ£¬°üÀ¨ÉÌÓúͷÇÉÌÓÃÄ¿µÄ¡£Äã¿ÉÒÔ²»¼ÓÏÞÖƵØÏòÄãµÄ²ú\r
- Æ·Àï¼ÓÈëÎÒÃǵĴúÂ룬³ýÁËÄÇЩÎÒÃÇÔÚÉÏÃæµÄ°æȨÉùÃ÷ÀïÉùÃ÷µÄ BSD ·ç¸ñµÄ\r
- °æȨÍâ¡£ \r
-\r
-\r
- 1.15) ÎÒÓ¦¸ÃÔõÑùÔÞÖú PostgreSQL £¿\r
-\r
-×Ô´Ó1996Ä꿪ʼ£¬PostgreSQL ÒѾÓÐÁËÒ»¸öÓÅÐãµÄ×éÖ¯¡£ÕâЩӦ¸Ã¹é¹¦ÓÚ Marc\r
-Fournier£¬ÊÇËû´´½¨Á˲¢ÔÚÕâЩÄêÒ»Ö±¹ÜÀíÕâ¸ö×éÖ¯¡£\r
-\r
-¶ÔÓÚÒ»¸ö¿ªÔ´ÏîÄ¿À´Ëµ£¬ÖÊÁ¿»ù´¡ÉèÊ©ÊǷdz£ÖØÒªµÄ¡£ËüÄÜ·ÀÖ¹³öÏÖÑÏÖØÑÓ³ÙÏîÄ¿\r
-Ç°½øµÄ»ìÂÒ¡£\r
-\r
-ÏÔÈ»£¬Õâ¸ö×éÖ¯µÄÔËת³É±¾²»·Æ¡£Î¬³ÖÆäÇ°½øÓи÷ÖÖÔ¶ȵġ¢Ò»´ÎÐԵĿªÖ§¡£Èç¹û\r
-Äã»òÕßÄãµÄ¹«Ë¾ÄܽøÐоèÔùÒÔÖ§³ÖÕâÏîÊÂÒµ£¬Çë·ÃÎÊ\r
-http://store.pgsql.com/shopping/ <http://store.pgsql.com/shopping/> ½øÐÐ\r
-¾èÔù¡£\r
-\r
-ËäÈ»¸ÃÍøÒ³Ìá¼°ÁË PostgreSQL ¹«Ë¾£¬ÕâЩ¾èÔù½«½öÓÃÓÚÖ§³Ö PostgreSQL ÏîÄ¿£¬\r
-²¢²»»áÓÃÓÚ×ÊÖúû¸öÌض¨µÄ¹«Ë¾¡£Èç¹ûÄãÔ¸Ò⣬Ҳ¿ÉÒÔÓʼÄ֧Ʊµ½ÁªÏµµØÖ·¡£\r
-\r
-------------------------------------------------------------------------\r
-\r
-\r
- Óû§¿Í»§¶ËÎÊÌâ\r
-\r
-\r
- 2.1) ÓÐ PostgreSQL µÄ ODBC Çý¶¯Ã´£¿\r
-\r
-ÓÐÁ½¸ö ODBC Çý¶¯¿ÉÒÔ»ñµÃ£¬PsqlODBC ºÍ OpenLink ODBC.\r
-\r
-¿ÉÒÔÔÚhttp://gborg.postgresql.org/project/psqlodbc/projdisplay.php ÏÂÔØ\r
-PsqlODBC ¡£\r
-\r
-OpenLink ODBC ¿ÉÒÔ´Ó http://www.openlinksw.com/ »ñµÃ¡£ËüÓëËûÃǵıê×¼\r
-ODBC ¿Í»§¶ËÈí¼þ¼æÈÝ£¬Òò¶øÄã¿ÉÒÔÔÚÈκÎËûÃÇÖ§³ÖµÄ¿Í»§¶Ëƽ̨£¨Win, Mac,\r
-Unix, VMS£©ÉÏʹÓà PostgreSQL ODBC¡£\r
-\r
-ËûÃÇ¿ÉÄܽ«Õâ¸ö²úÆ·ÏúÊÛ¸øÄÇЩÐèÒªÉÌÒµÖ§³ÖµÄÓû§£¬µ«ÊÇ×ÜÊÇÓÐÒ»¸ö freeware\r
-£¨×ÔÓÉÈí¼þ£©µÄ°æ±¾¿ÉÒԵõ½¡£ÇëѯÎÊ postgres95@openlink.co.uk\r
-<mailto:postgres95@openlink.co.uk>¡£\r
-\r
-\r
- 2.2) ÓÐʲô¹¤¾ß¿ÉÒÔ°Ñ PostgreSQL ÓÃÓÚ Web Ò³Ã棿\r
-\r
-Ò»¸ö½éÉÜÒÔÊý¾Ý¿âΪºǫ́µÄͦ²»´íµÄ Õ¾µãÊÇ£ºhttp://www.webreview.com ¡£\r
-\r
-¶ÔÓÚ Web ¼¯³É£¬PHP ÊÇÒ»¸ö¼«ºÃµÄ½Ó¿Ú¡£ËüÔÚ£ºhttp://www.php.net/ ¡£\r
-\r
-¶ÔÓÚ¸´ÔÓµÄÈÎÎñ£¬ºÜ¶àÈ˲ÉÓà Perl ½Ó¿ÚºÍ CGI.pm »ò mod_perl ¡£\r
-\r
-\r
- 2.3) PostgreSQL ÓµÓÐͼÐÎÓû§½çÃæÂð£¿\r
-\r
-Êǵġ£Óм¸¸öÊÊÓÃÓÚ PostgreSQL µÄͼÐνӿڡ£°üÀ¨PgAccess£¨http:\r
-//www.pgaccess.com)£¬PgAdmin II £¨http://www.pgadmin.org£¬½öÊÊÓÃÓÚ\r
-Win32£©£¬ RHDB Admin (http://sources.redhat.com/rhdb/£© ÒÔ¼° Rekall\r
-£¨http://www.thekompany.com/products/rekall/£¬ רÓеÄ/proprietary)¡£»¹ÓÐ\r
-PHPPgAdmin £¨http://phppgadmin.sourceforge.net/£©\r
-<http://phppgadmin.sourceforge.net/> £¬Ò»¸ö»ùÓÚ web µÄ PostgreSQL ·ÃÎʽÓ\r
-¿Ú¡£\r
-\r
-ÎÒÃÇÓÐÒ»¸ö²»´íµÄͼÐÎÓû§½çÃ棬³ÆΪ PgAccess £¬ËüÒ²¿ÉÒÔÓÃ×÷±¨±íÉú³ÉÆ÷¡£Íø\r
-Ò³ÊÇ http://www.pgaccess.org/¡£\r
-\r
-\r
- 2.4) ÎÒÃÇ¿ÉÒÔÓÃʲôÓïÑÔºÍ PostgreSQL ´ò½»µÀ£¿\r
-\r
-´ó¶àÊýÁ÷Ðеıà³ÌÓïÑÔ¶¼ÓзÃÎÊ PostgreSQL µÄ½Ó¿Ú¡£Çë¼ì²é±à³ÌÓïÑÔµÄÀ©Õ¹Ä£¿é\r
-ÁÐ±í¡£\r
-\r
-PostgreSQL ·¢²¼°üÖаüº¬ÁËÒÔϽӿڣº\r
-\r
- * C (libpq)\r
- * Embedded C (ecpg)\r
- * Java (jdbc)\r
- * Python (PyGreSQL)\r
- * TCL (libpgtcl)\r
-\r
-ÆäËûµÄ½Ó¿ÚÔÚ http://gborg.postgresql.org É쵀 /Drivers/Interfaces/ С½Ú¡£\r
-\r
-------------------------------------------------------------------------\r
-\r
-\r
- ϵͳ¹ÜÀíÎÊÌâ\r
-\r
-\r
- 3.1) ÎÒÔõÑùÄÜ°Ñ PostgreSQL ×°ÔÚ /usr/local/pgsql ÒÔÍâµÄµØ·½£¿\r
-\r
-ÔÚÔËÐÐ configure ʱ¼ÓÉÏ --prefix Ñ¡Ïî¡£\r
-\r
-\r
- 3.2) µ±ÎÒÔËÐÐ postmaster ʱ£¬³öÏÖ/ Bad System Call/£¨ÏµÍ³µ÷ÓÃ\r
- ´í£©»ò Core Dumped ´íÎó¡£ÎªÊ²Ã´£¿\r
-\r
-Õâ¿ÉÄÜÊǺܶ෽ÃæµÄÎÊÌ⣬ÇëÏȼì²é²Ù×÷ϵͳºËÐÄÊÇ·ñÖ§³Ö System V À©Õ¹¡£\r
-PostgreSQL ÐèÒªÄÚºËÖ§³Ö¹²ÏíÄÚ´æºÍÐźŵơ£\r
-\r
-\r
- 3.3) µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ /IpcMemoryCreate/ ´íÎó¡£Îª\r
- ʲô£¿\r
-\r
-ÄãҪôÊÇûÓÐÔÚÄÚºËÀïÕýÈ·ÅäÖù²ÏíÄڴ棬ҪôÊÇÄãÐèÒªÀ©´óÄãµÄÄں˵ĿÉÓù²Ïí\r
-ÄÚ´æ¡£ÐèÒªµÄ¹²ÏíÄÚ´æ¾ßÌåµÄÊýÁ¿È¡¾öÓÚÄãµÄÌåϵ½á¹¹ºÍÄãÅäÖÃÄãµÄ postmaster\r
-ÔËÐÐʱʹÓõĻº³åÇøºÍºó¶Ë½ø³ÌÊýÄ¿¡£¶Ô´ó¶àÊýϵͳ£¬Ê¹ÓÃȱʡ»º³åÇøºÍ½ø³ÌÊýÄ¿\r
-ʱ£¬Äã×îÉÙÐèÒª~1MB¡£Óйع²ÏíÄÚ´æºÍÐźŵƵÄÏêϸÐÅÏ¢Çë²Î¿¼ PostgreSQL\r
-Administrator's Guide\r
-<http://www.postgresql.org/idocs/index.php?kernel-resources.html> ¡£\r
-\r
-\r
- 3.4) µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ /IpcSemaphoreCreate/ ´í\r
- Îó¡£ÎªÊ²Ã´£¿\r
-\r
-Èç¹û´íÎóÐÅÏ¢ÊÇ /IpcSemaphoreCreate: semget failed (No space left on\r
-device)/£¬ÄÇôÔÒòÊÇÄãµÄÄÚºËûÓÐÅäÖÃ×ã¹»µÄÐźŵÆ×ÊÔ´¡£Postgres µÄÿ¸öDZ\r
-Ôڵĺǫ́½ø³Ì¶¼ÐèÒªÒ»¸öÐźŵơ£Ò»¸öÁÙʱµÄ½â¾ö·½·¨ÊÇÒԱȽÏÉٵĺǫ́½ø³ÌÊý\r
-£¨²ÎÊý£©Æô¶¯ postmaster¡£Ê¹Óÿª¹Ø /-N/ ´øÒ»¸öÉÙÓÚȱʡֵ 32 µÄ²ÎÊýÔËÐÐ\r
-postmaster¡£¸ü³¤¾ÃµÄ½â¾ö·½·¨ÊǼӴóÄãµÄÄÚºËµÄ SEMMNS ºÍ SEMMNI ²ÎÊý¡£\r
-\r
-ÔÚÊý¾Ý¿â·ÃÎÊÁ¿ºÜ´óʱ£¬ÐźŵƲ»¿ÉÓÿÉÄܵ¼ÖÂϵͳ±ÀÀ£¡£\r
-\r
-Èç¹û´íÎóÐÅÏ¢ÊÇÆäËûµÄʲô¶«Î÷£¬Äã¿ÉÄܾ͸ù±¾Ã»ÓÐÔÚÄÚºËÀïÃæÅäÖÃÐźŵÆÖ§³Ö¡£\r
-Óйع²ÏíÄÚ´æºÍÐźŵƵÄÏêϸÐÅÏ¢Çë²Î¿¼ PostgreSQL Administrator's Guide\r
-<http://www.postgresql.org/idocs/index.php?kernel-resources.html> ¡£\r
-\r
-\r
- 3.5) ÎÒÈçºÎ¿ØÖÆÀ´×ÔÆäËûÖ÷»úµÄÁ¬½Ó£¿\r
-\r
-ȱʡʱ£¬PostgreSQL Ö»ÔÊÐíͨ¹ý unix ÓòÌ×½Ó×ÖÀ´×Ô±¾»úµÄÁ¬½Ó¡£³ý·ÇÄãʹÓÃ\r
-/-i/ ¿ª¹ØÆô¶¯ /postmaster/£¬*²¢ÇÒ*ͨ¹ý¶ÔÓ¦µÄ±à¼ /$PGDATA/pg_hba.conf/\r
-Îļþ´ò¿ªÁËÖ÷»úΪ»ù´¡£¨ host-based £©µÄÈÏÖ¤£¬·ñÔòÆäËû»úÆ÷ÊDz»ÄÜÓëÄãµÄ»úÆ÷\r
-Á¬½ÓµÄ¡£ÕâÑù½«ÔÊÐí TCP/IP Á¬½Ó¡£\r
-\r
-\r
- 3.6) ÎÒÔõÑùµ÷ÕûÊý¾Ý¿âÒýÇæÒÔ»ñµÃ¸üºÃµÄÐÔÄÜ£¿\r
-\r
-µ±È»£¬Ë÷Òý¿ÉÒÔ¼ÓËÙ²éѯ¡£EXPLAIN ÃüÁîÔÊÐíÄã¹Û²ì PostgreSQL ÈçºÎ½âÊÍÄãµÄ²é\r
-ѯ£¬ÒÔ¼°Ê¹ÓÃÁËÄÄЩË÷Òý¡£\r
-\r
-Èç¹ûÄãÕý´¦ÀíÒ»¶Ñ INSERT£¬¿¼ÂÇʹÓà COPY ÃüÁîÒÔ´óÅúÁ¿µÄ·½Ê½½øÐС£ÕâÑù×ö±È\r
-µ¥¶ÀµÄÒ»¸ö¸ö INSERT ¿ìµÃ¶à¡£Æä´Î£¬Ã»Óд¦ÓÚ BEGIN WORK/COMMIT ÊÂÎñ¿éÖ®¼ä\r
-µÄÓï¾ä±»ÈÏΪÊôÓÚͬһ¸öÊÂÎñ¡£ÊÔ×ÅÔÚÒ»¸öÊÂÎñ¿éÀïÃæ´¦Àí¸ü¶àµÄÓï¾ä¡£ÕâÑù¿ÉÒÔ\r
-¼õÉÙÊÂÎñ´øÀ´µÄ¶îÍ⿪Ïú¡£Í¬Ñù£¬ÔÚ×ö´óÁ¿µÄÊý¾Ý¸Ä±äʱ¿¼ÂÇɾ³ýºÍÖؽ¨Ë÷Òý¡£\r
-\r
-»¹Óм¸¸öµ÷½ÚµÄÑ¡Ïî¿ÉÒÔʹÓá£Äã¿ÉÒÔͨ¹ý´ø /-o -F/ Ñ¡ÏîÆô¶¯ postmaster À´\r
-½ûÖ¹ fsync()¡£ÕâÑù½«±ÜÃâÿ´ÎÊÂÎñºóµ÷Óà /fsync() / °ÑÊý¾Ýˢе½´ÅÅÌÉÏ¡£\r
-\r
-Ä㻹¿ÉÒÔʹÓà postmaster -B Ñ¡ÏîÔö¼Óºó¶Ë½ø³ÌʹÓõĹ²ÏíÄڴ滺³åµÄÊýÄ¿¡£Èç\r
-¹ûÄã°ÑÕâ¸ö²ÎÊýÉèÖõÃÌ«´ó£¬postmaster ¿ÉÄÜÎÞ·¨Æô¶¯£¬ÒòΪÄãÒѾ³¬¹ýÁËÄãµÄ\r
-ÄÚºËÔÚ¹²ÏíÄÚ´æ¿Õ¼äÉϵÄÏÞÖÆ¡£Ã¿¸ö»º³åÇøÊÇ 8K ²¢ÇÒȱʡ 64 ¸ö»º³åÇø¡£\r
-\r
-Ä㻹¿ÉÒÔʹÓúǫ́½ø³ÌµÄ -S Ñ¡ÏîÀ´Ôö¼Óÿ¸öºǫ́½ø³ÌÓÃÓÚÁÙʱÅÅÐòÓõÄ×î´óÄÚ´æ\r
-ÊýÁ¿¡£-S ÖµÊÇÒÔK×ֽڼƵģ¬È±Ê¡ÊÇ 512 £¨Ò²¾ÍÊÇ˵£¬512K£©¡£\r
-\r
-Ä㻹¿ÉÒÔʹÓà CLUSTER ÃüÁîÀ´°Ñ±íÀïµÄÊý¾Ý°´ÕÕij¸öË÷Òý½øÐоۼ¯´æ·Å¡£²ÎÔÄ\r
-CLUSTER µÄÊÖ²áÒ³»ñÈ¡¸ü¶àϸ½Ú¡£\r
-\r
-\r
- 3.7) PostgreSQL Àï¿ÉÒÔ»ñµÃʲôÑùµÄµ÷ÊÔÌØÐÔ£¿\r
-\r
-PostgreSQL Óм¸¸öÌØÐÔÓÃÓÚ±¨¸æ״̬ÐÅÏ¢£¬ÕâЩÐÅÏ¢¿ÉÄܶԵ÷ÊÔÓÃ;ºÜÓаïÖú¡£\r
-\r
-Ê×ÏÈ£¬Í¨¹ý¸½´ø --enable-cassert Ñ¡ÏîÔËÐÐ configure£¬Óкܶà /assert()/ ¼à\r
-¿Øºǫ́½ø³ÌºÍÔÚ·¢ÉúijЩδÔøÔ¤ÁϵÄÏÖÏóʱֹͣ³ÌÐòÔËÐС£\r
-\r
-postmaster ºÍ postgres ¶¼ÓÐһЩ¿ÉÓõÄÑ¡Ïî¡£Ê×ÏÈ£¬µ±ÄãÆô¶¯ postmaster\r
-ʱ£¬È·±£Äã°Ñ±ê×¼Êä³öºÍ±ê×¼´íÎóÊä³ö¶¨Ïòµ½ÁËÒ»¸öÈÕÖ¾ÎļþÀïÈ¥ÁË£¬Ïó£º\r
-\r
- cd /usr/local/pgsql\r
- ./bin/postmaster >server.log 2>&1 &\r
-\r
-ÕâÑù½«ÔÚ PostgreSQL ¶¥¼¶Ä¿Â¼ÏÂÊä³öÒ»¸ö server.log Îļþ¡£Õâ¸öÎļþ°üº¬·þÎñ\r
-Æ÷Åöµ½µÄÎÊÌâºÍ´íÎóµÄÓÐÓÃÐÅÏ¢¡£postmaster ÓÐÒ»¸ö -d Ñ¡Ï¸ÃÑ¡ÏîÔÊÐíÎÒÃÇ\r
-»ñµÃ¸ü¶àµÄϸ½Ú»ã±¨¡£-d Ñ¡Ïî½ÓÊÜÒ»¸öÊý×Ö±êÃ÷µ÷ÊÔ¼¶±ð¡£ÐèÒª¾¯¸æµÄÊǸߵĵ÷\r
-ÊÔ¼¶±ð¿ÉÄÜ»áÉú³É¾Þ´óµÄÈÕÖ¾Îļþ¡£\r
-\r
-Èç¹û postmaster ûÓÐÔËÐУ¬Äã¿ÉÒÔÖ±½ÓÔÚÃüÁîÐÐÉÏÆô¶¯ postgres ºǫ́½ø³Ì£¬È»\r
-ºóÖ±½Ó¼üÈë SQL Óï¾ä¡£ÎÒÃÇ*Ö»* ÍƼöÔÚµ÷ÊÔµÄʱºòÕâô¸É¡£Çë×¢ÒâÕâʱÓû»ÐÐÜÞ\r
-¶ø²»ÊǷֺűíʾÓï¾ä½áβ¡£Èç¹ûÄã´ø×ŵ÷ÊÔ·ûºÅ±àÒ룬Äã¿ÉÒÔʹÓÃÒ»¸öµ÷ÊÔÆ÷¹Û¿´\r
-·¢ÉúÁËʲôÊÂÇé¡£ÒòΪºǫ́½ø³ÌûÓÐÓÉ postmaster Æô¶¯µÄ£¬Ëü²»ÊǺÍʵ¼ÊµÄÔËÐÐ\r
-»·¾³Ò»Ö£¬¶øÇÒËø¶¨/ºǫ́½»»¥ÎÊÌâ¿ÉÄܲ»ÄÜÖØÏÖ¡£\r
-\r
-Èç¹û postmaster ÒѾÔËÐУ¬¿ÉÔÚÒ»¸ö´°¿ÚÖÐÆô¶¯ /psql/£¬È»ºóÕÒ³ö /psql/ ¶Ô\r
-Ó¦µÄ /postgres/ ½ø³ÌµÄ PID¡£Ê¹ÓÃÒ»¸öµ÷ÊÔÆ÷¸½×ÅÔÚÕâ¸ö /postgres /PID ÉÏ¡£\r
-Äã¿ÉÒÔÔÚµ÷ÊÔÆ÷ÀïÉèÖöϵ㲢ÇÒ´Ó /psql/ ÀïÖ´Ðвéѯ¡£Èç¹ûÄãÔÚµ÷ÊÔ\r
-/postgres/ µÄÆô¶¯£¬Äã¿ÉÒÔÉèÖà PGOPTIONS="-W n"£¬È»ºóÆô¶¯ /psql/¡£ÕâÑù½«\r
-µ¼ÖÂÆô¶¯ÑÓ³Ù /n/ Ã룬ÕâÑùÄã¾Í¿ÉÒÔ¸½¼ÓÒ»¸öµ÷ÊÔÆ÷²¢ÇÒ¸ú×ÙÆô¶¯Ë³ÐòµÄ¹ý³Ì¡£\r
-\r
-postgres ³ÌÐòÓÐ -s£¬-A£¬ºÍ -t Ñ¡Ïî¿ÉÄÜÔÚµ÷ÊÔºÍÐÔÄܲâÁ¿µÄʱºò·Ç³£ÓÐÓá£\r
-\r
-Ä㻹¿ÉÒÔ´ø profiling Ö§³Ö±àÒëºǫ́£¬ÒÔ±ã¹Û²ìÄÄЩº¯ÊýÕ¼ÓõÄÖ´ÐÐʱ¼ä½Ï¶à¡£\r
-profile Îļþ½«·ÅÔÚ pgsql/data/base/dbname Ŀ¼Ï¡£¿Í»§¶Ë profile Îļþ½«\r
-·ÅÔÚ¿Í»§¶Ëµ±Ç°Ä¿Â¼Ï¡£ÔÚ Linux ÏÂÖ§³Ö profiling ÒªÔÚ±àÒëʱ¼ÓÉÏ/-\r
-DLINUX_PROFILE / ¡£\r
-\r
-\r
- 3.8) ΪʲôÔÚÊÔͼÁ¬½ÓµÇ¼ʱÊÕµ½¡°Sorry, too many clients¡±ÏûÏ¢£¿\r
-\r
-ÄãÐèÒªÔö´ó postmaster Æô¶¯Ê±Ö§³ÖµÄ²¢·¢ºǫ́½ø³ÌÊý¡£\r
-\r
-ȱʡÏÞÖÆÊÇ 32 ½ø³Ì¡£Äã¿ÉÒÔͨ¹ý´ø×ÅÊʵ±µÄ /-N/ Öµ¿ª¹ØÆô¶¯ postmaster Ôö¼Ó\r
-Õâ¸öÊýÄ¿¡£»òÕßÐÞ¸Ä /postgresql.conf/ Îļþ¡£\r
-\r
-ҪעÒâÈç¹ûÄã°Ñ /-N/ ÉèÖÃΪ´óÓÚ 32£¬Äã±ØÐëͬÑùÔö´ó /-B/£¬³¬¹ýËüȱʡµÄ\r
-64£»-B ±ØÐë×îÉÙÊÇ -N µÄÁ½±¶£¬¶øÇÒΪÁ˸üºÃµÄÐÔÄÜ¿ÉÄÜÒª±ÈÄǸöÊý×ÖÒª´ó¡£¶Ô\r
-ÓÚ´óÊýÄ¿µÄºó¶Ë½ø³Ì£¬Äã¿ÉÄÜ»¹»á·¢ÏÖÄ㻹ÐèÒªÔö¼ÓÐí¶à Unix ÄÚºËÅäÖòÎÊýÖµ¡£\r
-Òª¼ì²éµÄ¶«Î÷°üÀ¨¹²ÏíÄÚ´æ¿éµÄ×î´ó³ß´ç£¬SHMMAX£¬ÐźŵƵÄ×î´óÊýÄ¿£¬SEMMNS\r
-ºÍ SEMMNI£¬×î´óµÄ½ø³ÌÊý£¬NPROC£¬µ¥Óû§×î´ó½ø³ÌÊý£¬MAXUPRC£¬ÒÔ¼°´ò¿ªÎļþ\r
-µÄ×î´óÊýÄ¿£¬NFILE ºÍ NINODE ¡£Postgres ¶ÔÔÊÐíµÄºǫ́½ø³ÌÊýÓÐÏÞÖƵÄÔÒòÊÇ\r
-ΪÁËÈ·±£ÄãµÄϵͳ²»»áÓùâ×ÊÔ´¡£\r
-\r
-ÔÚ Postgres ÔçÓÚ 6.5 µÄ°æ±¾£¬×î´óºǫ́½ø³ÌÊýȱʡÊÇ 64£¬²¢ÇÒ¶ÔËüµÄÐÞ¸ÄÊ×ÏÈ\r
-ÐèÒªÐÞ¸Ä /include/storage/sinvaladt.h/ ÀïµÄ MaxBackendId ³£Á¿£¬È»ºóÖØÐÂ\r
-BUILD¡£\r
-\r
-\r
- 3.9) pgsql_tmp Ŀ¼ÀﶼÓÐЩʲô£¿\r
-\r
-¸ÃĿ¼Ï±£´æÁ˲éѯִÐÐÆ÷Éú³ÉµÄÁÙʱÎļþ¡£ÀýÈ磬Èç¹ûÐèҪΪÂú×ã ORDER BY Ìõ\r
-¼þ×öÅÅÐò£¬²¢ÇÒÅÅÐòÐèÒª±Èºǫ́µÄ -S ²ÎÊý¸ø³öµÄ¸ü¶àµÄ¿Õ¼ä£¬ÄÇô¾Í»á´´½¨Ò»¸ö\r
-ÁÙʱÎļþ±£´æ¶à³öÀ´µÄÊý¾Ý¡£\r
-\r
-ÁÙʱÎļþÓ¦¸Ã×Ô¶¯É¾³ý£¬²»¹ýÈç¹ûÔÚÅÅÐò¹ý³ÌÖкǫ́±ÀÀ£Á˾ͿÉÄÜÁôÏÂÀ´¡£Í£Ö¹²¢\r
-ÖØÆð postmaster ½«»áɾ³ýÕâЩÎļþ¡£\r
-\r
-\r
- 3.10) ΪʲôҪÔÚÉý¼¶ PostgreSQL ·¢²¼°æ±¾Ê±×ö dump ºÍ restore £¿\r
-\r
-PostgreSQL ¿ª·¢×é¶Ôÿ´ÎСµÄÉý¼¶½ö×öÁ˽ÏÉÙµÄÐÞ¸Ä,Òò´Ë´Ó 7.2 Éý¼¶µ½ 7.2.1\r
-²»ÐèÒª dump ºÍ restore¡£µ«ÊÇÖ÷ÒªµÄÉý¼¶£¨ÀýÈç´Ó 7.2 µ½ 7.3£©Í¨³£»áÐÞ¸Äϵ\r
-ͳ±íºÍÊý¾Ý±íµÄÄÚ²¿¸ñʽ¡£ÕâЩ±ä»¯Ò»°ã±È½Ï¸´ÔÓ£¬Òò´ËÎÒÃDz»Î¬Êý¾ÝÎļþµÄÏòºó\r
-¼æÈÝ¡£dump ½«Êý¾Ý°´ÕÕͨÓõĸñʽÊä³ö£¬Ëæºó¿ÉÒÔ±»ÖØмÓÔز¢Ê¹ÓÃеÄÄÚ²¿¸ñʽ¡£\r
-\r
-´ÅÅÌÎļþ¸ñʽûÓб仯µÄÉý¼¶£¬¿ÉÒÔÓà /pg_upgrade/ ½Å±¾£¬¶ø²»ÐèÒª×ö dump ºÍ\r
-restor¡£·¢²¼ËµÃ÷script »áÖ¸Ã÷ /pg_upgrade/ ¶Ô¸Ã´ÎÉý¼¶ÊÇ·ñ¿ÉÓá£\r
-\r
-------------------------------------------------------------------------\r
-\r
-\r
- ²Ù×÷ÎÊÌâ\r
-\r
-\r
- 4.1) ¶þ½øÖÆÓαêºÍÆÕͨÓαêÖ®¼äµÄÇø±ðÊÇʲô£¿\r
-\r
-²ÎÔÄ DECLARE ÊÖ²áÒ³»ñÈ¡ÐÅÏ¢¡£\r
-\r
-\r
- 4.2)ÈçºÎÖ» SELECT Ò»¸ö²éѯ½á¹ûµÄÍ·¼¸ÐУ¿\r
-\r
-²ÎÔÄ FETCH ÊÖ²áÒ³£¬»òÕßʹÓà SELECT ... LIMIT....\r
-\r
-¼´Ê¹ÄãÖ»ÐèÒª¿ªÍ·µÄ¼¸ÐУ¬Ò²»áÉæ¼°µ½Õû¸ö²éѯ¡£ÊÔ×ÅʹÓôøÓÐ ORDER BY µÄ²é\r
-ѯ¡£Èç¹ûÓÐÒ»¸öË÷ÒýÓë ORDER BY Æ¥Å䣬PostgreSQL ¿ÉÄܾÍÖ»´¦ÀíÒªÇóµÄÍ·¼¸Ìõ\r
-¼Ç¼£¬·ñÔò½«¶ÔÕû¸ö²éѯ½øÐд¦ÀíÖ±µ½Éú³ÉÐèÒªµÄÐС£\r
-\r
-\r
- 4.3) ÎÒÈçºÎ»ñÈ¡Ò»¸ö±íµÄÁÐ±í£¬»òÕßÊÇÆäËûÎÒÄÜÔÚ /psql/ Àï¿´µ½µÄ¶«Î÷£¿\r
-\r
-Äã¿ÉÒÔÔĶÁ /psql/ µÄÔ´´úÂëÎļþ/pgsql/src/bin/psql/describe.c/ ¡£Ëü°üÀ¨Îª\r
-Éú³É psql µÄ·´Ð±¸ÜÃüÁîµÄÊä³öµÄ SQL ÃüÁî¡£Ä㻹¿ÉÒÔ´ø /-E/ Ñ¡ÏîÆô¶¯\r
-/psql/£¬ÕâÑùËü½«´òÓ¡³öÖ´ÐÐÄã¸ø³öµÄÃüÁîËùÓõIJéѯ¡£\r
-\r
-\r
- 4.4) ÔõÑù´Ó±íÀïÃæɾ³ýÒ»ÁУ¿\r
-\r
-7.3 ÀïÔö¼ÓÁË ALTER TABLE DROP COLUMN£¬ÒÔÖ§³Ö´ËÏÄÜ¡£ÔÚÒÔÇ°µÄ°æ±¾ÖУ¬¿É\r
-ÒÔÕâÑù×ö£º\r
-\r
- BEGIN;\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\r
+<!-- saved from url=(0063)file://I:\Wlzhang\MyDoc\postgresql\FAQcn.files\postgres-faq.htm -->\r
+<!-- saved from url=(0046)http://laser.zhengmai.com.cn/postgres-faq.html --><HTML><HEAD><TITLE>PostgreSQL \r
+ FAQ-ch</TITLE>\r
+ <META content="text/html; charset=gb_2312-80" http-equiv="Content-Type">\r
+ <META content="Microsoft FrontPage 4.0" name="GENERATOR">\r
+ </HEAD>\r
+ <BODY aLink="#0000ff" bgColor="#ffffff" link="#ff0000" text="#000000" vLink="#a00000">\r
+ <H1>PostgreSQL ³£¼ûÎÊÌ⣨FAQ£©</H1> \r
+ ×î½ü¸üУº2003 Äê 01 Ô 06 ÈÕ ÐÇÆÚÒ» 22:27:35 CST\r
+ <P>Ŀǰά»¤ÈËÔ±£ºBruce Momjian (<A href="mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>) \r
+ <BR>\r
+ ÖÐÎÄ°æά»¤ÈËÔ±£ººÎΰƽ £¨laser@pgsqldb.com \r
+ £©<P>±¾ÎĵµµÄ×îа汾¿ÉÒÔÔÚ<a href="http://www.postgresql.org/files/documentation/faqs/FAQ.html">http://www.postgresql.org/files/documentation/faqs/FAQ.html</a> \r
+ ²é¿´¡£<P>²Ù×÷ϵͳƽ̨Ïà¹ØµÄÎÊÌâÔÚ<a href="http://www.postgresql.org/docs/faq/">http://www.postgresql.org/docs/faq/</a>Àï»Ø´ð¡£<br> \r
+ <HR>\r
+ <CENTER>\r
+ <H2>³£¼ûÎÊÌâ</H2>\r
+ </CENTER>\r
+ <a href="#1.1">1.1</a>) \r
+ PostgreSQL ÊÇʲô£¿¸ÃÔõô·¢Òô£¿ \r
+ <BR>\r
+ <a href="#1.2">1.2</a>) \r
+ PostgreSQL µÄ°æȨÊÇʲô? \r
+ <BR>\r
+ <A href="#1.3">1.3</A>) \r
+ PostgreSQL ÔËÐÐÔÚʲô Unix ƽ̨ÉÏ£¿ \r
+ <BR>\r
+ <A href="#1.4">1.4</A>) ¿ÉÓÃµÄ·Ç Unix \r
+ ƽ̨ÓÐÄÇЩ£¿\r
+ <BR>\r
+ <A href="#1.5">1.5</A>) ÎÒ´ÓÄÄÀïÄܵõ½ \r
+ PostgreSQL£¿\r
+ <BR>\r
+ <A href="#1.6">1.6</A>) ÎÒ´ÓÄÄÀïÄܵõ½¶Ô \r
+ PostgreSQL µÄÖ§³Ö£¿ \r
+ <BR>\r
+ <A href="#1.7">1.7</A>) \r
+ PostgreSQL ×îеİ汾ÊÇʲô£¿ \r
+ <BR>\r
+ <A href="#1.8">1.8</A>) ÓÐÄÄЩ¿ÉÓÃµÄ \r
+ PostgreSQL µÄÎĵµ£¿ \r
+ <BR>\r
+ <A href="#1.9">1.9</A>) ÎÒÈçºÎÁ˽âÒÑÖªµÄ BUG \r
+ »òȱʧµÄÌØÐÔ£¿\r
+ <BR>\r
+ <A href="#1.10">1.10</A>) ÎÒÓ¦¸ÃÔõÑùѧϰ \r
+ SQL £¿ \r
+ <BR>\r
+ <A href="#1.11">1.11</A>) \r
+ PostgreSQL ÊÇ Y2K ¼æÈݵÄÂ𣿠\r
+ <BR>\r
+ <A href="#1.12">1.12</A>) \r
+ ÎÒÓ¦¸ÃÔõÑù¼ÓÈ뿪·¢¶ÓÎ飿\r
+ <BR>\r
+ <A href="#1.13">1.13</A>) \r
+ ÎÒÓ¦¸ÃÔõÑùÌá½»Ò»¸ö BUG ±¨¸æ£¿ \r
+ <BR>\r
+ <A href="#1.14">1.14</A>) \r
+ PostgreSQL ºÍÆäËû DBMS ±ÈÆðÀ´ÈçºÎ£¿<br> \r
+ <a href="#1.15">1.15</a>) ÎÒÓ¦¸ÃÔõÑùÔÞÖú \r
+ PostgreSQL £¿ \r
+ <CENTER>\r
+ <H2>Óû§¿Í»§¶ËÎÊÌâ</H2>\r
+ </CENTER>\r
+ <A href="#2.1">2.1</A>) ÓÐ \r
+ PostgreSQL µÄ ODBC Çý¶¯³ÌÐòô£¿ \r
+ <BR>\r
+ <A href="#2.2">2.2</A>) ÓÐʲô¹¤¾ß¿ÉÒÔ°Ñ \r
+ PostgreSQL ÓÃÓÚ Web Ò³Ã棿 \r
+ <BR>\r
+ <A href="#2.3">2.3</A>) \r
+ PostgreSQL ÓµÓÐͼÐÎÓû§½çÃæÂ𣿠\r
+ <BR>\r
+ <A href="#2.4">2.4</A>) \r
+ ÎÒÃÇ¿ÉÒÔÓÃʲôÓïÑÔºÍ PostgreSQL ´ò½»µÀ£¿ \r
+ <CENTER>\r
+ <H2>ϵͳ¹ÜÀíÎÊÌâ</H2>\r
+ </CENTER>\r
+ <a href="#3.1">3.1</a>) ÎÒÔõÑùÄÜ°Ñ \r
+ PostgreSQL ×°ÔÚ /usr/local/pgsql ÒÔÍâµÄµØ·½£¿ \r
+ <BR>\r
+ <a href="#3.2">3.2</a>) µ±ÎÒÔËÐÐ \r
+ postmaster ʱ£¬³öÏÖ<I> Bad System Call</I>£¨ÏµÍ³µ÷ÓÃ´í£©»ò Core Dumped ´íÎó¡£ÎªÊ²Ã´£¿ \r
+ <BR>\r
+ <a href="#3.3">3.3</a>) µ±ÎÒÊÔͼÔËÐÐ \r
+ postmaster ʱ£¬³öÏÖ <I>IpcMemoryCreate</I> ´íÎó¡£ÎªÊ²Ã´£¿ \r
+ <BR>\r
+ <a href="#3.4">3.4</a>) µ±ÎÒÊÔͼÔËÐÐ \r
+ postmaster ʱ£¬³öÏÖ <I>IpcSemaphoreCreate</I> ´íÎó¡£ÎªÊ²Ã´£¿ \r
+ <BR>\r
+ <a href="#3.5">3.5</a>) \r
+ ÎÒÈçºÎ¿ØÖÆÀ´×ÔÆäËûÖ÷»úµÄÁ¬½Ó£¿\r
+ <BR>\r
+ <a href="#3.6">3.6</a>) \r
+ ÎÒÔõÑùµ÷ÕûÊý¾Ý¿âÒýÇæÒÔ»ñµÃ¸üºÃµÄÐÔÄÜ£¿\r
+ <BR>\r
+ <a href="#3.7">3.7</a>) \r
+ PostgreSQL Àï¿ÉÒÔ»ñµÃʲôÑùµÄµ÷ÊÔÌØÐÔ£¿ \r
+ <BR>\r
+ <a href="#3.8">3.8</a>) \r
+ ΪʲôÔÚÊÔͼÁ¬½ÓµÇ¼ʱÊÕµ½¡°Sorry, too many clients¡± ÏûÏ¢£¿<br> \r
+ <a href="#3.9">3.9</a>) \r
+ pgsql_tmp Ŀ¼ÀﶼÓÐЩʲô£¿<br> \r
+ <a href="#3.10">3.10</a>) ΪʲôҪÔÚÉý¼¶ \r
+ PostgreSQL ·¢²¼°æ±¾Ê±×ö dump ºÍ restore £¿ \r
+ <CENTER>\r
+ <H2>²Ù×÷ÎÊÌâ</H2>\r
+ </CENTER>\r
+ <a href="#4.1">4.1</a>) \r
+ ¶þ½øÖÆÓαêºÍÆÕͨÓαêÖ®¼äµÄÇø±ðÊÇʲô£¿\r
+ <BR>\r
+ <a href="#4.2">4.2</a>) \r
+ ÈçºÎֻѡÔñÒ»¸ö²éѯ½á¹ûµÄÍ·¼¸ÐУ¿\r
+ <BR>\r
+ <a href="#4.3">4.3</a>) \r
+ ÎÒÈçºÎ»ñÈ¡Ò»¸öÊý¾Ý¿âÖбíµÄÁÐ±í£¬»òÕßÊÇÆäËûÎÒÄÜÔÚ <I>psql </I>Àï¿´µ½µÄ¶«Î÷£¿ \r
+ <BR>\r
+ <a href="#4.4">4.4</a>) \r
+ ÔõÑù´Ó±íÀïÃæɾ³ýÒ»ÁУ¿\r
+ <BR>\r
+ <a href="#4.5">4.5</a>) \r
+ Ò»ÐУ¬Ò»¸ö±í£¬Ò»¸ö¿âµÄ×î´ó³ß´çÊǶàÉÙ£¿\r
+ <BR>\r
+ <a href="#4.6">4.6</a>) \r
+ ´æ´¢Ò»¸öµäÐ͵ÄÎı¾ÎļþÀïµÄÊý¾ÝÐèÒª¶àÉÙ´ÅÅ̿ռ䣿\r
+ <BR>\r
+ <a href="#4.7">4.7</a>) \r
+ ÈçºÎ²é¿´±í¡¢Ë÷Òý¡¢Êý¾Ý¿âÒÔ¼°Óû§µÄ¶¨Ò壿\r
+ <BR>\r
+ <a href="#4.8">4.8</a>) \r
+ ÎҵIJéѯºÜÂý»òÕßûÓÐÀûÓÃË÷Òý¡£ÎªÊ²Ã´£¿\r
+ <BR>\r
+ <a href="#4.9">4.9</a>) \r
+ ÎÒÈçºÎ²ÅÄÜ¿´µ½²éѯÓÅ»¯Æ÷ÊÇÔõÑù´¦ÀíÎҵIJéѯµÄ£¿\r
+ <BR>\r
+ <a href="#4.10">4.10</a>) R-tree \r
+ Ë÷ÒýÊÇʲô£¿\r
+ <BR>\r
+ <a href="#4.11">4.11</a>) \r
+ ʲôÊÇ»ùÒò²éѯÓÅ»¯£¨Genetic Query Optimization£©£¿ \r
+ <BR>\r
+ <a href="#4.12">4.12</a>) \r
+ ÎÒÔõÑù×öÕýÔò±í´ïʽËÑË÷ºÍ´óСдÎ޹صÄÕýÔò±í´ïʽ²éÕÒ£¿ÔõÑùÀûÓÃË÷Òý½øÐдóСдÎ޹زéÕÒ£¿\r
+ <BR>\r
+ <a href="#4.13">4.13</a>) \r
+ ÔÚÒ»¸ö²éѯÀÎÒÔõÑù¼ì²âÒ»¸ö×Ö¶ÎÊÇ·ñΪ NULL£¿ \r
+ <BR>\r
+ <a href="#4.14">4.14</a>) \r
+ ¸÷ÖÖ×Ö·ûÀàÐÍÖ®¼äÓÐʲô²»Í¬£¿\r
+ <BR>\r
+ <a href="#4.15.1">4.15.1</a>) \r
+ ÎÒÔõÑù´´½¨Ò»¸öÐòÁкÅ/×Ô¶¯µÝÔöµÄ×ֶΣ¿\r
+ <BR>\r
+ <a href="#4.15.2">4.15.2</a>) \r
+ ÎÒÈçºÎ»ñµÃÒ»¸ö²åÈëµÄÐòÁкŵÄÖµ£¿\r
+ <BR>\r
+ <a href="#4.15.3">4.15.3</a>) ʹÓà \r
+ currval() ºÍ nextval() »áµ¼ÖºÍÆäËûÓû§µÄÎÉÂÒÇé¿ö£¨race condition£©Âð£¿<br> \r
+ <a href="#4.15.4">4.15.4</a>) \r
+ Ϊʲô²»ÔÚÊÂÎñÒì³£ÖÐÖ¹ºóÖØÓÃÐòÁкÅÄØ£¿ÎªÊ²Ã´ÔÚÐòÁкÅ×ֶεÄÈ¡ÖµÖдæÔÚ¼ä¶ÏÄØ£¿\r
+ <BR>\r
+ <a href="#4.16">4.16</a>) ʲôÊÇ \r
+ OID£¿Ê²Ã´ÊÇ TID £¿ \r
+ <BR>\r
+ <a href="#4.17">4.17</a>) \r
+ PostgreSQL ʹÓõÄһЩÊõÓïµÄº¬ÒåÊÇʲô£¿ \r
+ <BR>\r
+ <a href="#4.18">4.18</a>) \r
+ ΪʲôÎÒÊÕµ½´íÎó¡°<i>ERROR: Memory exhausted in AllocSetAlloc()</i>¡±£¿<br>\r
+ <a href="#4.19">4.19</a>) \r
+ ÎÒÈçºÎ²ÅÄÜÖªµÀËùÔËÐÐµÄ PostgreSQL µÄ°æ±¾£¿ \r
+ <BR>\r
+ <a href="#4.20">4.20</a>) \r
+ ΪʲôÎҵĴó¶ÔÏó²Ù×÷µ¼Ö´íÎó¡°<I>invalid large obj descriptor¡±£¨·Ç·¨µÄ´ó¶ÔÏóÃèÊö·û£©</I>£¿ \r
+ <BR>\r
+ <a href="#4.21">4.21</a>) \r
+ ÎÒÈçºÎ´´½¨Ò»¸öȱʡֵÊǵ±Ç°Ê±¼äµÄ×ֶΣ¿\r
+ <BR>\r
+ <a href="#4.22">4.22</a>) ΪʲôʹÓà <TT>IN</TT> \r
+ µÄ×Ó²éѯÕâôÂý£¿ \r
+ <BR>\r
+ <a href="#4.23">4.23</a>) ÈçºÎ½øÐÐ \r
+ outer join £¨ÍâÁ¬½Ó£©£¿<br> \r
+ <a href="#4.24">4.24</a>) \r
+ ÈçºÎʹÓÃÉæ¼°¶à¸öÊý¾Ý¿âµÄ²éѯ£¿<br>\r
+ <CENTER>\r
+ </CENTER>\r
+ <a href="#4.25">4.25</a>) \r
+ ÈçºÎÈú¯Êý·µ»Ø¶àÐлò¶àÁУ¿<br>\r
+ <CENTER>\r
+ </CENTER>\r
+ <a href="#4.26">4.26</a>) ΪʲôÔÚ \r
+ PL/PgSQL º¯ÊýÖв»ÄÜ¿É¿¿µØ´´½¨»òɾ³ýÁÙʱ±í£¿<br> \r
+ <CENTER>\r
+ </CENTER>\r
+ <a href="#4.27">4.27</a>) \r
+ ÓÐÄÄЩÊý¾Ý¸´ÖÆÑ¡Ï<br>\r
+ <a href="#4.28">4.28</a>) \r
+ ÓÐÄÄЩÊý¾Ý¼ÓÃÜÑ¡Ï\r
+ <CENTER>\r
+ <H2>À©Õ¹ PostgreSQL</H2> \r
+ </CENTER>\r
+ <A href="#5.1">5.1</A>) \r
+ ÎÒдÁËÒ»¸öÓû§¶¨Ò庯Êý¡£µ±ÎÒÔÚ<I> psql</I> ÀïÔËÐÐʱ£¬ÎªÊ²Ã´»áµ¼Ö core dump£¿ \r
+ <BR>\r
+ <a href="#5.2">5.2</a>) ÎÒÈçºÎÄܸø \r
+ PostgreSQL ¹±Ï×һЩͦ²»´íµÄÐÂÀàÐͺͺ¯Êý£¿ \r
+ <BR>\r
+ <a href="#5.3">5.3</a>) \r
+ ÎÒÔõÑùдһ¸ö·µ»ØÒ»Ìõ¼Ç¼µÄ C º¯Êý£¿ \r
+ <BR>\r
+ <a href="#5.4">5.4</a>) \r
+ ÎÒÐÞ¸ÄÁËÒ»¸öÔ´Îļþ£¬ÎªÊ²Ã´ÖØбàÒëºóûÓп´µ½¸Ä±ä£¿\r
+ <BR>\r
+ <HR>\r
+ <CENTER>\r
+ <H2>³£¼ûÎÊÌâ</H2>\r
+ </CENTER>\r
+ <H4><A name="1.1"></A>1.1) PostgreSQL ÊÇʲô£¿¸ÃÔõô·¢Òô£¿</H4> \r
+ PostgreSQL ¶Á×÷ <I>Post-Gres-Q-L</I><i> ¡£</i> \r
+ <p>PostgreSQL ÊÇÏÂÒ»´ú DBMS µÄÑо¿ÔÐÍ POSTGRES Êý¾Ý¿â¹ÜÀíϵͳµÄÔöÇ¿°æ¡£PostgreSQL ÔÚ±£³Ö POSTGRES \r
+ µÄÇ¿´óµÄÊý¾ÝÄ£ÐͺͷḻµÄÊý¾ÝÀàÐ͵Ļù´¡ÉÏ£¬ÓÃÒ»¸öÀ©Õ¹Á赀 SQL ×Ó¼¯È¡´úÁËÔÏ鵀 PostQuel ²éѯÓïÑÔ¡£PostgreSQL \r
+ ÊÇ×ÔÓɵIJ¢ÇÒËùÓÐÔ´´úÂ붼¿ÉÒÔ»ñµÃ¡£</p>\r
+ <P>PostgreSQL µÄ¿ª·¢ÓÉ²Î¼Ó PostgreSQL ¿ª·¢ÓʼþÁбíµÄÒ»¸ö¿ª·¢ÈËԱС×é½øÐС£Ä¿Ç°µÄе÷ÈËÊÇ Marc G. Fournier £¨<A href="mailto:scrappy@postgreSQL.org">scrappy@postgreSQL.org</A> \r
+ £©¡££¨¹ØÓÚÈçºÎ¼ÓÈë²Î¼û1.6½Ú£©¡£Õâ¸ö¶ÓÎéÏÖÔÚ¸ºÔð PostgreSQL µÄËùÓпª·¢¡£ \r
+ <P>\r
+ PostgreSQL 1.01 µÄ×÷ÕßÊÇ Andrew Yu ºÍ Jolly \r
+ Chen¡£»¹ÓÐÐí¶àÆäËûÈËΪÒÆÖ²£¬²âÊÔ£¬µ÷ÊÔºÍÔöÇ¿´úÂë×öÁË´óÁ¿¹±Ïס£PostgreSQL µÄ×î³õÆðÔ´ Postgres£¬ÊÇÔÚ¼ÓÖÝ´óѧ²®¿ËÀû·ÖУµÄ Michael \r
+ Stonebraker ½ÌÊÚµÄÖ¸µ¼Ï£¬ÓÉÐí¶àÑо¿Éú£¬±¾¿ÆÉúºÍ±à³ÌÖ°Ô±Íê³ÉµÄ¡£ \r
+ <P>Õâ¸öÈí¼þ×î³õÔÚ²®¿ËÀûµÄÃû×ÖÊÇ Postgres¡£ÔÚ 1995 Ä꣬µ±Ôö¼ÓÁË SQL ¹¦Äܺó£¬ËüµÄÃû×Ö¸Ä³É Postgres95¡£ÔÚ 1996ÄêÄ©£¬²Å¸ÄÃûΪ \r
+ PostgreSQL¡£\r
+ <H4><A name="1.2"></A>1.2) PostgreSQL µÄ°æȨÊÇʲô?</H4> \r
+ PostgreSQL ÊÜÏÂÃæµÄ°æȨԼÊø¡£ \r
+ <P>\r
+ PostgreSQL Êý¾Ý¿â¹ÜÀíϵͳ \r
+ <P>\r
+ £¨PostgreSQL Data Base Management System£©<P>²¿·Ö°æȨ£¨c£©1996-2002£¬PostgreSQL È«Çò¿ª·¢Ð¡×é<br> \r
+ ²¿·Ö°æȨ£¨c£©1994-6 ¼ÓÖÝ´óѧ¶Ê \r
+ <P>£¨Portions copyright (c) 1996-2002, PostgreSQL Global Development Group<br> \r
+ Portions Copyright (c) 1994-6 Regents of the University of California£© \r
+ <P>\r
+ ÔÊÐíΪÈκÎÄ¿µÄʹÓ㬿½±´£¬Ð޸ĺͷַ¢Õâ¸öÈí¼þºÍËüµÄÎĵµ¶ø²»ÊÕÈ¡ÈκηÑÓ㬲¢ÇÒÎÞÐëÇ©ÊðÒò´Ë¶ø²úÉúµÄÖ¤Ã÷£¬Ç°ÌáÊÇÉÏÃæµÄ°æȨÉùÃ÷ºÍ±¾¶ÎÒÔ¼°ÏÂÃæÁ½¶ÎÎÄ×Ö³öÏÖÔÚËùÓп½±´ÖС£\r
+ <P>\r
+ £¨Permission to use, copy, modify, and distribute this software and its \r
+ documentation for any purpose, without fee, and without a written agreement is \r
+ hereby granted, provided that the above copyright notice and this paragraph and \r
+ the following two paragraphs appear in all copies.£© \r
+ <P>\r
+ ÔÚÈκÎÇé¿öÏ£¬¼ÓÖÝ´óѧ¶¼²»³Ðµ£ÒòʹÓôËÈí¼þ¼°ÆäÎĵµ¶øµ¼ÖµĶÔÈκε±ÊÂÈ˵ÄÖ±½ÓµÄ£¬¼ä½ÓµÄ£¬ÌØÊâµÄ£¬¸½¼ÓµÄ»òÕßÏà°é¶øÉúµÄË𻵣¬°üÀ¨ÀûÒæËðʧµÄÔðÈΣ¬¼´Ê¹¼ÓÖÝ´óѧÒѾ½¨ÒéÁËÕâЩËðʧµÄ¿ÉÄÜÐÔʱҲÊÇÈç´Ë¡£\r
+ <P>\r
+ £¨IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR \r
+ DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST \r
+ PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF \r
+ THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH \r
+ DAMAGE.£©\r
+ <P>\r
+ ¼ÓÖÝ´óѧÃ÷È··ÅÆúÈκα£Ö¤£¬°üÀ¨µ«²»¾ÖÏÞÓÚijһÌض¨ÓÃ;µÄÉÌÒµºÍÀûÒæµÄÒþº¬±£Ö¤¡£ÕâÀïÌṩµÄÕâ·ÝÈí¼þÊÇ»ùÓÚ¡°µ±×÷ÊÇ¡±µÄ»ù´¡µÄ£¬Òò¶ø¼ÓÖÝ´óѧûÓÐÔðÈÎÌṩά»¤£¬Ö§³Ö£¬¸üУ¬ÔöÇ¿»òÕßÐ޸ĵķþÎñ¡£<P>£¨THE \r
+ UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT \r
+ NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A \r
+ PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND \r
+ THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, \r
+ SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.£©<br> \r
+ <br>\r
+ ÉÏÃæ¾ÍÊÇ BSD °æȨÉùÃ÷£¬Ò»¸ö¾µäµÄ¿ªÔ´°æȨÉùÃ÷¡£Ëü¶ÔÔ´´úÂëµÄʹÓÃδ×÷ÈκÎÏÞÖÆ¡£ÎÒÃÇϲ»¶Ëü²¢ÇÒ²»´òËã¸Ä±äËü¡£ \r
+ <H4><A name="1.3"></A>1.3) PostgreSQL ÔËÐÐÔÚʲô Unix ƽ̨ÉÏ£¿</H4> \r
+ <p>Ò»°ã˵À´£¬Ò»¸öÏÖ´úµÄ UNIX ¼æÈݵÄƽ̨¶¼ÄÜÔËÐÐ PostgreSQL ¡£ÔÚ°²×°Ö¸ÄÏÀïÁгöÁË·¢²¼Ê±¾¹ýÃ÷È·²âÊÔµÄƽ̨¡£</p> \r
+ <UL>\r
+ </UL>\r
+ <H4><A name="1.4"></A>1.4) ¿ÉÓÃµÄ·Ç Unix ƽ̨ÓÐÄÄЩ£¿</H4> \r
+ ¿Í»§¶Ë\r
+ <p>°Ñ libpq C ¿â£¬psql£¬ÆäËû½Ó¿ÚºÍ¿Í»§¶ËÓ¦ÓóÌÐò±àÒë³É¿ÉÒÔÔÚ MS Windows ƽ̨ÉÏÔËÐÐÊÇ¿ÉÄܵġ£ÕâÖÖÇé¿öÏ£¬¿Í»§¶ËÔÚ MS Windows \r
+ ÉÏÔËÐУ¬²¢ÇÒͨ¹ý TCP/IP ÓëÒ»¸öÔËÐÐÔÚÎÒÃÇÖ§³ÖµÄ Unix ƽ̨ÉϵķþÎñÆ÷½øÐÐͨѶ¡£·¢²¼°æ±¾Öаüº¬Ò»¸öÎļþ win32.mak ÓÃÓÚÉú³É Win32 \r
+ libpq ¿âºÍ psql ¡£PostgreSQL Ò²¿ÉÒÔºÍ ODBC ¿Í»§¶ËͨѶ¡£</p> \r
+ <p>·þÎñÆ÷</p>\r
+ <P>Êý¾Ý¿â·þÎñÆ÷ÏÖÔÚ¿ÉÒÔͨ¹ý Cygwin £¬Cygnus µÄ Unix/NT ÒÆÖ²¿âÔÚ Windows NT ºÍ Win2k ÉÏÔËÐС£²ÎÔÄ·¢²¼°æ±¾ÀïµÄ See <i>pgsql/doc/FAQ_MSWIN</i> \r
+ Îļþ»ò <a href="http://www.PostgreSQL.org/docs/faq-mswin.html">http://www.PostgreSQL.org/docs/faq-mswin.html</a> \r
+ ¡£ \r
+ <P>ÒÆÖ²µ½ MS Win NT/2000/XP µÄ±¾»ú°æµÄ¹¤×÷ÕýÔÚ½øÐС£ \r
+ <H4><A name="1.5"></A>1.5) ÎÒ´ÓÄÄÀïÄܵõ½ PostgreSQL£¿</H4> \r
+ <P>PostgreSQL µÄÖ÷ÄäÃûFTPÕ¾µãÊÇ <a href="ftp://ftp.PostgreSQL.org/pub">ftp://ftp.PostgreSQL.org/pub</a>£¬¾µÏñÕ¾µã¿ÉÒԲο¼ÎÒÃÇÍøÕ¾µÄÖ÷Ò³¡£ \r
+ <H4><A name="1.6"></A>1.6) ÎÒ´ÓÄÄÀïÄܵõ½¶Ô PostgreSQL µÄÖ§³Ö£¿</H4> \r
+ <P>Ö÷ÒªµÄÓʼþÁбíÊÇ£º<A href="mailto:pgsql-general@postgreSQL.org">pgsql-general@postgreSQL.org</A>¡£¿ÉÒÔÔÚÄÇÀïÌÖÂÛÓÐ¹Ø \r
+ PostgreSQL µÄÎÊÌâ¡£Òª¼ÓÈëÁÐ±í£¬·¢Ò»·âÓʼþÄÚÈÝ£¨²»ÊÇÖ÷ÌâÐУ©Îª \r
+ <PRE> subscribe\r
+ end</PRE>\r
+ µÄÓʼþµ½ <A href="mailto:pgsql-general-request@postgreSQL.org">pgsql-general-request@postgreSQL.org</A> \r
+ ¡£ \r
+ <P>»¹¿ÉÒÔ»ñÈ¡ÕªÒªÁÐ±í¡£Òª¼ÓÈëÕâ¸öÁÐ±í£¬·¢Óʼþµ½£º<A href="mailto:pgsql-general-digest-request@postgreSQL.org">pgsql-general-digest-request@postgreSQL.org</A>£¬ÆäÄÚÈÝΪ£º\r
+ <PRE> subscribe\r
+ end</PRE>\r
+ ÿµ±Ö÷Áбí´ïµ½´óÔ¼ 30k µÄÏûÏ¢ÄÚÈÝʱ£¬ÕªÒª¾Í·¢Ë͸øÕâ¸öÁбíµÄ³ÉÔ±¡£ \r
+ <P>»¹¿ÉÒԲμӳô³æÓʼþÁÐ±í¡£Òª¼ÓÈëÕâ¸öÁÐ±í£¬·¢ËÍÒ»¸öÓʼþµ½ <A href="mailto:bugs-request@postgreSQL.org">bugs-request@postgreSQL.org</A>£¬ÄÚÈÝΪ£º \r
+ <PRE> subscribe\r
+ end</PRE>\r
+ »¹¿ÉÒԲμӿª·¢ÈËÔ±ÓʼþÁÐ±í¡£Òª¼ÓÈëÕâ¸öÁÐ±í£¬·¢ËÍÒ»¸öÓʼþµ½ <A href="mailto:hackers-request@postgreSQL.org">hackers-request@postgreSQL.org</A>£¬ÄÚÈÝΪ£º \r
+ <PRE> subscribe\r
+ end</PRE>\r
+ ÆäËûµÄ¹ØÓÚ PostgreSQL ÓʼþÁбíºÍÆäËûÐÅÏ¢¿ÉÒÔÔÚ PostgreSQL µÄ WWW Ö÷Ò³ÕÒµ½£º <BLOCKQUOTE><A href="http://postgresql.org/">http://postgresql.org/</A></BLOCKQUOTE> \r
+ ÔÚ EFNet ÀﻹÓÐÒ»¸ö IRC ƵµÀ£¬ÆµµÀ #PostgreSQL¡£ÎÒÓà unix ÃüÁî<TT>irc -c '#PostgreSQL' "$USER" \r
+ irc.phoenix.net</TT>\r
+ <P>ÉÌÒµÖ§³Ö¹«Ë¾µÄÁбíÔÚ <a href="http://www.PostgreSQL.org/users-lounge/commercial-support.html">http://www.PostgreSQL.org/users-lounge/commercial-support.html</a> \r
+ ¡£ \r
+ <H4><A name="1.7"></A>1.7) PostgreSQL ×îеİ汾ÊÇʲô£¿</H4> \r
+ PostgreSQL ×îеİ汾ÊÇ°æ±¾ 7.2.3¡££¨Òë×¢£ºÏÖÔÚÓ¦¸ÃÊÇ 7.3.1 ÁË¡££© \r
+ <P>ÎÒÃǼƻ®Ã¿ËĸöÔ·¢²¼Ò»¸öÖ÷Òª°æ±¾¡£\r
+ <H4><A name="1.8"></A>1.8) ÓÐÄÄЩ¿ÉÓÃµÄ PostgreSQL µÄÎĵµ£¿</H4> \r
+ ÔÚ·¢²¼°üÀïÓÐһЩÊֲᣬÊÖ²áÒ³ºÍһЩСµÄ²âÊÔÀý×Ó¡£²Î¼û /doc Ŀ¼¡££¨Òë×¢£ºÓ¦Îª $PGHOME/doc£©¡£Ä㻹¿ÉÒÔÔÚÏßä¯ÀÀ PostgreSQL \r
+ µÄÊֲᣬÔÚ <a href="http://www.PostgreSQL.org/users-lounge/docs/">http://www.PostgreSQL.org/users-lounge/docs/</a> \r
+ ¡£<P>ÓÐÁ½±¾¹ØÓÚ PostgreSQL µÄÊéÔÚÏßÌṩ£¬ÔÚ <a href="http://www.PostgreSQL.org/docs/awbook.html"> \r
+ http://www.PostgreSQL.org/docs/awbook.html</a> ºÍ <a href="http://www.commandprompt.com/ppbook/"> \r
+ http://www.commandprompt.com/ppbook/</a> ¡£ÔÚ <a href="http://www.ca.PostgreSQL.org/books/"> \r
+ http://www.ca.PostgreSQL.org/books/</a> ÉÏÓйØÓÚ PostgreSQL µÄ¿É¹ºÊé¼®µÄÁÐ±í¡£ÔÚ <a href="http://techdocs.PostgreSQL.org/"> \r
+ http://techdocs.PostgreSQL.org/</a>\r
+ ÉÏÊÕ¼¯ÁËÓÐ¹Ø PostgreSQL µÄ¼¼ÊõÎÄÕ¡£ \r
+ <P><I>psql</I>\r
+ ÓÐһЩ²»´íµÄ \d ÃüÁÏÔʾ¹ØÓÚÀàÐÍ£¬²Ù×÷·û£¬º¯Êý£¬¾Û¼¯µÈµÄÐÅÏ¢¡£ \r
+ <P>ÎÒÃÇµÄ web Õ¾µã°üº¬¸ü¶àµÄÎĵµ£®<H4><A name="1.9"></A>1.9) \r
+ ÎÒÈçºÎÁ˽âÒÑÖªµÄ BUG ºÍȱʧµÄÌØÐÔ£¿</H4> \r
+ PostgreSQL Ö§³ÖÒ»¸öÀ©Õ¹Á赀 SQL-92 µÄ×Ó¼¯¡£²ÎÔÄÎÒÃÇµÄ <A href="http://www.postgresql.org/docs/todo.html"> \r
+ TODO</A> <A href="http://www.postgresql.org/docs/todo.html"></A>ÁÐ±í£¬»ñÈ¡Ò»¸öÒÑÖª³ô³æ£¬È±Ê§ÌØÐÔºÍδÀ´¼Æ»®¡£ \r
+ <H4><A name="1.10"></A>1.10) ÎÒÓ¦¸ÃÔõÑùѧϰ SQL£¿</H4> \r
+ ÔÚ <A href="http://www.postgresql.org/docs/awbook.html">http://www.postgresql.org/docs/awbook.html</A> \r
+ µÄ¹ØÓÚ PostgreSQL µÄÊé½ÌÊÚ SQL¡££¨Òë×¢£ºÎÒÏÂÔص½±¾µØÁË¡££©ÔÚ <a href="http://www.commandprompt.com/ppbook/"> \r
+ http://www.commandprompt.com/ppbook</a> ÓÐÁíÍâÒ»±¾¹ØÓÚ PostgreSQL µÄÊé¡£ÔÚ<a href="http://www.intermedia.net/support/sql/sqltut.shtm">http://www.intermedia.net/support/sql/sqltut.shtm</a>£¬<a href="http://ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM">http://ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM </a> \r
+ ºÍ <a href="http://sqlcourse.com/">http://sqlcourse.com</a> \r
+ ÓÐÒ»¸ö²»´íµÄÈëÃŽ̡̳£ \r
+ <P>ÁíÒ»¸öÊÇ "Teach Yourself SQL in 21 Days, Second Edition"£¨21Ììѧ»áSQL£¬µÚ¶þ°æ£©£¬ÔÚ <A href="http://members.tripod.com/er4ebus/sql/index.htm"> \r
+ http://members.tripod.com/er4ebus/sql/index.htm</A>\r
+ <P>ÎÒÃǵÄÐí¶àÓû§Ï²»¶ <I>The Practical SQL Handbook, Bowman, Judith S., et al., Addison-Wesley ¡£ </I> \r
+ ÆäËûµÄÓÐ<I> The Complete Reference SQL, Groff et al., McGraw-Hill ¡£</I> \r
+ <H4><A name="1.11"></A>1.11) PostgreSQL ÊÇ Y2K ¼æÈݵÄÂð£¿</H4> \r
+ ÊÇ£¬ÎÒÃǺÜÈÝÒ׿ØÖÆ 2000 AD Ö®ºóºÍ 2000 BC ֮ǰµÄÈÕÆÚ¡£ \r
+ <H4><A name="1.12"></A>1.12) ÎÒÓ¦¸ÃÔõÑù¼ÓÈ뿪·¢¶ÓÎ飿</H4> \r
+ Ê×ÏÈ£¬ÏÂÔØ×îеÄÔ´´úÂë²¢ÔĶÁÎÒÃÇ web Õ¾µã»ò·¢²¼°üÖÐµÄ PostgreSQL ¿ª·¢ÕßÎĵµ¡£Æä´Î£¬¼ÓÈë pgsql-hackers ºÍ \r
+ pgsql-patches ÓʼþÁÐ±í¡£µÚÈý£¬Ïò pgsql-patches Ìá½»¸ßÖÊÁ¿µÄ²¹¶¡³ÌÐò¡£ \r
+ <P>ÏÖÔÚ´ó¸ÅÓÐÊ®¼¸¸öÈËÓÐ PostgreSQL CVS ¹éµµ <FONT size="-1">COMMIT</FONT> µÄȨÏÞ¡£ËûÃǶ¼ÒѾÌá½»Á˷dz£¶à¸ßÖÊÁ¿µÄ²¹¶¡ÁË£¬ÒÔÖÁÓÚÏÖÓеÄÌá½»È˺ÜÄѸúÉϽÚ×࣬²¢ÇÒÎÒÃÇÏàÐÅËûÃÇÌá½»µÄ²¹¶¡¶¼ÊǸßÖÊÁ¿µÄ¡£<H4><A name="1.13"></A>1.13) \r
+ ÎÒÓ¦¸ÃÔõÑùÌá½»Ò»¸öBUG±¨¸æ£¿</H4>\r
+ Çë·ÃÎÊ <a href="http://www.PostgreSQL.org/bugs/bugs.php">http://www.PostgreSQL.org/bugs/bugs.php</a> \r
+ µÄ PostgreSQL BugTool Ò³Ãæ, ÄÇÀï¸ø³öÁËÈçºÎÌá½»Ò»¸öBUG±¨¸æµÄÖ¸ÄÏ¡£ \r
+ <P>ͬÑùÒ²Òª¿´¿´ÎÒÃÇµÄ ftp Õ¾µã <A href="ftp://ftp.postgresql.org/pub">ftp://ftp.postgreSQL.org/pub</A>£¬¿´ÓÐûÓиüÐ嵀 \r
+ PostgreSQL °æ±¾»ò²¹¶¡¡£ \r
+ <H4><A name="1.14"></A>1.14) PostgreSQL ºÍÆäËû DBMS ±ÈÆðÀ´ÈçºÎ£¿</H4> \r
+ ÆÀ¼ÛÈí¼þÓкü¸ÖÖ·½·¨£ºÌØÐÔ£¬ÐÔÄÜ£¬¿É¿¿ÐÔ£¬Ö§³ÖºÍ¼Û¸ñ¡£\r
+ <DL>\r
+ <DT><B>ÌØÐÔ</B>\r
+ <DD>\r
+ PostgreSQL ÓµÓдóÐÍÉÌÓà DBMS \r
+ Àï´ó¶àÊýÌØÐÔ£¬ÀýÈ磺ÊÂÎñ£¬×Ó²éѯ£¬´¥·¢Æ÷£¬ÊÓͼ£¬Íâ¼ü²Î¿¼ÍêÕûÐԺ͸´ÔÓµÄËøµÈ¡£ÎÒÃÇ»¹ÓÐһЩËüÃÇûÓеÄÌØÐÔ£¬ÈçÓû§¶¨ÒåÀàÐÍ£¬¼Ì³Ð£¬¹æÔòºÍ¶à°æ±¾²¢ÐпØÖÆÒÔ¼õÉÙËøµÄÕùÓõȡ£\r
+ <BR>\r
+ <DT><B>ÐÔÄÜ</B>\r
+ <DD>\r
+ PostgreSQL ºÍÆäËûÉÌÓúͿªÔ´µÄÊý¾Ý¿â¾ßÓÐÀàËƵÄÐÔÄÜ¡£¶ÔijЩ´¦ÀíËü±È½Ï¿ì£¬¶ÔÆäËûһЩ´¦ÀíËü±È½ÏÂý¡£Óë MySQL »ò¸üÇá±ãµÄÊý¾Ý¿âϵͳ±È½Ï£¬ÎÒÃÇÔÚ \r
+ insert/update ʱÂý£¬ÒòΪÎÒÃÇÓÐÊÂÎñ´¦Àí¡£µ±È» MySQL ²»¾ßÓÐÎÒÃÇÔÚÉÏÃæµÄ<I>ÌØÐÔ </I>¶ÎÀï¸ø³öµÄÈκÎÌØÐÔ¡£ÎÒÃǵÄÖ÷Òª·½ÏòÊÇ¿É¿¿ÐÔºÍÌØÐÔ£¬¾¡¹ÜÎÒÃÇÔÚÿ´Î·¢²¼Ê±²»¶ÏµØ¸Ä½øÐÔÄÜ¡£ÓÐÒ»¸öºÜÓÐȤµÄÍøÒ³±È½ÏÁË \r
+ PostgreSQL ºÍ MySQL <A href="http://openacs.org/why-not-mysql.html">http://openacs.org/why-not-mysql.html</A>¡£<br> \r
+ <DT><B>¿É¿¿ÐÔ</B>\r
+ <DD>\r
+ ÎÒÃÇÖªµÀ DBMS ±ØÐëÊÇ¿É¿¿µÄ£¬·ñÔòËü¾ÍÒ»µãÓö¼Ã»ÓС£ÎÒÃÇŬÁ¦×öµ½·¢²¼¾¹ýÈÏÕæ²âÊԵģ¬Îȶ¨µÄ³ô³æ×îÉٵĴúÂ롣ÿ¸ö°æ±¾ÖÁÉÙÓÐÒ»¸öÔ嵀 beta \r
+ ²âÊÔ£¬²¢ÇÒÎÒÃǵķ¢²¼ÀúÊ·ÏÔʾÎÒÃÇ¿ÉÒÔÌṩÎȶ¨µÄ£¬Àι̵ģ¬¿ÉÓÃÓÚÉú²úʹÓõİ汾¡£ÎÒÃÇÏàÐÅÔÚÕâ·½ÃæÎÒÃÇÓëÆäËûµÄÊý¾Ý¿âÈí¼þÊÇÏ൱µÄ¡£\r
+ <BR>\r
+ <DT><B>Ö§³Ö</B>\r
+ <DD>\r
+ ÎÒÃǵÄÓʼþÁбíÌṩһ¸ö·Ç³£´óµÄ¿ª·¢ÈËÔ±ºÍÓû§µÄ×éÒÔ°ïÖú½â¾öËùÅöµ½µÄÈκÎÎÊÌâ¡£ÎÒÃDz»Äܱ£Ö¤¿Ï¶¨Äܽâ¾öÎÊÌ⣬Ïà±È֮ϣ¬ÉÌÓà DBMS \r
+ Ò²²¢²»ÊÇ×ÜÄܹ»Ìṩ½â¾ö·½·¨¡£Ö±½ÓÓ뿪·¢ÈËÔ±£¬Óû§Èº£¬ÊÖ²áºÍÔ´³ÌÐò½Ó´¥Áî PostgreSQL µÄÖ§³Ö±ÈÆäËû DBMS \r
+ »¹ÒªºÃ¡£»¹ÓÐһЩÉÌÒµÐÔµÄÔ¤°ü×°µÄÖ§³Ö£¬¿ÉÒÔ¸øÌṩ¸øÄÇЩÐèÒªµÄÈË¡££¨²ÎÔÄÖ§³Ö FAQ Ìõ¿î 1.6 С½Ú¡££© \r
+ <BR>\r
+ <DT><B>¼Û¸ñ</B>\r
+ <DD>\r
+ ÎÒÃǶÔÈκÎÓÃ;¶¼Ãâ·Ñ£¬°üÀ¨ÉÌÓúͷÇÉÌÓÃÄ¿µÄ¡£Äã¿ÉÒÔ²»¼ÓÏÞÖƵØÏòÄãµÄ²úÆ·Àï¼ÓÈëÎÒÃǵĴúÂ룬³ýÁËÄÇЩÎÒÃÇÔÚÉÏÃæµÄ°æȨÉùÃ÷ÀïÉùÃ÷µÄ BSD ·ç¸ñµÄ°æȨÍâ¡£ \r
+ </DL>\r
+ <h4><a name="1.15"></a>1.15) ÎÒÓ¦¸ÃÔõÑùÔÞÖú PostgreSQL £¿</h4> \r
+ <p>×Ô´Ó1996Ä꿪ʼ£¬PostgreSQL \r
+ ÒѾÓÐÁËÒ»¸öÓÅÐãµÄ×éÖ¯¡£ÕâЩӦ¸Ã¹é¹¦ÓÚ Marc \r
+ Fournier£¬ÊÇËû´´½¨Á˲¢ÔÚÕâЩÄêÒ»Ö±¹ÜÀíÕâ¸ö×éÖ¯¡£</p>\r
+ <p>¶ÔÓÚÒ»¸ö¿ªÔ´ÏîÄ¿À´Ëµ£¬ÖÊÁ¿»ù´¡ÉèÊ©ÊǷdz£ÖØÒªµÄ¡£ËüÄÜ·ÀÖ¹³öÏÖÑÏÖØÑÓ³ÙÏîÄ¿Ç°½øµÄ»ìÂÒ¡£</p>\r
+ <p>ÏÔÈ»£¬Õâ¸ö×éÖ¯µÄÔËת³É±¾²»·Æ¡£Î¬³ÖÆäÇ°½øÓи÷ÖÖÔ¶ȵġ¢Ò»´ÎÐԵĿªÖ§¡£Èç¹ûÄã»òÕßÄãµÄ¹«Ë¾ÄܽøÐоèÔùÒÔÖ§³ÖÕâÏîÊÂÒµ£¬Çë·ÃÎÊ <a href="http://store.pgsql.com/shopping/"> \r
+ http://store.pgsql.com/shopping/</a> ½øÐоèÔù¡£</p> \r
+ <p>ËäÈ»¸ÃÍøÒ³Ìá¼°ÁË PostgreSQL ¹«Ë¾£¬ÕâЩ¾èÔù½«½öÓÃÓÚÖ§³Ö PostgreSQL \r
+ ÏîÄ¿£¬²¢²»»áÓÃÓÚ×ÊÖúû¸öÌض¨µÄ¹«Ë¾¡£Èç¹ûÄãÔ¸Ò⣬Ҳ¿ÉÒÔÓʼÄ֧Ʊµ½ÁªÏµµØÖ·¡£</p>\r
+ <HR>\r
+ <CENTER>\r
+ <H2>Óû§¿Í»§¶ËÎÊÌâ</H2>\r
+ </CENTER>\r
+ <H4><A name="2.1"></A>2.1) ÓÐ PostgreSQL µÄ ODBC Çý¶¯Ã´£¿</H4> \r
+ ÓÐÁ½¸ö ODBC Çý¶¯¿ÉÒÔ»ñµÃ£¬PsqlODBC ºÍ OpenLink ODBC.<P>¿ÉÒÔÔÚ<a href="http://gborg.postgresql.org/project/psqlodbc/projdisplay.php">http://gborg.postgresql.org/project/psqlodbc/projdisplay.php</a> \r
+ ÏÂÔØ PsqlODBC ¡£ \r
+ <P>OpenLink ODBC ¿ÉÒÔ´Ó <A href="http://www.openlinksw.com/">http://www.openlinksw.com/</A> \r
+ »ñµÃ¡£ËüÓëËûÃǵıê×¼ ODBC ¿Í»§¶ËÈí¼þ¼æÈÝ£¬Òò¶øÄã¿ÉÒÔÔÚÈκÎËûÃÇÖ§³ÖµÄ¿Í»§¶Ëƽ̨£¨Win, Mac, Unix, VMS£©ÉÏʹÓà PostgreSQL \r
+ ODBC¡£\r
+ <P>ËûÃÇ¿ÉÄܽ«Õâ¸ö²úÆ·ÏúÊÛ¸øÄÇЩÐèÒªÉÌÒµÖ§³ÖµÄÓû§£¬µ«ÊÇ×ÜÊÇÓÐÒ»¸ö freeware £¨×ÔÓÉÈí¼þ£©µÄ°æ±¾¿ÉÒԵõ½¡£ÇëѯÎÊ <A href="mailto:postgres95@openlink.co.uk"> \r
+ postgres95@openlink.co.uk</A>¡£\r
+ <H4><A name="2.2"></A>2.2) ÓÐʲô¹¤¾ß¿ÉÒÔ°Ñ PostgreSQL ÓÃÓÚ Web Ò³Ã棿</H4> \r
+ Ò»¸ö½éÉÜÒÔÊý¾Ý¿âΪºǫ́µÄͦ²»´íµÄ Õ¾µãÊÇ£º<a href="http://www.webreview.com">http://www.webreview.com</a> \r
+ ¡£ \r
+ <P>¶ÔÓÚ Web ¼¯³É£¬PHP ÊÇÒ»¸ö¼«ºÃµÄ½Ó¿Ú¡£ËüÔÚ£º<A href="http://www.php.net/">http://www.php.net/</A> \r
+ ¡£ \r
+ <P>¶ÔÓÚ¸´ÔÓµÄÈÎÎñ£¬ºÜ¶àÈ˲ÉÓà Perl ½Ó¿ÚºÍ CGI.pm »ò mod_perl ¡£ \r
+ <H4><A name="2.3"></A>2.3) PostgreSQL ÓµÓÐͼÐÎÓû§½çÃæÂð£¿</H4> \r
+ Êǵġ£Óм¸¸öÊÊÓÃÓÚ PostgreSQL µÄͼÐνӿڡ£°üÀ¨PgAccess£¨<a href="http://www.pgaccess.com">http://www.pgaccess.com</a>)£¬PgAdmin \r
+ II £¨<a href="http://www.pgadmin.org">http://www.pgadmin.org</a>£¬½öÊÊÓÃÓÚWin32£©£¬ \r
+ RHDB Admin (<a href="http://sources.redhat.com/rhdb/">http://sources.redhat.com/rhdb/</a>£© \r
+ ÒÔ¼° Rekall £¨<a href="http://www.thekompany.com/products/rekall/">http://www.thekompany.com/products/rekall/</a>£¬ \r
+ רÓеÄ/proprietary)¡£»¹ÓÐPHPPgAdmin £¨<a href="http://phppgadmin.sourceforge.net/">http://phppgadmin.sourceforge.net/£©</a> \r
+ £¬Ò»¸ö»ùÓÚ web µÄ PostgreSQL ·ÃÎʽӿڡ£ \r
+ <p>ÎÒÃÇÓÐÒ»¸ö²»´íµÄͼÐÎÓû§½çÃ棬³ÆΪ PgAccess £¬ËüÒ²¿ÉÒÔÓÃ×÷±¨±íÉú³ÉÆ÷¡£ÍøÒ³ÊÇ <a href="http://www.pgaccess.org/">http://www.pgaccess.org/</a>¡£</p> \r
+ <H4><A name="2.4"></A>2.4) ÎÒÃÇ¿ÉÒÔÓÃʲôÓïÑÔºÍ PostgreSQL ´ò½»µÀ£¿</H4> \r
+ <p>´ó¶àÊýÁ÷Ðеıà³ÌÓïÑÔ¶¼ÓзÃÎÊ PostgreSQL µÄ½Ó¿Ú¡£Çë¼ì²é±à³ÌÓïÑÔµÄÀ©Õ¹Ä£¿éÁÐ±í¡£</p> \r
+ <p>PostgreSQL ·¢²¼°üÖаüº¬ÁËÒÔϽӿڣº</p> \r
+ <ul>\r
+ <li>\r
+ C (libpq) \r
+ <li>\r
+ Embedded C (ecpg)\r
+ <li>\r
+ Java (jdbc)\r
+ <li>\r
+ Python (PyGreSQL)\r
+ <li>\r
+ TCL (libpgtcl)</li>\r
+ </ul>\r
+ <p>ÆäËûµÄ½Ó¿ÚÔÚ <a href="http://gborg.postgresql.org">http://gborg.postgresql.org</a> É쵀 <i>Drivers/Interfaces</i> \r
+ С½Ú¡£</p> \r
+ <HR>\r
+ <CENTER>\r
+ <H2>ϵͳ¹ÜÀíÎÊÌâ</H2>\r
+ </CENTER>\r
+ <H4><A name="3.1"></A>3.1) ÎÒÔõÑùÄÜ°Ñ PostgreSQL ×°ÔÚ /usr/local/pgsql ÒÔÍâµÄµØ·½£¿</H4> \r
+ <p>ÔÚÔËÐÐ configure ʱ¼ÓÉÏ --prefix Ñ¡Ïî¡£</p> \r
+ <H4><A name="3.2"></A>3.2) µ±ÎÒÔËÐÐ postmaster ʱ£¬³öÏÖ<I> Bad System Call</I>£¨ÏµÍ³µ÷ÓÃ´í£©»ò Core \r
+ Dumped ´íÎó¡£ÎªÊ²Ã´£¿</H4> \r
+ <p>Õâ¿ÉÄÜÊǺܶ෽ÃæµÄÎÊÌ⣬ÇëÏȼì²é²Ù×÷ϵͳºËÐÄÊÇ·ñÖ§³Ö System V À©Õ¹¡£PostgreSQL ÐèÒªÄÚºËÖ§³Ö¹²ÏíÄÚ´æºÍÐźŵơ£</p> \r
+ <H4><A name="3.3"></A>3.3) µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ <I>IpcMemoryCreate</I> ´íÎó¡£ÎªÊ²Ã´£¿</H4> \r
+ ÄãҪôÊÇûÓÐÔÚÄÚºËÀïÕýÈ·ÅäÖù²ÏíÄڴ棬ҪôÊÇÄãÐèÒªÀ©´óÄãµÄÄں˵ĿÉÓù²ÏíÄÚ´æ¡£ÐèÒªµÄ¹²ÏíÄÚ´æ¾ßÌåµÄÊýÁ¿È¡¾öÓÚÄãµÄÌåϵ½á¹¹ºÍÄãÅäÖÃÄãµÄ postmaster \r
+ ÔËÐÐʱʹÓõĻº³åÇøºÍºó¶Ë½ø³ÌÊýÄ¿¡£¶Ô´ó¶àÊýϵͳ£¬Ê¹ÓÃȱʡ»º³åÇøºÍ½ø³ÌÊýĿʱ£¬Äã×îÉÙÐèÒª~1MB¡£Óйع²ÏíÄÚ´æºÍÐźŵƵÄÏêϸÐÅÏ¢Çë²Î¿¼ <a href="http://www.postgresql.org/idocs/index.php?kernel-resources.html"> \r
+ PostgreSQL Administrator's Guide</a> ¡£ \r
+ <H4><A name="3.4"></A>3.4) µ±ÎÒÊÔͼÔËÐÐ postmaster ʱ£¬³öÏÖ <I>IpcSemaphoreCreate</I> ´íÎó¡£ÎªÊ²Ã´£¿</H4> \r
+ <p>Èç¹û´íÎóÐÅÏ¢ÊÇ <I>IpcSemaphoreCreate: semget failed (No space left on device)</I>£¬ÄÇôÔÒòÊÇÄãµÄÄÚºËûÓÐÅäÖÃ×ã¹»µÄÐźŵÆ×ÊÔ´¡£Postgres \r
+ µÄÿ¸öDZÔڵĺǫ́½ø³Ì¶¼ÐèÒªÒ»¸öÐźŵơ£Ò»¸öÁÙʱµÄ½â¾ö·½·¨ÊÇÒԱȽÏÉٵĺǫ́½ø³ÌÊý£¨²ÎÊý£©Æô¶¯ postmaster¡£Ê¹Óÿª¹Ø <I>-N</I> ´øÒ»¸öÉÙÓÚȱʡֵ \r
+ 32 µÄ²ÎÊýÔËÐÐ postmaster¡£¸ü³¤¾ÃµÄ½â¾ö·½·¨ÊǼӴóÄãµÄÄÚºËµÄ <FONT size="-1">SEMMNS</FONT> ºÍ <FONT size="-1"> \r
+ SEMMNI</FONT> ²ÎÊý¡£</p> \r
+ <p>ÔÚÊý¾Ý¿â·ÃÎÊÁ¿ºÜ´óʱ£¬ÐźŵƲ»¿ÉÓÿÉÄܵ¼ÖÂϵͳ±ÀÀ£¡£</p>\r
+ <P>Èç¹û´íÎóÐÅÏ¢ÊÇÆäËûµÄʲô¶«Î÷£¬Äã¿ÉÄܾ͸ù±¾Ã»ÓÐÔÚÄÚºËÀïÃæÅäÖÃÐźŵÆÖ§³Ö¡£Óйع²ÏíÄÚ´æºÍÐźŵƵÄÏêϸÐÅÏ¢Çë²Î¿¼ <a href="http://www.postgresql.org/idocs/index.php?kernel-resources.html"> \r
+ PostgreSQL Administrator's Guide</a> ¡£<H4><A name="3.5"></A>3.5) \r
+ ÎÒÈçºÎ¿ØÖÆÀ´×ÔÆäËûÖ÷»úµÄÁ¬½Ó£¿</H4>\r
+ <p>ȱʡʱ£¬PostgreSQL Ö»ÔÊÐíͨ¹ý unix ÓòÌ×½Ó×ÖÀ´×Ô±¾»úµÄÁ¬½Ó¡£³ý·ÇÄãʹÓà <I>-i</I> ¿ª¹ØÆô¶¯ <I>postmaster</I>£¬<B>²¢ÇÒ</B>ͨ¹ý¶ÔÓ¦µÄ±à¼ \r
+ <I>$PGDATA/pg_hba.conf</I> Îļþ´ò¿ªÁËÖ÷»úΪ»ù´¡£¨ host-based £©µÄÈÏÖ¤£¬·ñÔòÆäËû»úÆ÷ÊDz»ÄÜÓëÄãµÄ»úÆ÷Á¬½ÓµÄ¡£ÕâÑù½«ÔÊÐí \r
+ TCP/IP Á¬½Ó¡£</p> \r
+ <H4><A name="3.6"></A>3.6) ÎÒÔõÑùµ÷ÕûÊý¾Ý¿âÒýÇæÒÔ»ñµÃ¸üºÃµÄÐÔÄÜ£¿</H4> \r
+ <p>µ±È»£¬Ë÷Òý¿ÉÒÔ¼ÓËÙ²éѯ¡£<FONT size="-1">EXPLAIN</FONT> ÃüÁîÔÊÐíÄã¹Û²ì PostgreSQL \r
+ ÈçºÎ½âÊÍÄãµÄ²éѯ£¬ÒÔ¼°Ê¹ÓÃÁËÄÄЩË÷Òý¡£</p>\r
+ <P>Èç¹ûÄãÕý´¦ÀíÒ»¶Ñ <FONT size="-1">INSERT</FONT>£¬¿¼ÂÇʹÓà <FONT size="-1">COPY</FONT> ÃüÁîÒÔ´óÅúÁ¿µÄ·½Ê½½øÐС£ÕâÑù×ö±Èµ¥¶ÀµÄÒ»¸ö¸ö \r
+ <FONT size="-1">INSERT </FONT>¿ìµÃ¶à¡£Æä´Î£¬Ã»Óд¦ÓÚ <FONT size="-1">BEGIN WORK/COMMIT</FONT> \r
+ ÊÂÎñ¿éÖ®¼äµÄÓï¾ä±»ÈÏΪÊôÓÚͬһ¸öÊÂÎñ¡£ÊÔ×ÅÔÚÒ»¸öÊÂÎñ¿éÀïÃæ´¦Àí¸ü¶àµÄÓï¾ä¡£ÕâÑù¿ÉÒÔ¼õÉÙÊÂÎñ´øÀ´µÄ¶îÍ⿪Ïú¡£Í¬Ñù£¬ÔÚ×ö´óÁ¿µÄÊý¾Ý¸Ä±äʱ¿¼ÂÇɾ³ýºÍÖؽ¨Ë÷Òý¡£ \r
+ <P>»¹Óм¸¸öµ÷½ÚµÄÑ¡Ïî¿ÉÒÔʹÓá£Äã¿ÉÒÔͨ¹ý´ø <I>-o -F</I> Ñ¡ÏîÆô¶¯ postmaster À´½ûÖ¹ fsync()¡£ÕâÑù½«±ÜÃâÿ´ÎÊÂÎñºóµ÷Óà <I>fsync() \r
+ </I>\r
+ °ÑÊý¾Ýˢе½´ÅÅÌÉÏ¡£\r
+ <P>\r
+ Ä㻹¿ÉÒÔʹÓà postmaster -B Ñ¡ÏîÔö¼Óºó¶Ë½ø³ÌʹÓõĹ²ÏíÄڴ滺³åµÄÊýÄ¿¡£Èç¹ûÄã°ÑÕâ¸ö²ÎÊýÉèÖõÃÌ«´ó£¬postmaster \r
+ ¿ÉÄÜÎÞ·¨Æô¶¯£¬ÒòΪÄãÒѾ³¬¹ýÁËÄãµÄÄÚºËÔÚ¹²ÏíÄÚ´æ¿Õ¼äÉϵÄÏÞÖÆ¡£Ã¿¸ö»º³åÇøÊÇ 8K ²¢ÇÒȱʡ 64 ¸ö»º³åÇø¡£<P> \r
+ Ä㻹¿ÉÒÔʹÓúǫ́½ø³ÌµÄ -S Ñ¡ÏîÀ´Ôö¼Óÿ¸öºǫ́½ø³ÌÓÃÓÚÁÙʱÅÅÐòÓõÄ×î´óÄÚ´æÊýÁ¿¡£-S ÖµÊÇÒÔK×ֽڼƵģ¬È±Ê¡ÊÇ 512 £¨Ò²¾ÍÊÇ˵£¬512K£©¡£<P>Ä㻹¿ÉÒÔʹÓà <FONT size="-1"> \r
+ CLUSTER</FONT> ÃüÁîÀ´°Ñ±íÀïµÄÊý¾Ý°´ÕÕij¸öË÷Òý½øÐоۼ¯´æ·Å¡£²ÎÔÄ CLUSTER µÄÊÖ²áÒ³»ñÈ¡¸ü¶àϸ½Ú¡£ \r
+ <H4><a name="3.7"></a>3.7) PostgreSQL Àï¿ÉÒÔ»ñµÃʲôÑùµÄµ÷ÊÔÌØÐÔ£¿</H4> \r
+ <p>PostgreSQL Óм¸¸öÌØÐÔÓÃÓÚ±¨¸æ״̬ÐÅÏ¢£¬ÕâЩÐÅÏ¢¿ÉÄܶԵ÷ÊÔÓÃ;ºÜÓаïÖú¡£</p> \r
+ <P>Ê×ÏÈ£¬Í¨¹ý¸½´ø --enable-cassert Ñ¡ÏîÔËÐÐ configure£¬Óкܶà <I>assert()</I> \r
+ ¼à¿Øºǫ́½ø³ÌºÍÔÚ·¢ÉúijЩδÔøÔ¤ÁϵÄÏÖÏóʱֹͣ³ÌÐòÔËÐС£ \r
+ <P>postmaster ºÍ postgres ¶¼ÓÐһЩ¿ÉÓõÄÑ¡Ïî¡£Ê×ÏÈ£¬µ±ÄãÆô¶¯ postmaster \r
+ ʱ£¬È·±£Äã°Ñ±ê×¼Êä³öºÍ±ê×¼´íÎóÊä³ö¶¨Ïòµ½ÁËÒ»¸öÈÕÖ¾ÎļþÀïÈ¥ÁË£¬Ïó£º\r
+ <PRE> cd /usr/local/pgsql\r
+ ./bin/postmaster >server.log 2>&1 &</PRE>\r
+ ÕâÑù½«ÔÚ PostgreSQL ¶¥¼¶Ä¿Â¼ÏÂÊä³öÒ»¸ö server.log Îļþ¡£Õâ¸öÎļþ°üº¬·þÎñÆ÷Åöµ½µÄÎÊÌâºÍ´íÎóµÄÓÐÓÃÐÅÏ¢¡£postmaster ÓÐÒ»¸ö \r
+ -d Ñ¡Ï¸ÃÑ¡ÏîÔÊÐíÎÒÃÇ»ñµÃ¸ü¶àµÄϸ½Ú»ã±¨¡£-d Ñ¡Ïî½ÓÊÜÒ»¸öÊý×Ö±êÃ÷µ÷ÊÔ¼¶±ð¡£ÐèÒª¾¯¸æµÄÊǸߵĵ÷ÊÔ¼¶±ð¿ÉÄÜ»áÉú³É¾Þ´óµÄÈÕÖ¾Îļþ¡£<P>Èç¹û postmaster \r
+ ûÓÐÔËÐУ¬Äã¿ÉÒÔÖ±½ÓÔÚÃüÁîÐÐÉÏÆô¶¯ postgres ºǫ́½ø³Ì£¬È»ºóÖ±½Ó¼üÈë SQL Óï¾ä¡£ÎÒÃÇ<B>Ö»</B> \r
+ ÍƼöÔÚµ÷ÊÔµÄʱºòÕâô¸É¡£Çë×¢ÒâÕâʱÓû»ÐÐÜÞ¶ø²»ÊǷֺűíʾÓï¾ä½áβ¡£Èç¹ûÄã´ø×ŵ÷ÊÔ·ûºÅ±àÒ룬Äã¿ÉÒÔʹÓÃÒ»¸öµ÷ÊÔÆ÷¹Û¿´·¢ÉúÁËʲôÊÂÇé¡£ÒòΪºǫ́½ø³ÌûÓÐÓÉ \r
+ postmaster Æô¶¯µÄ£¬Ëü²»ÊǺÍʵ¼ÊµÄÔËÐл·¾³Ò»Ö£¬¶øÇÒËø¶¨/ºǫ́½»»¥ÎÊÌâ¿ÉÄܲ»ÄÜÖØÏÖ¡£ \r
+ <P>Èç¹û postmaster ÒѾÔËÐУ¬¿ÉÔÚÒ»¸ö´°¿ÚÖÐÆô¶¯ <I>psql</I>£¬È»ºóÕÒ³ö <I>psql</I> ¶ÔÓ¦µÄ <I>postgres</I> ½ø³ÌµÄ \r
+ <FONT size="-1">PID</FONT>¡£Ê¹ÓÃÒ»¸öµ÷ÊÔÆ÷¸½×ÅÔÚÕâ¸ö <I>postgres </I><FONT size="-1">PID</FONT> \r
+ ÉÏ¡£Äã¿ÉÒÔÔÚµ÷ÊÔÆ÷ÀïÉèÖöϵ㲢ÇÒ´Ó <I>psql</I> ÀïÖ´Ðвéѯ¡£Èç¹ûÄãÔÚµ÷ÊÔ <I>postgres</I> µÄÆô¶¯£¬Äã¿ÉÒÔÉèÖà \r
+ PGOPTIONS="-W n"£¬È»ºóÆô¶¯ <I>psql</I>¡£ÕâÑù½«µ¼ÖÂÆô¶¯ÑÓ³Ù <I>n</I> \r
+ Ã룬ÕâÑùÄã¾Í¿ÉÒÔ¸½¼ÓÒ»¸öµ÷ÊÔÆ÷²¢ÇÒ¸ú×ÙÆô¶¯Ë³ÐòµÄ¹ý³Ì¡£ \r
+ <P>\r
+ postgres ³ÌÐòÓÐ -s£¬-A£¬ºÍ -t Ñ¡Ïî¿ÉÄÜÔÚµ÷ÊÔºÍÐÔÄܲâÁ¿µÄʱºò·Ç³£ÓÐÓᣠ\r
+ <P>Ä㻹¿ÉÒÔ´ø profiling Ö§³Ö±àÒëºǫ́£¬ÒÔ±ã¹Û²ìÄÄЩº¯ÊýÕ¼ÓõÄÖ´ÐÐʱ¼ä½Ï¶à¡£profile Îļþ½«·ÅÔÚ pgsql/data/base/dbname \r
+ Ŀ¼Ï¡£¿Í»§¶Ë profile Îļþ½«·ÅÔÚ¿Í»§¶Ëµ±Ç°Ä¿Â¼Ï¡£ÔÚ Linux ÏÂÖ§³Ö profiling ÒªÔÚ±àÒëʱ¼ÓÉÏ<i>-DLINUX_PROFILE </i> \r
+ ¡£<H4><a name="3.8"></a>3.8) \r
+ ΪʲôÔÚÊÔͼÁ¬½ÓµÇ¼ʱÊÕµ½¡°Sorry, too many clients¡±ÏûÏ¢£¿</H4> \r
+ <p>ÄãÐèÒªÔö´ó postmaster Æô¶¯Ê±Ö§³ÖµÄ²¢·¢ºǫ́½ø³ÌÊý¡£</p> \r
+ <P>ȱʡÏÞÖÆÊÇ 32 ½ø³Ì¡£Äã¿ÉÒÔͨ¹ý´ø×ÅÊʵ±µÄ <I>-N</I> Öµ¿ª¹ØÆô¶¯ postmaster Ôö¼ÓÕâ¸öÊýÄ¿¡£»òÕßÐÞ¸Ä <i>postgresql.conf</i> \r
+ Îļþ¡£ \r
+ <P>ҪעÒâÈç¹ûÄã°Ñ <I>-N</I> ÉèÖÃΪ´óÓÚ 32£¬Äã±ØÐëͬÑùÔö´ó <I>-B</I>£¬³¬¹ýËüȱʡµÄ 64£»-B ±ØÐë×îÉÙÊÇ -N \r
+ µÄÁ½±¶£¬¶øÇÒΪÁ˸üºÃµÄÐÔÄÜ¿ÉÄÜÒª±ÈÄǸöÊý×ÖÒª´ó¡£¶ÔÓÚ´óÊýÄ¿µÄºó¶Ë½ø³Ì£¬Äã¿ÉÄÜ»¹»á·¢ÏÖÄ㻹ÐèÒªÔö¼ÓÐí¶à Unix \r
+ ÄÚºËÅäÖòÎÊýÖµ¡£Òª¼ì²éµÄ¶«Î÷°üÀ¨¹²ÏíÄÚ´æ¿éµÄ×î´ó³ß´ç£¬<FONT size="-1">SHMMAX</FONT>£¬ÐźŵƵÄ×î´óÊýÄ¿£¬<FONT size="-1">SEMMNS</FONT>\r
+ ºÍ <FONT size="-1">SEMMNI</FONT>£¬×î´óµÄ½ø³ÌÊý£¬<FONT size="-1">NPROC</FONT>£¬µ¥Óû§×î´ó½ø³ÌÊý£¬<FONT size="-1">MAXUPRC</FONT>£¬ÒÔ¼°´ò¿ªÎļþµÄ×î´óÊýÄ¿£¬<FONT size="-1">NFILE</FONT> \r
+ ºÍ <FONT size="-1">NINODE</FONT> \r
+ ¡£Postgres ¶ÔÔÊÐíµÄºǫ́½ø³ÌÊýÓÐÏÞÖƵÄÔÒòÊÇΪÁËÈ·±£ÄãµÄϵͳ²»»áÓùâ×ÊÔ´¡£<P>ÔÚ Postgres ÔçÓÚ 6.5 µÄ°æ±¾£¬×î´óºǫ́½ø³ÌÊýȱʡÊÇ \r
+ 64£¬²¢ÇÒ¶ÔËüµÄÐÞ¸ÄÊ×ÏÈÐèÒªÐÞ¸Ä <I>include/storage/sinvaladt.h</I> ÀïµÄ MaxBackendId ³£Á¿£¬È»ºóÖØР\r
+ BUILD¡£\r
+ <H4><a name="3.9"></a>3.9) pgsql_tmp Ŀ¼ÀﶼÓÐЩʲô£¿</H4> \r
+ <p>¸ÃĿ¼Ï±£´æÁ˲éѯִÐÐÆ÷Éú³ÉµÄÁÙʱÎļþ¡£ÀýÈ磬Èç¹ûÐèҪΪÂú×ã <FONT size="-1">ORDER BY</FONT> Ìõ¼þ×öÅÅÐò£¬²¢ÇÒÅÅÐòÐèÒª±Èºǫ́µÄ \r
+ -S ²ÎÊý¸ø³öµÄ¸ü¶àµÄ¿Õ¼ä£¬ÄÇô¾Í»á´´½¨Ò»¸öÁÙʱÎļþ±£´æ¶à³öÀ´µÄÊý¾Ý¡£</p> \r
+ <P>ÁÙʱÎļþÓ¦¸Ã×Ô¶¯É¾³ý£¬²»¹ýÈç¹ûÔÚÅÅÐò¹ý³ÌÖкǫ́±ÀÀ£Á˾ͿÉÄÜÁôÏÂÀ´¡£Í£Ö¹²¢ÖØÆð postmaster ½«»áɾ³ýÕâЩÎļþ¡£ \r
+ <BR>\r
+ <h4><a name="3.10"></a>3.10) ΪʲôҪÔÚÉý¼¶ PostgreSQL ·¢²¼°æ±¾Ê±×ö dump ºÍ restore £¿</h4> \r
+ <p>\r
+ PostgreSQL ¿ª·¢×é¶Ôÿ´ÎСµÄÉý¼¶½ö×öÁ˽ÏÉÙµÄÐÞ¸Ä,Òò´Ë´Ó 7.2 Éý¼¶µ½ 7.2.1 ²»ÐèÒª dump ºÍ restore¡£µ«ÊÇÖ÷ÒªµÄÉý¼¶£¨ÀýÈç´Ó \r
+ 7.2 µ½ 7.3£©Í¨³£»áÐÞ¸Äϵͳ±íºÍÊý¾Ý±íµÄÄÚ²¿¸ñʽ¡£ÕâЩ±ä»¯Ò»°ã±È½Ï¸´ÔÓ£¬Òò´ËÎÒÃDz»Î¬Êý¾ÝÎļþµÄÏòºó¼æÈÝ¡£dump \r
+ ½«Êý¾Ý°´ÕÕͨÓõĸñʽÊä³ö£¬Ëæºó¿ÉÒÔ±»ÖØмÓÔز¢Ê¹ÓÃеÄÄÚ²¿¸ñʽ¡£</p>\r
+ <p>\r
+ ´ÅÅÌÎļþ¸ñʽûÓб仯µÄÉý¼¶£¬¿ÉÒÔÓà <i>pg_upgrade</i> ½Å±¾£¬¶ø²»ÐèÒª×ö dump ºÍ restor¡£·¢²¼ËµÃ÷script »áÖ¸Ã÷ <i>pg_upgrade</i> \r
+ ¶Ô¸Ã´ÎÉý¼¶ÊÇ·ñ¿ÉÓá£</p> \r
+ <P>\r
+ <HR>\r
+ <CENTER>\r
+ <H2>²Ù×÷ÎÊÌâ</H2>\r
+ </CENTER>\r
+ <H4><A name="4.1"></A>4.1) \r
+ ¶þ½øÖÆÓαêºÍÆÕͨÓαêÖ®¼äµÄÇø±ðÊÇʲô£¿</H4> \r
+ ²ÎÔÄ <FONT size="-1">DECLARE</FONT> ÊÖ²áÒ³»ñÈ¡ÐÅÏ¢¡£ \r
+ <H4><a name="4.2"></a>4.2)ÈçºÎÖ» <FONT size="-1">SELECT</FONT> Ò»¸ö²éѯ½á¹ûµÄÍ·¼¸ÐУ¿</H4> \r
+ ²ÎÔÄ <FONT size="-1">FETCH</FONT> \r
+ ÊÖ²áÒ³£¬»òÕßʹÓà SELECT ... LIMIT.... \r
+ <P>¼´Ê¹ÄãÖ»ÐèÒª¿ªÍ·µÄ¼¸ÐУ¬Ò²»áÉæ¼°µ½Õû¸ö²éѯ¡£ÊÔ×ÅʹÓôøÓÐ <FONT size="-1">ORDER BY</FONT> µÄ²éѯ¡£Èç¹ûÓÐÒ»¸öË÷ÒýÓë <FONT size="-1"> \r
+ ORDER BY</FONT> Æ¥Å䣬PostgreSQL ¿ÉÄܾÍÖ»´¦ÀíÒªÇóµÄÍ·¼¸Ìõ¼Ç¼£¬·ñÔò½«¶ÔÕû¸ö²éѯ½øÐд¦ÀíÖ±µ½Éú³ÉÐèÒªµÄÐС£ \r
+ <H4><a name="4.3"></a>4.3) ÎÒÈçºÎ»ñÈ¡Ò»¸ö±íµÄÁÐ±í£¬»òÕßÊÇÆäËûÎÒÄÜÔÚ <I>psql</I> Àï¿´µ½µÄ¶«Î÷£¿</H4> \r
+ Äã¿ÉÒÔÔĶÁ <I>psql</I> µÄÔ´´úÂëÎļþ<I>pgsql/src/bin/psql/describe.c</I> ¡£Ëü°üÀ¨ÎªÉú³É psql \r
+ µÄ·´Ð±¸ÜÃüÁîµÄÊä³öµÄ SQL ÃüÁî¡£Ä㻹¿ÉÒÔ´ø <I>-E</I> Ñ¡ÏîÆô¶¯ <I>psql</I>£¬ÕâÑùËü½«´òÓ¡³öÖ´ÐÐÄã¸ø³öµÄÃüÁîËùÓõIJéѯ¡£ \r
+ <H4><a name="4.4"></a>4.4) ÔõÑù´Ó±íÀïÃæɾ³ýÒ»ÁУ¿</H4> \r
+ <P>7.3 ÀïÔö¼ÓÁË <FONT size="-1">ALTER TABLE DROP COLUMN</FONT>£¬ÒÔÖ§³Ö´ËÏÄÜ¡£ÔÚÒÔÇ°µÄ°æ±¾ÖУ¬¿ÉÒÔÕâÑù×ö£º</P> \r
+ <PRE> BEGIN;\r
LOCK TABLE old_table;\r
SELECT ... -- select all columns but the one you want to remove\r
INTO TABLE new_table\r
DROP TABLE old_table;\r
ALTER TABLE new_table RENAME TO old_table;\r
COMMIT;\r
-\r
-\r
- 4.5) Ò»ÐУ¬Ò»¸ö±í£¬Ò»¸ö¿âµÄ×î´ó³ß´çÊǶàÉÙ£¿\r
-\r
-ÏÂÃæÊÇһЩÏÞÖÆ£º\r
-\r
- Ò»¸öÊý¾Ý¿â×î´ó³ß´ç£¿ ÎÞÏÞÖÆ£¨´æÔÚ 1TB µÄÊý¾Ý¿â£©\r
- Ò»¸ö±íµÄ×î´ó³ß´ç£¿ 16TB\r
- Ò»ÐеÄ×î´ó³ß´ç£¿ 1.6TB\r
+</PRE>\r
+ <H4><a name="4.5"></a>4.5) Ò»ÐУ¬Ò»¸ö±í£¬Ò»¸ö¿âµÄ×î´ó³ß´çÊǶàÉÙ£¿</H4> \r
+ ÏÂÃæÊÇһЩÏÞÖÆ£º<PRE> Ò»¸öÊý¾Ý¿â×î´ó³ß´ç£¿ ÎÞÏÞÖÆ£¨´æÔÚ 1TB µÄÊý¾Ý¿â£©\r
+ Ò»¸ö±íµÄ×î´ó³ß´ç£¿ 16TB\r
+ Ò»ÐеÄ×î´ó³ß´ç£¿ 1.6TB\r
Ò»¸ö×ֶεÄ×î´ó³ß´ç? 1GB\r
- Ò»¸ö±íÀï×î´óÐÐÊý£¿ ÎÞÏÞÖÆ\r
- Ò»¸ö±íÀï×î´óÁÐÊý£¿ ¸úÁÐÀàÐÍÓйØ,250-1600\r
- Ò»¸ö±íÀïµÄ×î´óË÷ÒýÊýÁ¿£¿ÎÞÏÞÖÆ\r
-\r
-µ±È»£¬Êµ¼ÊÉÏûÓÐÕæÕýµÄÎÞÏÞÖÆ£¬»¹ÊÇÒªÊÜ¿ÉÓôÅÅ̿ռ䡢¿ÉÓÃÄÚ´æ/½»»»ÇøµÄÖÆÔ¼¡£\r
-\r
-±íµÄ×î´ó³ß´ç 16 TB ²»ÐèÒª²Ù×÷ϵͳ¶Ô´óÎļþµÄÖ§³Ö¡£´ó±íÓöà¸ö 1 GB µÄÎļþ\r
-´æ´¢£¬Òò´ËÎļþϵͳ³ß´çµÄÏÞÖÆÊDz»ÖØÒªµÄ¡£\r
-\r
-Èç¹ûȱʡµÄ¿é´óСÔö³¤µ½ 32K £¬×î´óµÄ±í³ß´çºÍ×î´óÁÐÊý¿ÉÒÔÔö¼Ó¡£\r
-\r
-\r
- 4.6)´æ´¢Ò»¸öµäÐ͵ÄƽÃæÎļþÀïµÄÊý¾ÝÐèÒª¶àÉÙ´ÅÅ̿ռ䣿\r
-\r
-Ò»¸ö Postgres Êý¾Ý¿â×î¶à¿ÉÄÜÐèÒªÏ൱ÓÚÔÚÒ»¸öƽÃæÎļþÀï´æ´¢ÏàͬÊý¾ÝµÄ5±¶\r
-µÄ´ÅÅ̿ռ䡣\r
-\r
-ÀýÈ磬¼ÙÉèÓÐÒ»¸ö 100,000 ÐеÄÎļþ£¬Ã¿ÐÐÓÐÒ»¸öÕûÊýºÍÒ»¸öÎı¾ÃèÊö¡£¼ÙÉèÎÄ\r
-±¾´®µÄƽ¾ù³¤¶Èλ20×Ö½Ú¡£Æ½ÃæÎļþÕ¼Óà 2.8 MB¡£´æ·ÅÕâЩÊý¾ÝµÄ PostgreSQL\r
-Êý¾Ý¿âÎļþ´óÔ¼ÊÇ 6.4 MB:\r
-\r
- 36 ×Ö½Ú: ÿÐеÄÍ·£¨¹À¼ÆÖµ£©\r
+ Ò»¸ö±íÀï×î´óÐÐÊý£¿ ÎÞÏÞÖÆ\r
+ Ò»¸ö±íÀï×î´óÁÐÊý£¿ ¸úÁÐÀàÐÍÓйØ,250-1600\r
+ Ò»¸ö±íÀïµÄ×î´óË÷ÒýÊýÁ¿£¿ÎÞÏÞÖÆ</PRE>\r
+ µ±È»£¬Êµ¼ÊÉÏûÓÐÕæÕýµÄÎÞÏÞÖÆ£¬»¹ÊÇÒªÊÜ¿ÉÓôÅÅ̿ռ䡢¿ÉÓÃÄÚ´æ/½»»»ÇøµÄÖÆÔ¼¡£\r
+ <P>\r
+ ±íµÄ×î´ó³ß´ç 16 TB ²»ÐèÒª²Ù×÷ϵͳ¶Ô´óÎļþµÄÖ§³Ö¡£´ó±íÓöà¸ö 1 \r
+ GB µÄÎļþ´æ´¢£¬Òò´ËÎļþϵͳ³ß´çµÄÏÞÖÆÊDz»ÖØÒªµÄ¡£ \r
+ <P>Èç¹ûȱʡµÄ¿é´óСÔö³¤µ½ 32K £¬×î´óµÄ±í³ß´çºÍ×î´óÁÐÊý¿ÉÒÔÔö¼Ó¡£</P> \r
+ <H4><a name="4.6"></a>4.6)´æ´¢Ò»¸öµäÐ͵ÄƽÃæÎļþÀïµÄÊý¾ÝÐèÒª¶àÉÙ´ÅÅ̿ռ䣿</H4>\r
+ Ò»¸ö Postgres Êý¾Ý¿â×î¶à¿ÉÄÜÐèÒªÏ൱ÓÚÔÚÒ»¸öƽÃæÎļþÀï´æ´¢ÏàͬÊý¾ÝµÄ5±¶µÄ´ÅÅ̿ռ䡣 \r
+ <P>ÀýÈ磬¼ÙÉèÓÐÒ»¸ö 100,000 ÐеÄÎļþ£¬Ã¿ÐÐÓÐÒ»¸öÕûÊýºÍÒ»¸öÎı¾ÃèÊö¡£¼ÙÉèÎı¾´®µÄƽ¾ù³¤¶Èλ20×Ö½Ú¡£Æ½ÃæÎļþÕ¼Óà 2.8 MB¡£´æ·ÅÕâЩÊý¾ÝµÄ \r
+ PostgreSQL Êý¾Ý¿âÎļþ´óÔ¼ÊÇ 6.4 MB:<PRE> 36 ×Ö½Ú: ÿÐеÄÍ·£¨¹À¼ÆÖµ£©\r
24 ×Ö½Ú: Ò»¸öint×ֶκÍÒ»¸öÎı¾ÐÍ×Ö¶Î\r
+ 4 ×Ö½Ú: Ò³ÃæÄÚÖ¸ÏòÔª×éµÄÖ¸Õë\r
----------------------------------------\r
128 ÐÐÿҳ\r
\r
782 Êý¾ÝÒ³ * 8192 ×Ö½Ú/Ò³ = 6,406,144 ×Ö½Ú£¨6.4 MB£©\r
-\r
-Ë÷Òý²»ÐèÒªÕâô¶àµÄ¶îÍâÏûºÄ£¬µ«Ò²È·Êµ°üÀ¨±»Ë÷ÒýµÄÊý¾Ý£¬Òò´ËËüÃÇÒ²¿ÉÄܴܺó¡£\r
-\r
-¿ÕÖµ´æ·ÅÔÚλͼÖУ¬Òò´ËÕ¼ÓúÜÉٵĿռ䡣\r
-\r
-\r
- 4.7) ÈçºÎ²é¿´±í¡¢Ë÷Òý¡¢Êý¾Ý¿âÒÔ¼°Óû§µÄ¶¨Ò壿\r
-\r
-/ psql/ ÓÐÐí¶à·´Ð±¸ÜÃüÁîÓÃÓÚÏÔʾÕâЩÐÅÏ¢¡£Óà \? ¿´¿´¶¼ÓÐÄÄЩ¡£ÒÔ pg_ ´ò\r
-Í·µÄϵͳ±íÒ²ÃèÊöÁËÕâЩÐÅÏ¢¡£ psql -l ¿ÉÒÔÁгöËùÓеÄÊý¾Ý¿â¡£\r
-\r
-Ò²¿ÉÒÔÊÔÊÔÎļþ /pgsql/src/tutorial/syscat.source/¡£ËüÑÝʾÁËÐí¶à´ÓÊý¾Ý¿â\r
-ϵͳ±íÀï»ñÈ¡ÐÅÏ¢ÐèÒªµÄ SELECT¡£\r
-\r
-\r
- 4.8) ÎҵIJéѯºÜÂý»òÕßûÓÐÀûÓÃË÷Òý¡£ÎªÊ²Ã´£¿\r
-\r
-²¢·Çÿ¸ö²éѯ¶¼»á×Ô¶¯Ê¹ÓÃË÷Òý¡£Ö»ÓÐÔÚ±íµÄ´óС³¬¹ýÒ»¸ö×îСֵ£¬²¢ÇÒ²éѯֻѡ\r
-Ôñ±íÖнÏС±ÈÀýµÄÐÐʱ²ÉÓÃʹÓÃË÷Òý¡£ÕâÊÇÒòΪË÷ÒýɨÃèÒýÆðµÄËæ¼´´ÅÅÌ´æÈ¡¿ÉÄÜ\r
-±ÈÖ±½ÓµØ¶ÁÈ¡±í£¨Ë³ÐòɨÃ裩¸üÂý¡£ÎªÁËÅжÏÊÇ·ñʹÓÃË÷Òý£¬PostgreSQL ±ØÐë»ñ\r
-µÃÓйرíµÄͳ¼ÆÖµ¡£ÕâЩͳ¼ÆÖµ¿ÉÒÔʹÓà VACUUM ANALYZE£¬»ò ANALYZE »ñµÃ¡£Ê¹\r
-ÓÃͳ¼ÆÖµ£¬ÓÅ»¯Æ÷ÖªµÀ±íÖÐÓжàÉÙÐУ¬¾ÍÄܹ»¸üºÃµØÅжÏÊÇ·ñÀûÓÃË÷Òý¡£Í³¼ÆÖµ¶Ô\r
-È·¶¨ÓÅ»¯µÄÁ¬½Ó˳ÐòºÍÁ¬½Ó·½·¨Ò²ºÜÓÐÓá£ÔÚ±íµÄÄÚÈÝ·¢Éú±ä»¯Ê±£¬Ó¦¶¨ÆÚ½øÐÐͳ\r
-¼ÆÖµµÄ»ñÈ¡¡£\r
-\r
-Ë÷Òýͨ³£²»ÓÃÓÚ ORDER BY »òÖ´ÐÐÁ¬½Ó¡£¶ÔÒ»¸ö´ó±íµÄÒ»´Î˳ÐòɨÃ裬ÔÙ×öÒ»¸öÏÔ\r
-ʽµÄÅÅÐòͨ³£±ÈË÷ÒýɨÃèÒª¿ì¡£\r
-\r
-µ«ÊÇ£¬ÔÚ LIMIT ºÍ ORDER BY ½áºÏʹÓÃʱ¾³£»áʹÓÃË÷Òý£¬ÒòΪֻ»á·µ»Ø±íµÄÒ»\r
-С²¿·Ö¡£Êµ¼ÊÉÏ£¬ËäÈ» MAX() ºÍ MIN() ²¢²»Ê¹ÓÃË÷Òý£¬Í¨¹ý¶Ô ORDER BY ºÍ\r
-LLIMIT ʹÓÃË÷ÒýÈ¡µÃ×î´óÖµºÍ×îСֵҲÊÇ¿ÉÒԵģº\r
-\r
- SELECT col\r
- FROM tab\r
- ORDER BY col [ DESC ]\r
- LIMIT 1;\r
-\r
-µ±Ê¹ÓÃͨÅä·û²Ù×÷£¬ÀýÈç LIKE »ò ~ ʱ£¬Ë÷ÒýÖ»ÄÜÔÚÌض¨µÄÇé¿öÏÂʹÓ㺠\r
-\r
- * ×Ö·û´®µÄ¿ªÊ¼²¿·Ö±ØÐëÊÇÆÕͨ×Ö·û´®£¬Ò²¾ÍÊÇ˵£º\r
- o LIKE ģʽ²»ÄÜÒÔ % ´òÍ·¡£\r
- o ~ £¨ÕýÔò±í´ïʽ£©Ä£Ê½±ØÐëÒÔ ^ ´òÍ·¡£\r
- * ×Ö·û´®²»ÄÜÒÔÆ¥Åä¶à¸ö×Ö·ûµÄģʽÀà´òÍ·£¬ÀýÈç [a-e]¡£\r
- * ´óСдÎ޹صIJéÕÒ£¬Èç ILIKE ºÍ ~* µÈ²»Ê¹ÓÃË÷Òý¡£µ«¿ÉÒÔÓà 4.12 ½ÚÃè\r
- ÊöµÄº¯ÊýË÷Òý¡£\r
- * ÔÚ×ö initdb ʱ±ØÐë²ÉÓÃȱʡµÄ±¾µØÉèÖà C locale¡£\r
-\r
-\r
- 4.9) ÎÒÈçºÎ²ÅÄÜ¿´µ½²éѯÓÅ»¯Æ÷ÊÇÔõÑù´¦ÀíÎҵIJéѯµÄ£¿\r
-\r
-²Î¿¼ EXPLAIN ÊÖ²áÒ³¡£\r
-\r
-\r
- 4.10) R-tree Ë÷ÒýÊÇʲô£¿\r
-\r
-R-tree Ë÷ÒýÓÃÓÚË÷Òý¿Õ¼äÊý¾Ý¡£Ò»¸ö¹þÏ£Ë÷ÒýÎÞ·¨´¦Àí·¶Î§ËÑË÷¡£¶ø B-tree Ë÷\r
-ÒýÖ»ÄÜ´¦ÀíһάµÄ·¶Î§ËÑË÷¡£R-tree Ë÷Òý¿ÉÒÔ´¦Àí¶àάÊý¾Ý¡£ÀýÈ磬Èç¹û¿ÉÒÔÔÚ\r
-Ò»¸öÀàÐÍΪ point µÄ×Ö¶ÎÉϽ¨Á¢Ò»¸ö R-tree Ë÷Òý£¬ÄÇôϵͳÄܸü¸ßЧµØ»Ø´ðÀà\r
-ËÆ ¡°Ñ¡ÔñÔÚÒ»¸ö³¤·½Ðη¶Î§ÄÚµÄËùÓе㡱¡£\r
-\r
-ÃèÊö×î³õµÄ R-Tree Éè¼ÆµÄÕýʽÂÛÎÄÊÇ£º\r
-\r
-Guttman, A. "R-Trees: A Dynamic Index Structure for Spatial Searching."\r
-Proc of the 1984 ACM SIGMOD Int'l Conf on Mgmt of Data, 45-57.\r
-\r
-Ä㻹¿ÉÒÔÔÚ Stonebraker µÄ¡°Readings in Database Systems¡±ÀïÕÒµ½ÕâƪÎÄÕ¡£\r
-\r
-ϵͳÄÚÖÃµÄ R-Tree ¿ÉÒÔ´¦Àí¶à±ßÐκͷ½ÐΡ£ÀíÂÛÉÏ˵£¬R-tree ¿ÉÒÔÀ©Õ¹Îª´¦Àí\r
-¸ü¶àάÊý¡£²»¹ýÔÚʵ¼ùÉÏ£¬À©Õ¹ R-trees ÐèÒªÒ»¶¨µÄ¹¤×÷Á¿£¬¶øÎÒÃÇĿǰûÓÐÈç\r
-ºÎ×öµÄÎĵµ¡£\r
-\r
-\r
- 4.11) ʲôÊÇ»ùÒò²éѯÓÅ»¯£¨Genetic Query Optimization£©£¿\r
-\r
-GEQO Ä£¿é²ÉÓûùÒòËã·¨£¨Genetic Algorithm£¬GA£©¼Ó¿ì¶à±íÁ¬½ÓµÄ²éѯÓÅ»¯¡£Ëü\r
-ÔÊÐíͨ¹ý·ÇÇî¾ÙËÑË÷´¦Àí´óµÄÁ¬½Ó²éѯ¡£\r
-\r
-\r
- 4.12) ÎÒÔõÑù×öÕýÔò±í´ïʽËÑË÷ºÍ´óСдÎ޹صÄÕýÔò±í´ïʽËÑË÷£¿ÔõÑùÀû\r
- ÓÃË÷Òý½øÐдóСдÎÞ¹ØËÑË÷£¿\r
-\r
-²Ù×÷·û ~ ´¦ÀíÕýÔò±í´ïʽƥÅ䣬¶ø ~* ´¦Àí´óСдÎ޹صÄÕýÔò±í´ïʽƥÅä¡£´óд\r
-ЩÎÞ¹ØµÄ LIKE ±äÖÖ³ÉΪ ILIKE¡£\r
-\r
-´óСдÎ޹صĵÈʽ±È½Ïͨ³£Ð´×ö£º\r
-\r
- SELECT *\r
- FROM tab\r
- WHERE lower(col) = 'abc';\r
-\r
-ÕâÑù½«²»»áʹÓñê×¼µÄË÷Òý¡£µ«ÊÇ¿ÉÒÔ´´½¨Ò»¸ö¿É±»ÀûÓõĺ¯ÊýË÷Òý:\r
-\r
- CREATE INDEX tabindex ON tab (lower(col));\r
-\r
-\r
- 4.13) ÔÚÒ»¸ö²éѯÀÎÒÔõÑù¼ì²âÒ»¸ö×Ö¶ÎÊÇ·ñΪ NULL£¿\r
-\r
-Óà IS NULL ºÍ IS NOT NULL ²âÊÔÕâ¸ö×ֶΡ£ \r
-\r
-\r
- 4.14) ¸÷ÖÖ×Ö·ûÀàÐÍÖ®¼äÓÐʲô²»Í¬£¿\r
-\r
- ÀàÐÍ ÄÚ²¿Ãû³Æ ˵Ã÷\r
- --------------------------------------------------\r
- "char" char 1¸ö×Ö·û character\r
- CHAR(#) bpchar ¶¨³¤×Ö·û´®£¬Êµ¼ÊÊý¾Ý²»×㶨Ò峤¶Èʱ£¬ÒÔ¿Õ¸ñ²¹Æë\r
- VARCHAR(#) varchar Ö¸¶¨ÁË×î´ó³¤¶È£¬±ä³¤×Ö·û´®£¬²»×㶨Ò峤¶ÈµÄ²¿·Ö\r
-²»²¹Æë\r
- TEXT text ´®³¤¶È½öÊÜÐеÄ×î´ó³¤¶ÈÏÞÖÆ\r
- BYTEA bytea ±ä³¤×Ö½ÚÐòÁУ¨±ä³¤µÄ¶þ½øÖÆÊý¾Ý£©\r
-\r
-ÔÚϵͳ±íºÍÔÚһЩ´íÎóÐÅÏ¢ÀïÄ㽫¿´µ½ÄÚ²¿Ãû³Æ¡£ \r
-\r
-ÉÏÃæ×îºóËÄÖÖÀàÐÍÊÇ"varlena"£¨±ä³¤£©ÀàÐÍ£¨Ò²¾ÍÊÇ˵£¬¿ªÍ·µÄËĸö×Ö½ÚÊdz¤\r
-¶È£¬ºóÃæ²ÅÊÇÊý¾Ý£©¡£ÓÚÊÇʵ¼ÊÕ¼ÓõĿռä±ÈÉùÃ÷µÄ´óСҪ¶àһЩ¡£È»¶øÕâЩÀàÐÍ\r
-¶¼¿ÉÒÔ±»Ñ¹Ëõ´æ´¢£¬Ò²¿ÉÒÔÓà TOAST ÍÑ»ú´æ´¢£¬Òò´Ë´ÅÅÌ¿Õ¼äÒ²¿ÉÄܱÈÔ¤ÏëµÄÒªÉÙ¡£\r
-\r
-CHAR(n) ×îÊʺÏÓÚ´æ´¢³¤¶È»ù±¾²î²»¶àµÄ×Ö·û´®¡£VARCHAR(n) ÔÚ´æ´¢ÏÞÖÆÁË×î´ó\r
-³¤¶ÈµÄ±ä³¤×Ö·û´®ÊÇ×îºÃµÄ¡£TEXT ÊÊÓÃÓÚ´æ´¢²»ÏÞÖƳ¤¶ÈµÄ×Ö·û´®£¬×î´ó¿É´ï\r
-1G¡£BYTEA ÓÃÓÚ´æ´¢¶þ½øÖÆÊý¾Ý£¬ÓÈÆäÊÇ°üº¬ NULL ×Ö½Ú£¨¶þ½øÖƵÄ0£©µÄÖµ¡£Õâ\r
-ЩÀàÐ;ßÓÐÀàÐ͵ÄÐÔÄÜ¡£\r
-\r
-\r
- 4.15.1) ÎÒÔõÑù´´½¨Ò»¸öÐòÁкÅ/×Ô¶¯µÝÔöµÄ×ֶΣ¿\r
-\r
-PostgreSQL Ö§³Ö SERIAL Êý¾ÝÀàÐÍ¡£ËüÔÚ×Ö¶ÎÉÏ×Ô¶¯´´½¨Ò»¸öÐòÁкÍË÷Òý¡£ÀýÈ磬\r
- CREATE TABLE person ( \r
- id SERIAL, \r
- name TEXT \r
- );\r
-\r
-»á×Ô¶¯×ª»»Îª£º \r
- \r
- CREATE SEQUENCE person_id_seq;\r
- CREATE TABLE person ( \r
- id INT4 NOT NULL DEFAULT nextval('person_id_seq'),\r
- name TEXT \r
- );\r
- CREATE UNIQUE INDEX person_id_key ON person ( id );\r
-\r
-²Î¿¼ create_sequence ÊÖ²áÒ³»ñÈ¡¹ØÓÚÐòÁеĸü¶àÐÅÏ¢¡£Ä㻹¿ÉÒÔÓÃÿÐÐµÄ oid\r
-×Ö¶Î×÷Ϊһ¸öΨһֵ¡£²»¹ý£¬Èç¹ûÄãÐèÒªÇãµ¹ºÍÖØÔØÊý¾Ý¿â£¬ÄãÐèҪʹÓà pg_dump\r
-µÄ -o Ñ¡Ïî»òÕß COPY WITH OIDS Ñ¡ÏîÒÔ±£Áô OID¡£ \r
-\r
-\r
- 4.15.2) ÎÒÈçºÎ»ñµÃÒ»¸ö²åÈëµÄÐòÁкŵÄÖµ£¿\r
-\r
-Ò»ÖÖ·½·¨ÊÇÔÚ²åÈë֮ǰÏÈÓú¯Êý nextval() ´ÓÐòÁжÔÏóÀï¼ìË÷³öÏÂÒ»¸ö SERIAL\r
-Öµ£¬È»ºóÔÙÏÔʽ²åÈ롣ʹÓà 4.15.1 <#4.15.1> ÀïµÄÀý±í£¬¿ÉÓÃαÂëÕâÑùÃèÊö£º \r
-\r
- new_id = execute("SELECT nextval('person_id_seq')");\r
- execute("INSERT INTO person (id, name) VALUES (new_id, 'Blaise\r
-Pascal')");\r
-\r
-ÕâÑù»¹ÄÜÔÚÆäËû²éѯÖÐʹÓôæ·ÅÔÚ new_id ÀïµÄÐÂÖµ£¨ÀýÈ磬×÷Ϊ person ±íµÄÍâ\r
-¼ü£©¡£×¢Òâ×Ô¶¯´´½¨µÄ SEQUENCE ¶ÔÏóµÄÃû³Æ½«»áÊÇ\r
-<table>_<serialcolumn>_seq£¬ÕâÀï table ºÍ serialcolumn ·Ö±ðÊÇÄãµÄ±íµÄÃû\r
-³ÆºÍÄãµÄ SERIAL ×ֶεÄÃû³Æ¡£ \r
-\r
-ÀàËƵģ¬ÔÚ SERIAL ¶ÔÏóȱʡ²åÈëºóÄã¿ÉÒÔÓú¯Êý currval() ¼ìË÷¸Õ¸³ÖµµÄ\r
-SERIAL Öµ£¬ÀýÈ磬 \r
-\r
- execute("INSERT INTO person (name) VALUES ('Blaise Pascal')");\r
- new_id = execute("SELECT currval('person_id_seq')");\r
-\r
-×îºó£¬Äã¿ÉÒÔʹÓÃ´Ó INSERT Óï¾ä·µ»ØµÄ OID <4.16> ²éÕÒȱʡֵ£¬¾¡¹ÜÕâ¿ÉÄÜÊÇ\r
-×îȱ·¦ÒÆÖ²ÐԵķ½·¨¡£ÔÚ Perl ÀʹÓôøÓÐ Edmund Mergl µÄ DBD::Pg Ä£¿éµÄ\r
-DBI£¬oid Öµ¿ÉÒÔͨ¹ý $sth->execute() ºóµÄ $sth->{pg_oid_status} »ñµÃ¡£ \r
-\r
-\r
- 4.15.3) ʹÓà currval() ºÍ nextval() »áµ¼ÖÂÒ»¸öÓëÆäËûÓû§Ö®¼äµÄÎÉ\r
- ÂÒÇé¿öÂð£¿\r
-\r
-²»»á¡£currval() ·µ»Øºǫ́½ø³Ì¶ø²»ÊÇËùÓÐÓû§¸³ÓèµÄµ±Ç°Öµ¡£\r
-\r
-\r
- 4.15.4) Ϊʲô²»ÔÚÊÂÎñÒì³£ÖÐÖ¹ºóÖØÓÃÐòÁкÅÄØ£¿ÎªÊ²Ã´ÔÚÐòÁкÅ×Ö¶Î\r
- µÄÈ¡ÖµÖдæÔÚ¼ä¶ÏÄØ£¿\r
-\r
-ΪÁËÌá¸ß²¢·¢ÐÔ£¬ÐòÁкÅÔÚÐèÒªµÄʱºò¸³ÓèÕýÔÚÔËÐеÄÊÂÎñ£¬²¢ÇÒÖ»ÔÚÊÂÎñ½áÊøÖ®\r
-Ç°²»·âËø¡£Õâ¾Í»áµ¼ÖÂزÕÛÊÂÎñºóµÄÐòÁкųöÏÖ¼ä¸ô¡£\r
-\r
-\r
-\r
- 4.16) ʲôÊÇ OID£¿Ê²Ã´ÊÇ TID£¿\r
-\r
-OID ÊÇ PostgreSQL ÖÐÐеÄΨһ±êʶ¡£PostgreSQL Àï´´½¨µÄÿһÐж¼»ñµÃÒ»¸öΨ\r
-Ò»µÄ OID¡£ËùÓÐÔÚ initdb ¹ý³ÌÖд´½¨µÄ OID ¶¼Ð¡ÓÚ 16384 £¨²Î¼û\r
-include/access/transam.h£©¡£ËùÓÐÓû§´´½¨µÄ OID ¶¼´óÓÚ»òµÈÓÚÕâ¸öÖµ¡£È±Ê¡\r
-ʱ£¬ËùÓÐÕâЩ OID ²»½öÔÚÒ»¸ö±í»òÒ»¸öÊý¾Ý¿âÀïÃæΨһ£¬¶øÇÒÔÚÕû¸ö PostgreSQL\r
-°²×°ÀïÒ²ÊÇΨһµÄ¡£ \r
-\r
-PostgreSQL ÔÚËüµÄÄÚ²¿ÏµÍ³±íÀïʹÓà OID ÔÚ±íÖ®¼ä½¨Á¢ÁªÏµ¡£ÕâЩ OID ¿ÉÒÔÓÃ\r
-ÓÚ±êʶÌض¨µÄÓû§ÐÐÒÔ¼°ÓÃÔÚÁ¬½ÓÀï¡£½¨ÒéʹÓÃ×Ö¶ÎÀàÐÍ OID ´æ´¢ OID Öµ¡£¿ÉÒÔ\r
-ÔÚ OID ×Ö¶ÎÉÏ´´½¨Ò»¸öË÷ÒýÒÔ¿ìËÙ·ÃÎÊ¡£ \r
-\r
-OID ´ÓÒ»¸ö±»ËùÓÐÊý¾Ý¿âʹÓõÄÖÐÐÄÇøÓòÀ︳ֵ¸øËùÓÐÐÂÐС£Èç¹ûÄãÏë°Ñ OID ¸Ä\r
-³É±ðµÄÖµ£¬»òÕßÏë×öÒ»·Ý±íµÄ´øÔʼ OID µÄ¿½±´£¬Äã¿ÉÒÔ×öµ½£º \r
-\r
- CREATE TABLE new(old_oid oid, mycol int);\r
- SELECT old_oid, mycol INTO new FROM old;\r
- COPY new TO '/tmp/pgtable';\r
- DELETE FROM new;\r
- COPY new WITH OIDS FROM '/tmp/pgtable';\r
-\r
-OID ÓÃ4×Ö½ÚµÄÕûÊý±£´æ£¬ÔÚ³¬¹ý40ÒÚʱ½«Òç³ö¡£Ã»ÓÐÈ˱¨¸æ³öÏÖ¹ýÒç³ö£¬¶øÎÒÃÇ\r
-´òËãÔÚÓÐÈ˱¨¸æ֮ǰÏû³ýÕâ¸öÏÞÖÆ¡£\r
-\r
-TID ÓÃÓÚ±êʶ´ø×ÅÊý¾Ý¿é£¨µØÖ·£©ºÍ£¨¿éÄÚ£©Æ«ÒƵÄÌض¨µÄÎïÀíÐС£TID ÔÚÐб»¸ü\r
-¸Ä»òÖØÔغó·¢Éú¸Ä±ä¡£Ë÷ÒýÈë¿ÚʹÓÃËüÃÇÖ¸ÏòÎïÀíÐС£\r
-\r
-\r
- 4.17) PostgreSQL ʹÓõÄһЩÊõÓïµÄº¬ÒåÊÇʲô£¿\r
-\r
-һЩԴ´úÂëºÍһЩ¾ÉÒ»µãµÄÎĵµÊ¹ÓÃһЩÓиü³£ÓÃÓ÷¨µÄÊõÓï¡£ÏÂÃæÊÇÆäÖÐÒ»²¿·Ö£º \r
- table, relation, class \r
- row, record, tuple \r
- column, field, attribute \r
- retrieve, select \r
- replace, update \r
- append, insert \r
- OID, serial value \r
- portal, cursor \r
- range variable, table name, table alias \r
-\r
-ÓÐÒ»¸öͨÓÃÊý¾Ý¿âÊõÓïµÄÁÐ±í£ºhttp://hea-\r
-www.harvard.edu/MST/simul/software/docs/pkgs/pgsql/glossary/glossary.html\r
-¡£ \r
-\r
-\r
- 4.18) ΪʲôÎÒÊÕµ½´íÎó¡°/ERROR: Memory exhausted in\r
- AllocSetAlloc()/¡±£¿\r
-\r
-ÕâºÜ¿ÉÄÜÊÇϵͳµÄÐéÄâÄÚ´æÓùâÁË£¬»òÕßÄں˶ÔijЩ×ÊÔ´Óнϵ͵ÄÏÞÖÆÖµ¡£ÔÚÆô¶¯\r
-postmaster ֮ǰÊÔÊÔÏÂÃæµÄÃüÁ \r
-\r
- ulimit -d 262144\r
- limit datasize 256m\r
-\r
-È¡¾öÓÚÄãÓÃµÄ shell£¬ÉÏÃæÃüÁîÖ»ÓÐÒ»ÌõÄܳɹ¦£¬µ«ÊÇËü½«°ÑÄãµÄ½ø³ÌÊý¾Ý¶ÎÏÞÖÆ\r
-ÉèµÃ±È½Ï¸ß£¬Òò¶øÒ²ÐíÄÜÈòéѯÍê³É¡£ÕâÌõÃüÁîÓ¦ÓÃÓÚµ±Ç°½ø³Ì£¬ÒÔ¼°ËùÓÐÔÚÕâÌõ\r
-ÃüÁîÔËÐк󴴽¨µÄ×Ó½ø³Ì¡£Èç¹ûÄãÊÇÔÚÔËÐÐSQL¿Í»§¶ËʱÒòΪºǫ́·µ»ØÁËÌ«¶àµÄÊý\r
-¾Ý¶ø³öÏÖÎÊÌ⣬ÇëÔÚÔËÐпͻ§¶Ë֮ǰִÐÐÉÏÊöÃüÁî¡£\r
-\r
-\r
- 4.19) ÎÒÈçºÎ²ÅÄÜÖªµÀËùÔËÐÐµÄ PostgreSQL µÄ°æ±¾£¿\r
-\r
-´Ó psql À¼üÈë SELECT version()£»\r
-\r
-\r
- 4.20) ΪʲôÎҵĴó¶ÔÏó²Ù×÷µ¼Ö´íÎó¡°/invalid large obj\r
- descriptor¡±£¨·Ç·¨µÄ´ó¶ÔÏóÃèÊö·û£©/£¿\r
-\r
-ÄãÐèÒªÔÚʹÓÃÈκδó¶ÔÏó¾ä±úµÄÇ°ºó·ÅÉÏ BEGIN WORK ºÍ COMMIT£¬Ò²¾ÍÊÇ˵£¬°ü\r
-Χ lo_open ... lo_close¡£ \r
-\r
-Ä¿Ç° PostgreSQL Ç¿ÖÆʵʩÕâÌõ¹æÔò£ºÔÚÊÂÎñÌύʱ¹Ø±Õ´ó¶ÔÏó¾ä±ú£¬ÕâÑù£¬£¨Ã»\r
-ÓвÉÓÃÊÂÎñʱ£©£¬Ê״ζԴó¶ÔÏó¾ä±ú×öÈκÎÊÂÇéµÄÆóͼ¶¼»áµ¼ÖÂÒ»¸ö invalid\r
-large obj descriptor¡£ËùÒÔ£¬Èç¹ûÄãûÓÐʹÓÃÒ»¸öÊÂÎñ£¬ÒÔÇ°Äܹ¤×÷µÄ´úÂ루ÖÁ\r
-ÉÙÊÇ´ó¶àÊýʱ¼ä£©½«»áÉú³ÉÕâôһ¸ö´íÎóÐÅÏ¢¡£ \r
-\r
-Èç¹ûÄãʹÓÿͻ§¶Ë½Ó¿Ú£¬Èç ODBC£¬Äã¿ÉÄÜÐèÒª set auto-commit off¡£\r
-\r
-\r
- 4.21) ÎÒÈçºÎ´´½¨Ò»¸öȱʡֵÊǵ±Ç°Ê±¼äµÄ×ֶΣ¿\r
-\r
-ʹÓà CURRENT_TIMESTAMP£º\r
-\r
- CREATE TABLE test(x int, modtime timestamp DEFAULT CURRENT_TIMESTAMP);\r
-\r
-\r
- 4.22) ΪʲôʹÓà IN µÄ×Ó²éѯÕâôÂý£¿\r
-\r
-Ä¿Ç°£¬ÎÒÃÇͨ¹ýΪÍâ²éѯµÄÿһÐÐ˳ÐòɨÃè×Ó²éѯµÄ½á¹ûÀ´Á¬½Ó×Ó²éѯºÍÍâ²éѯ¡£\r
-Èç¹û×Ó²éѯ·µ»ØÉÙÊý¼¸ÐУ¬¶øÍâ²éѯ·µ»ØºÜ¶àÐУ¬IN Ö´Ðеúܿ졣ΪÁ˼ӿìÆäËû\r
-IN ²éѯµÄÖ´ÐУ¬¿ÉÒÔÓà EXISTS Ìæ»» IN£º \r
-\r
- SELECT *\r
- FROM tab\r
- WHERE col IN (SELECT subcol FROM subtab);\r
-\r
-¸ÄΪ£º \r
-\r
- SELECT *\r
- FROM tab\r
- WHERE EXISTS (SELECT subcol FROM subtab WHERE subcol = col);\r
-\r
-ºóÕßÒªÏëÖ´Ðеøü¿ì£¬subcol Ó¦¸ÃÊÇÒ»¸öË÷ÒýÁС£ÎÒÃÇÏ£ÍûÔÚδÀ´µÄ·¢²¼°æ±¾ÖÐ\r
-ÐÞ²¹Õâ¸öÏÞÖÆ¡£\r
-\r
-\r
- 4.23) ÎÒÔõÑù½øÐÐ outer join £¨ÍâÁ¬½Ó£©£¿\r
-\r
-PostgreSQL ²ÉÓñê×¼µÄ SQL Óï·¨Ö§³ÖÍâÁ¬½Ó¡£ÕâÀïÊÇÁ½¸öÀý×Ó£º\r
-\r
- SELECT *\r
- FROM t1 LEFT OUTER JOIN t2 ON (t1.col = t2.col);\r
-\r
-»ò \r
- SELECT *\r
- FROM t1 LEFT OUTER JOIN t2 USING (col);\r
-\r
-ÕâÁ½¸öµÈ¼ÛµÄ²éѯÔÚ t1.col ºÍ t2.col ÉÏ×öÁ¬½Ó£¬²¢ÇÒ·µâ»?t1 ÖÐËùÓÐδÁ¬½ÓµÄ\r
-ÐУ¨ÄÇЩÔÚ t2 ÖÐûÓÐÆ¥ÅäµÄÐУ©¡£ÓÒ[Íâ]Á¬½Ó(RIGHT OUTER JOIN)½«·µ»Ø t2 ÖÐ\r
-δÁ¬½ÓµÄÐС£ÍêÈ«ÍâÁ¬½Ó£¨FULL OUTER JOIN£©½«·µ»Ø t1 ºÍ t2 ÖÐδÁ¬½ÓµÄÐС£\r
-¹Ø¼ü×Ö OUTER ÔÚ×ó[Íâ]Á¬½Ó¡¢ÓÒ[Íâ]Á¬½ÓºÍÍêÈ«[Íâ]Á¬½ÓÖÐÊÇ¿ÉÑ¡µÄ£¬ÆÕͨÁ¬½Ó\r
-±»³ÉΪÄÚÁ¬½Ó£¨INNER JOIN£©¡£\r
-\r
-ÔÚ´ËÇ°µÄ°æ±¾ÖУ¬ÍâÁ¬½Ó¿ÉÒÔÓà UNION ºÍ NOT IN À´Ä£Äâ¡£ÀýÈ磬ÏÂÃæµÄÀý×ÓÔÚ\r
-±í tab1 ºÍ tab2 Ö®¼ä×öÍâÁ¬½Ó£º\r
-\r
- SELECT tab1.col1, tab2.col2\r
- FROM tab1, tab2\r
- WHERE tab1.col1 = tab2.col1\r
-\r
- UNION ALL\r
-\r
- SELECT tab1.col1, NULL\r
- FROM tab1\r
- WHERE tab1.col1 NOT IN (SELECT tab2.col1 FROM tab2)\r
- ORDER BY col1\r
-\r
-\r
- 4.24) ÈçºÎʹÓÃÉæ¼°¶à¸öÊý¾Ý¿âµÄ²éѯ£¿\r
-\r
-ûÓа취²éѯµ±Ç°Êý¾Ý¿âÖ®ÍâµÄÊý¾Ý¿â¡£ÒòΪ PostgreSQL ¼ÓÔØÊý¾Ý¿âÏà¹ØµÄϵͳ\r
-Ŀ¼£¨ÏµÍ³±í£©£¬¿çÊý¾Ý¿âµÄ²éѯÈçºÎÖ´ÐÐҲδÃ÷È·¡£\r
-\r
-contrib/dblink ÔÊÐí²ÉÓú¯Êýµ÷ÓÃʵÏÖ¿ç¿â²éѯ¡£µ±È»¿ÉÒÔͬʱÁ¬½Óµ½²»Í¬µÄÊý\r
-¾Ý¿â²¢ÔÚ¿Í»§¶ËºÏ²¢½á¹û¡£\r
-\r
-\r
- 4.25) ÈçºÎÈú¯Êý·µ»Ø¶àÐлò¶àÁУ¿\r
-\r
-¿ÉÒÔÔÚ PL/pgSQL º¯ÊýÖÐʹÓà refcursors ·µ»Ø½á¹û¼¯¡£²Î¿´\r
-http://www.PostgreSQL.org/idocs/index.php?plpgsql-cursors.html\r
-<http://www.PostgreSQL.org/idocs/index.php?plpgsql-cursors.html>,\r
-23.7.3.3½Ú¡£\r
-\r
-\r
- 4.26) ΪʲôÔÚ PL/PgSQL º¯ÊýÖв»ÄÜ¿É¿¿µØ´´½¨»òɾ³ýÁÙʱ±í£¿\r
-\r
-PL/PgSQL »º´æº¯ÊýµÄÄÚÈÝ£¬ÓÉ´Ë´øÀ´µÄÒ»¸ö²»ºÃµÄ¸±×÷ÓÃÊÇÈôÒ»¸ö PL/PgSQL º¯\r
-Êý·ÃÎÊÁËÒ»¸öÁÙʱ±í£¬È»ºó¸Ã±í±»É¾³ý²¢Öؽ¨ÁË£¬ÔòÔٴε÷Óøú¯Êý½«Ê§°Ü£¬ÒòΪ\r
-»º´æµÄº¯ÊýÄÚÈÝÈÔȻָÏò¾ÉµÄÁÙʱ±í¡£½â¾öµÄ·½·¨ÊÇÔÚ PL/PgSQL ÖÐÓà EXECUTE\r
-¶ÔÁÙʱ±í½øÐзÃÎÊ¡£ÕâÑù»á±£Ö¤²éѯÔÚÖ´ÐÐÇ°×ÜÊÇÖØзÖÎö¡£\r
-\r
-\r
- 4.27) ÓÐÄÄЩÊý¾Ý¸´ÖÆÑ¡Ï\r
-\r
-Óм¸ÖÖÖ÷/´Ó·½Ê½µÄ¸´ÖÆÑ¡Ïî¡£ÕâЩѡÏîÖ»ÔÊÐíÖ÷Êý¾Ý¿â½øÐиüУ¬´ÓÊý¾Ý¿âÖ»ÄÜ\r
-½øÐжÁ¡£ÍøÒ³ http://gborg.PostgreSQL.org/genpage?replication_research \r
-µÄ×îºóÁгöÁËÕâЩѡÏî¡£ÔÚ\r
-http://gborg.PostgreSQL.org/project/pgreplication/projdisplay.php\r
-<http://gborg.PostgreSQL.org/project/pgreplication/projdisplay.php> ÕýÔÚ\r
-½øÐÐÒ»¸ö¶àÖ÷±¾¸´ÖƵĽâ¾ö·½°¸¡£\r
-\r
-\r
- 4.28) ÓÐÄÄЩÊý¾Ý¼ÓÃÜÑ¡Ï\r
-\r
-contrib/pgcrypto °üº¬Á˺ܶàÔÚ SQL ²éѯÖÐʹÓõļÓÃܺ¯Êý¡£¼ÓÃÜ¿Í»§¶Ëµ½·þÎñ\r
-Æ÷¶Ë´«ÊäÊý¾ÝµÄΨһ·½·¨ÊÇÔÚ pg_hba.conf ÖвÉÓà hostss ¡£ \r
-\r
-7.3 °æ±¾ÖÐ×Ô¶¯¶ÔÊý¾Ý¿âÓû§ÃÜÂë½øÐмÓÃÜ¡£ÔÚÒÔÇ°µÄ°æ±¾ÖУ¬±ØÐëÔÚ\r
-postgresql.conf Öдò¿ª PASSWORD_ENCRYPTION Ñ¡Ïî¡£·þÎñÆ÷¿ÉÒÔÔËÐÐÔÚ¼ÓÃܵÄ\r
-ÎļþϵͳÉÏ£¨ÒÔ´ïµ½¼ÓÃܵÄÄ¿µÄ£©¡£\r
-\r
---------------------------------------------------------------------------------\r
-\r
-\r
- À©Õ¹ PostgreSQL\r
-\r
-\r
- 5.1) ÎÒдÁËÒ»¸öÓû§¶¨Ò庯Êý¡£µ±ÎÒÔÚ psql ÀïÔËÐÐʱ£¬ÎªÊ²Ã´»áµ¼ÖÂ\r
- core dump£¿\r
-\r
-²úÉúÕâ¸öÎÊÌâµÄÔÒòºÜ¶à¡£ÇëÏÈÔÚÒ»¸öµ¥¶ÀµÄ²âÊÔ³ÌÐòÖвâÊÔÄãµÄ×Ô¶¨Ò庯Êý¡£\r
-\r
-\r
- 5.2) ÎÒÈçºÎÄܸø PostgreSQL ¹±Ï×һЩͦ²»´íµÄÐÂÀàÐͺͺ¯Êý£¿\r
-\r
-½«ÄãµÄÀ©Õ¹·¢Ë͵½ pgsql-hackers ÓʼþÁÐ±í£¬ËüÃÇ×îÖջᱻ·Åµ½ contrib/ ×ÓĿ¼¡£\r
-\r
-\r
- 5.3) ÎÒÔõÑùдһ¸ö·µ»ØÒ»ÌõÔª×éµÄ C º¯Êý£¿\r
-\r
-ÔÚ PostgreSQL 7.3 ÒÔºóµÄ°æ±¾ÖУ¬C, PL/PgSQL ºÍ SQL ÍêÈ«Ö§³Ö·µ»ØֵΪ±íµÄ\r
-º¯Êý¡£¸ü¶àÐÅÏ¢Çë²Î¿¼ ³ÌÐòÔ±Ö¸ÄÏ£¨the Programmer's Guide£©¡£ÔÚ\r
-contrib/tablefunc ÖÐÓÐÒ»¸öÀý×ÓÊÇÓà C дµÄ·µ»ØֵΪ±íµÄº¯Êý¡£\r
-\r
-\r
- 5.4) ÎÒÐÞ¸ÄÁËÒ»¸öÔ´Îļþ£¬ÎªÊ²Ã´ÖØбàÒëºóûÓп´µ½¸Ä±ä£¿\r
-\r
-Makefiles ÖÐûÓаüº¬Í·ÎļþµÄÕýÈ·ÒÀÀµ¡£Äú±ØÐëÏÈ×ömake clean£¬ ÔÙ×öÒ»´Î\r
-make ¡£Èç¹ûÄúʹÓõÄÊÇ GCC £¬Ôò¿ÉÒÔ²ÉÓÃÑ¡Ïî --enable-depend ÈñàÒëÆ÷×Ô¶¯\r
-Éú³ÉÍ·ÎļþµÄÒÀÀµ¹Øϵ¡£\r
-\r
+</PRE> \r
+ <P>Ë÷Òý²»ÐèÒªÕâô¶àµÄ¶îÍâÏûºÄ£¬µ«Ò²È·Êµ°üÀ¨±»Ë÷ÒýµÄÊý¾Ý£¬Òò´ËËüÃÇÒ²¿ÉÄܴܺó¡£</P>\r
+ <P>¿ÕÖµ´æ·ÅÔÚλͼÖУ¬Òò´ËÕ¼ÓúÜÉٵĿռ䡣</P>\r
+ <H4><a name="4.7"></a>4.7) \r
+ ÈçºÎ²é¿´±í¡¢Ë÷Òý¡¢Êý¾Ý¿âÒÔ¼°Óû§µÄ¶¨Ò壿</H4> \r
+ <I> psql</I> ÓÐÐí¶à·´Ð±¸ÜÃüÁîÓÃÓÚÏÔʾÕâЩÐÅÏ¢¡£Óà \? ¿´¿´¶¼ÓÐÄÄЩ¡£ÒÔ pg_ ´òÍ·µÄϵͳ±íÒ²ÃèÊöÁËÕâЩÐÅÏ¢¡£ psql -l \r
+ ¿ÉÒÔÁгöËùÓеÄÊý¾Ý¿â¡£\r
+ <P>Ò²¿ÉÒÔÊÔÊÔÎļþ <I>pgsql/src/tutorial/syscat.source</I>¡£ËüÑÝʾÁËÐí¶à´ÓÊý¾Ý¿âϵͳ±íÀï»ñÈ¡ÐÅÏ¢ÐèÒªµÄ <FONT size="-1"> \r
+ SELECT</FONT>¡£\r
+ <H4><a name="4.8"></a>4.8) ÎҵIJéѯºÜÂý»òÕßûÓÐÀûÓÃË÷Òý¡£ÎªÊ²Ã´£¿</H4> \r
+ <P>\r
+ ²¢·Çÿ¸ö²éѯ¶¼»á×Ô¶¯Ê¹ÓÃË÷Òý¡£Ö»ÓÐÔÚ±íµÄ´óС³¬¹ýÒ»¸ö×îСֵ£¬²¢ÇÒ²éѯֻѡÔñ±íÖнÏС±ÈÀýµÄÐÐʱ²ÉÓÃʹÓÃË÷Òý¡£ÕâÊÇÒòΪË÷ÒýɨÃèÒýÆðµÄËæ¼´´ÅÅÌ´æÈ¡¿ÉÄܱÈÖ±½ÓµØ¶ÁÈ¡±í£¨Ë³ÐòɨÃ裩¸üÂý¡£ÎªÁËÅжÏÊÇ·ñʹÓÃË÷Òý£¬PostgreSQL \r
+ ±ØÐë»ñµÃÓйرíµÄͳ¼ÆÖµ¡£ÕâЩͳ¼ÆÖµ¿ÉÒÔʹÓà VACUUM ANALYZE£¬»ò ANALYZE \r
+ »ñµÃ¡£Ê¹ÓÃͳ¼ÆÖµ£¬ÓÅ»¯Æ÷ÖªµÀ±íÖÐÓжàÉÙÐУ¬¾ÍÄܹ»¸üºÃµØÅжÏÊÇ·ñÀûÓÃË÷Òý¡£Í³¼ÆÖµ¶ÔÈ·¶¨ÓÅ»¯µÄÁ¬½Ó˳ÐòºÍÁ¬½Ó·½·¨Ò²ºÜÓÐÓá£ÔÚ±íµÄÄÚÈÝ·¢Éú±ä»¯Ê±£¬Ó¦¶¨ÆÚ½øÐÐͳ¼ÆÖµµÄ»ñÈ¡¡£\r
+ <P>\r
+ Ë÷Òýͨ³£²»ÓÃÓÚ ORDER BY »òÖ´ÐÐÁ¬½Ó¡£¶ÔÒ»¸ö´ó±íµÄÒ»´Î˳ÐòɨÃ裬ÔÙ×öÒ»¸öÏÔʽµÄÅÅÐòͨ³£±ÈË÷ÒýɨÃèÒª¿ì¡£ \r
+ <P>µ«ÊÇ£¬ÔÚ LIMIT ºÍ ORDER BY ½áºÏʹÓÃʱ¾³£»áʹÓÃË÷Òý£¬ÒòΪֻ»á·µ»Ø±íµÄһС²¿·Ö¡£Êµ¼ÊÉÏ£¬ËäÈ» MAX() ºÍ MIN() ²¢²»Ê¹ÓÃË÷Òý£¬Í¨¹ý¶Ô \r
+ ORDER BY ºÍ LLIMIT ʹÓÃË÷ÒýÈ¡µÃ×î´óÖµºÍ×îСֵҲÊÇ¿ÉÒԵģº<BR> \r
+ <BR>\r
+ SELECT col<BR> \r
+ FROM tab<BR> \r
+ ORDER BY col [ DESC ]<BR> \r
+ LIMIT 1; \r
+ <P>µ±Ê¹ÓÃͨÅä·û²Ù×÷£¬ÀýÈç LIKE »ò ~ ʱ£¬Ë÷ÒýÖ»ÄÜÔÚÌض¨µÄÇé¿öÏÂʹÓ㺠<ul><li> ×Ö·û´®µÄ¿ªÊ¼²¿·Ö±ØÐëÊÇÆÕͨ×Ö·û´®£¬Ò²¾ÍÊÇ˵£º</li> \r
+ <ul><li>LIKE ģʽ²»ÄÜÒÔ % ´òÍ·¡£</li><li>~ £¨ÕýÔò±í´ïʽ£©Ä£Ê½±ØÐëÒÔ ^ ´òÍ·¡£</li></ul> \r
+ <li>×Ö·û´®²»ÄÜÒÔÆ¥Åä¶à¸ö×Ö·ûµÄģʽÀà´òÍ·£¬ÀýÈç [a-e]¡£</li><li>´óСдÎ޹صIJéÕÒ£¬Èç ILIKE ºÍ ~* µÈ²»Ê¹ÓÃË÷Òý¡£µ«¿ÉÒÔÓà 4.12 ½ÚÃèÊöµÄº¯ÊýË÷Òý¡£</li><li>ÔÚ×ö initdb ʱ±ØÐë²ÉÓÃȱʡµÄ±¾µØÉèÖà C locale¡£</li></ul> \r
+ <H4><a name="4.9"></a>4.9) \r
+ ÎÒÈçºÎ²ÅÄÜ¿´µ½²éѯÓÅ»¯Æ÷ÊÇÔõÑù´¦ÀíÎҵIJéѯµÄ£¿</H4> \r
+ ²Î¿¼ <FONT size="-1">EXPLAIN</FONT> ÊÖ²áÒ³¡£ \r
+ <H4><a name="4.10"></a>4.10) R-tree Ë÷ÒýÊÇʲô£¿</H4> \r
+ <P>R-tree Ë÷ÒýÓÃÓÚË÷Òý¿Õ¼äÊý¾Ý¡£Ò»¸ö¹þÏ£Ë÷ÒýÎÞ·¨´¦Àí·¶Î§ËÑË÷¡£¶ø B-tree Ë÷ÒýÖ»ÄÜ´¦ÀíһάµÄ·¶Î§ËÑË÷¡£R-tree \r
+ Ë÷Òý¿ÉÒÔ´¦Àí¶àάÊý¾Ý¡£ÀýÈ磬Èç¹û¿ÉÒÔÔÚÒ»¸öÀàÐÍΪ point µÄ×Ö¶ÎÉϽ¨Á¢Ò»¸ö R-tree Ë÷Òý£¬ÄÇôϵͳÄܸü¸ßЧµØ»Ø´ðÀàËÆ \r
+ ¡°Ñ¡ÔñÔÚÒ»¸ö³¤·½Ðη¶Î§ÄÚµÄËùÓе㡱¡£<BR>\r
+ <BR>\r
+ ÃèÊö×î³õµÄ R-Tree Éè¼ÆµÄÕýʽÂÛÎÄÊÇ£º<BR> \r
+ <BR>\r
+ Guttman, A. "R-Trees: A Dynamic Index Structure for Spatial Searching." Proc of \r
+ the 1984 ACM SIGMOD Int'l Conf on Mgmt of Data, 45-57. \r
+ <BR>\r
+ <BR>\r
+ Ä㻹¿ÉÒÔÔÚ Stonebraker µÄ¡°Readings in Database Systems¡±ÀïÕÒµ½ÕâƪÎÄÕ¡£<BR> \r
+ <BR>\r
+ ϵͳÄÚÖÃµÄ R-Tree ¿ÉÒÔ´¦Àí¶à±ßÐκͷ½ÐΡ£ÀíÂÛÉÏ˵£¬R-tree ¿ÉÒÔÀ©Õ¹Îª´¦Àí¸ü¶àάÊý¡£²»¹ýÔÚʵ¼ùÉÏ£¬À©Õ¹ R-trees \r
+ ÐèÒªÒ»¶¨µÄ¹¤×÷Á¿£¬¶øÎÒÃÇĿǰûÓÐÈçºÎ×öµÄÎĵµ¡£<H4><a name="4.11"></a>4.11) \r
+ ʲôÊÇ»ùÒò²éѯÓÅ»¯£¨Genetic Query Optimization£©£¿</H4> \r
+ <P>GEQO Ä£¿é²ÉÓûùÒòËã·¨£¨Genetic Algorithm£¬GA£©¼Ó¿ì¶à±íÁ¬½ÓµÄ²éѯÓÅ»¯¡£ËüÔÊÐíͨ¹ý·ÇÇî¾ÙËÑË÷´¦Àí´óµÄÁ¬½Ó²éѯ¡£ \r
+ <H4><a name="4.12"></a>4.12) \r
+ ÎÒÔõÑù×öÕýÔò±í´ïʽËÑË÷ºÍ´óСдÎ޹صÄÕýÔò±í´ïʽËÑË÷£¿ÔõÑùÀûÓÃË÷Òý½øÐдóСдÎÞ¹ØËÑË÷£¿</H4> \r
+ <p>²Ù×÷·û ~ ´¦ÀíÕýÔò±í´ïʽƥÅ䣬¶ø ~* ´¦Àí´óСдÎ޹صÄÕýÔò±í´ïʽƥÅä¡£´óдЩÎÞ¹ØµÄ LIKE ±äÖÖ³ÉΪ ILIKE¡£<br> \r
+ <br>\r
+ ´óСдÎ޹صĵÈʽ±È½Ïͨ³£Ð´×ö£º<br>\r
+ <br>\r
+ SELECT *<br> \r
+ FROM tab<br> \r
+ WHERE lower(col) = 'abc';<br> \r
+ <br>\r
+ ÕâÑù½«²»»áʹÓñê×¼µÄË÷Òý¡£µ«ÊÇ¿ÉÒÔ´´½¨Ò»¸ö¿É±»ÀûÓõĺ¯ÊýË÷Òý:<br>\r
+ <br>\r
+ CREATE INDEX tabindex ON tab (lower(col));</p> \r
+ <h4><a name="4.13"></a>4.13) ÔÚÒ»¸ö²éѯÀÎÒÔõÑù¼ì²âÒ»¸ö×Ö¶ÎÊÇ·ñΪ NULL£¿</h4> \r
+ <p>Óà IS NULL ºÍ IS NOT NULL ²âÊÔÕâ¸ö×ֶΡ£ <br> \r
+ </p>\r
+ <h4><a name="4.14"></a>4.14) ¸÷ÖÖ×Ö·ûÀàÐÍÖ®¼äÓÐʲô²»Í¬£¿</h4> \r
+ <p> ÀàÐÍ \r
+ ÄÚ²¿Ãû³Æ \r
+ ˵Ã÷<br>\r
+ --------------------------------------------------<br> \r
+ "char" char \r
+ 1¸ö×Ö·û character<br> \r
+ CHAR(#) bpchar \r
+ ¶¨³¤×Ö·û´®£¬Êµ¼ÊÊý¾Ý²»×㶨Ò峤¶Èʱ£¬ÒÔ¿Õ¸ñ²¹Æë<br>\r
+ VARCHAR(#) varchar Ö¸¶¨ÁË×î´ó³¤¶È£¬±ä³¤×Ö·û´®£¬²»×㶨Ò峤¶ÈµÄ²¿·Ö²»²¹Æë<br> \r
+ TEXT text \r
+ ´®³¤¶È½öÊÜÐеÄ×î´ó³¤¶ÈÏÞÖÆ<br>\r
+ BYTEA bytea \r
+ ±ä³¤×Ö½ÚÐòÁУ¨±ä³¤µÄ¶þ½øÖÆÊý¾Ý£©<br>\r
+ <br>\r
+ ÔÚϵͳ±íºÍÔÚһЩ´íÎóÐÅÏ¢ÀïÄ㽫¿´µ½ÄÚ²¿Ãû³Æ¡£ <br>\r
+ <br>\r
+ ÉÏÃæ×îºóËÄÖÖÀàÐÍÊÇ"varlena"£¨±ä³¤£©ÀàÐÍ£¨Ò²¾ÍÊÇ˵£¬¿ªÍ·µÄËĸö×Ö½ÚÊdz¤¶È£¬ºóÃæ²ÅÊÇÊý¾Ý£©¡£ÓÚÊÇʵ¼ÊÕ¼ÓõĿռä±ÈÉùÃ÷µÄ´óСҪ¶àһЩ¡£È»¶øÕâЩÀàÐͶ¼¿ÉÒÔ±»Ñ¹Ëõ´æ´¢£¬Ò²¿ÉÒÔÓà TOAST ÍÑ»ú´æ´¢£¬Òò´Ë´ÅÅÌ¿Õ¼äÒ²¿ÉÄܱÈÔ¤ÏëµÄÒªÉÙ¡£<br> \r
+ <br>\r
+ CHAR(n) ×îÊʺÏÓÚ´æ´¢³¤¶È»ù±¾²î²»¶àµÄ×Ö·û´®¡£VARCHAR(n) ÔÚ´æ´¢ÏÞÖÆÁË×î´ó³¤¶ÈµÄ±ä³¤×Ö·û´®ÊÇ×îºÃµÄ¡£TEXT ÊÊÓÃÓÚ´æ´¢²»ÏÞÖƳ¤¶ÈµÄ×Ö·û´®£¬×î´ó¿É´ï 1G¡£BYTEA ÓÃÓÚ´æ´¢¶þ½øÖÆÊý¾Ý£¬ÓÈÆäÊÇ°üº¬ NULL ×Ö½Ú£¨¶þ½øÖƵÄ0£©µÄÖµ¡£ÕâЩÀàÐ;ßÓÐÀàÐ͵ÄÐÔÄÜ¡£</p> \r
+ <h4><a name="4.15.1"></a>4.15.1) ÎÒÔõÑù´´½¨Ò»¸öÐòÁкÅ/×Ô¶¯µÝÔöµÄ×ֶΣ¿</h4> \r
+ <p>PostgreSQL Ö§³Ö SERIAL Êý¾ÝÀàÐÍ¡£ËüÔÚ×Ö¶ÎÉÏ×Ô¶¯´´½¨Ò»¸öÐòÁкÍË÷Òý¡£ÀýÈ磬<br> \r
+ CREATE TABLE person ( <br> \r
+ id SERIAL, <br> \r
+ name TEXT <br> \r
+ );<br> \r
+ <br>\r
+ »á×Ô¶¯×ª»»Îª£º <br>\r
+ <br>\r
+ CREATE SEQUENCE person_id_seq;<br> \r
+ CREATE TABLE person ( <br> \r
+ id INT4 NOT NULL DEFAULT nextval('person_id_seq'),<br> \r
+ name TEXT <br> \r
+ );<br> \r
+ CREATE UNIQUE INDEX person_id_key ON person ( id );<br> \r
+ <br>\r
+ ²Î¿¼ create_sequence ÊÖ²áÒ³»ñÈ¡¹ØÓÚÐòÁеĸü¶àÐÅÏ¢¡£Ä㻹¿ÉÒÔÓÃÿÐÐµÄ oid ×Ö¶Î×÷Ϊһ¸öΨһֵ¡£²»¹ý£¬Èç¹ûÄãÐèÒªÇãµ¹ºÍÖØÔØÊý¾Ý¿â£¬ÄãÐèҪʹÓà pg_dump µÄ -o Ñ¡Ïî»òÕß COPY WITH OIDS Ñ¡ÏîÒÔ±£Áô OID¡£ </p> \r
+ <h4><a name="4.15.2"></a>4.15.2) \r
+ ÎÒÈçºÎ»ñµÃÒ»¸ö²åÈëµÄÐòÁкŵÄÖµ£¿</h4>\r
+ <p>Ò»ÖÖ·½·¨ÊÇÔÚ²åÈë֮ǰÏÈÓú¯Êý nextval() ´ÓÐòÁжÔÏóÀï¼ìË÷³öÏÂÒ»¸ö SERIAL Öµ£¬È»ºóÔÙÏÔʽ²åÈ롣ʹÓà \r
+ <a href="#4.15.1"> 4.15.1</a> ÀïµÄÀý±í£¬¿ÉÓÃαÂëÕâÑùÃèÊö£º <br> \r
+ <br>\r
+ new_id = execute("SELECT nextval('person_id_seq')");<br> \r
+ execute("INSERT INTO person (id, name) VALUES (new_id, 'Blaise Pascal')");<br> \r
+ <br>\r
+ ÕâÑù»¹ÄÜÔÚÆäËû²éѯÖÐʹÓôæ·ÅÔÚ new_id ÀïµÄÐÂÖµ£¨ÀýÈ磬×÷Ϊ person ±íµÄÍâ¼ü£©¡£×¢Òâ×Ô¶¯´´½¨µÄ SEQUENCE ¶ÔÏóµÄÃû³Æ½«»áÊÇ <table>_<serialcolumn>_seq£¬ÕâÀï table ºÍ serialcolumn ·Ö±ðÊÇÄãµÄ±íµÄÃû³ÆºÍÄãµÄ SERIAL ×ֶεÄÃû³Æ¡£ <br> \r
+ <br>\r
+ ÀàËƵģ¬ÔÚ SERIAL ¶ÔÏóȱʡ²åÈëºóÄã¿ÉÒÔÓú¯Êý currval() ¼ìË÷¸Õ¸³ÖµµÄ SERIAL Öµ£¬ÀýÈ磬 <br> \r
+ <br>\r
+ execute("INSERT INTO person (name) VALUES ('Blaise Pascal')");<br> \r
+ new_id = execute("SELECT currval('person_id_seq')");<br> \r
+ <br>\r
+ ×îºó£¬Äã¿ÉÒÔʹÓÃ´Ó INSERT Óï¾ä·µ»ØµÄ <a href="4.16">OID</a> \r
+ ²éÕÒȱʡֵ£¬¾¡¹ÜÕâ¿ÉÄÜÊÇ×îȱ·¦ÒÆÖ²ÐԵķ½·¨¡£ÔÚ Perl ÀʹÓôøÓÐ Edmund Mergl µÄ DBD::Pg Ä£¿éµÄ DBI£¬oid Öµ¿ÉÒÔͨ¹ý $sth->execute() ºóµÄ $sth->{pg_oid_status} »ñµÃ¡£ </p> \r
+ <h4><a name="4.15.3"></a>4.15.3) ʹÓà currval() ºÍ nextval() »áµ¼ÖÂÒ»¸öÓëÆäËûÓû§Ö®¼äµÄÎÉÂÒÇé¿öÂð£¿</h4> \r
+ <p>²»»á¡£currval() ·µ»Øºǫ́½ø³Ì¶ø²»ÊÇËùÓÐÓû§¸³ÓèµÄµ±Ç°Öµ¡£<br> \r
+ </p>\r
+ <h4><a name="4.15.4"></a>4.15.4) \r
+ Ϊʲô²»ÔÚÊÂÎñÒì³£ÖÐÖ¹ºóÖØÓÃÐòÁкÅÄØ£¿ÎªÊ²Ã´ÔÚÐòÁкÅ×ֶεÄÈ¡ÖµÖдæÔÚ¼ä¶ÏÄØ£¿</h4>\r
+ <p>ΪÁËÌá¸ß²¢·¢ÐÔ£¬ÐòÁкÅÔÚÐèÒªµÄʱºò¸³ÓèÕýÔÚÔËÐеÄÊÂÎñ£¬²¢ÇÒÖ»ÔÚÊÂÎñ½áÊø֮ǰ²»·âËø¡£Õâ¾Í»áµ¼ÖÂزÕÛÊÂÎñºóµÄÐòÁкųöÏÖ¼ä¸ô¡£</p>\r
+ <h4><br>\r
+ <a name="4.16"></a>4.16) ʲôÊÇ OID£¿Ê²Ã´ÊÇ TID£¿</h4> \r
+ <p>OID ÊÇ PostgreSQL ÖÐÐеÄΨһ±êʶ¡£PostgreSQL Àï´´½¨µÄÿһÐж¼»ñµÃÒ»¸öΨһµÄ OID¡£ËùÓÐÔÚ initdb ¹ý³ÌÖд´½¨µÄ OID ¶¼Ð¡ÓÚ 16384 £¨²Î¼û include/access/transam.h£©¡£ËùÓÐÓû§´´½¨µÄ OID ¶¼´óÓÚ»òµÈÓÚÕâ¸öÖµ¡£È±Ê¡Ê±£¬ËùÓÐÕâЩ OID ²»½öÔÚÒ»¸ö±í»òÒ»¸öÊý¾Ý¿âÀïÃæΨһ£¬¶øÇÒÔÚÕû¸ö PostgreSQL °²×°ÀïÒ²ÊÇΨһµÄ¡£ <br> \r
+ <br>\r
+ PostgreSQL ÔÚËüµÄÄÚ²¿ÏµÍ³±íÀïʹÓà OID ÔÚ±íÖ®¼ä½¨Á¢ÁªÏµ¡£ÕâЩ OID ¿ÉÒÔÓÃÓÚ±êʶÌض¨µÄÓû§ÐÐÒÔ¼°ÓÃÔÚÁ¬½ÓÀï¡£½¨ÒéʹÓÃ×Ö¶ÎÀàÐÍ OID ´æ´¢ OID Öµ¡£¿ÉÒÔÔÚ OID ×Ö¶ÎÉÏ´´½¨Ò»¸öË÷ÒýÒÔ¿ìËÙ·ÃÎÊ¡£ <br> \r
+ <br>\r
+ OID ´ÓÒ»¸ö±»ËùÓÐÊý¾Ý¿âʹÓõÄÖÐÐÄÇøÓòÀ︳ֵ¸øËùÓÐÐÂÐС£Èç¹ûÄãÏë°Ñ OID ¸Ä³É±ðµÄÖµ£¬»òÕßÏë×öÒ»·Ý±íµÄ´øÔʼ OID µÄ¿½±´£¬Äã¿ÉÒÔ×öµ½£º <br> \r
+ <br>\r
+ CREATE TABLE new(old_oid oid, mycol int);<br> \r
+ SELECT old_oid, mycol INTO new FROM old;<br> \r
+ COPY new TO '/tmp/pgtable';<br> \r
+ DELETE FROM new;<br> \r
+ COPY new WITH OIDS FROM '/tmp/pgtable';<br> \r
+ <br>\r
+ OID ÓÃ4×Ö½ÚµÄÕûÊý±£´æ£¬ÔÚ³¬¹ý40ÒÚʱ½«Òç³ö¡£Ã»ÓÐÈ˱¨¸æ³öÏÖ¹ýÒç³ö£¬¶øÎÒÃÇ´òËãÔÚÓÐÈ˱¨¸æ֮ǰÏû³ýÕâ¸öÏÞÖÆ¡£<br> \r
+ <br>\r
+ TID ÓÃÓÚ±êʶ´ø×ÅÊý¾Ý¿é£¨µØÖ·£©ºÍ£¨¿éÄÚ£©Æ«ÒƵÄÌض¨µÄÎïÀíÐС£TID ÔÚÐб»¸ü¸Ä»òÖØÔغó·¢Éú¸Ä±ä¡£Ë÷ÒýÈë¿ÚʹÓÃËüÃÇÖ¸ÏòÎïÀíÐС£</p> \r
+ <h4><a name="4.17"></a>4.17) PostgreSQL ʹÓõÄһЩÊõÓïµÄº¬ÒåÊÇʲô£¿</h4> \r
+ <p>һЩԴ´úÂëºÍһЩ¾ÉÒ»µãµÄÎĵµÊ¹ÓÃһЩÓиü³£ÓÃÓ÷¨µÄÊõÓï¡£ÏÂÃæÊÇÆäÖÐÒ»²¿·Ö£º <br>\r
+ table, relation, class <br> \r
+ row, record, tuple <br> \r
+ column, field, attribute <br> \r
+ retrieve, select <br> \r
+ replace, update <br> \r
+ append, insert <br> \r
+ OID, serial value <br> \r
+ portal, cursor <br> \r
+ range variable, table name, table alias <br> \r
+ <br>\r
+ ÓÐÒ»¸öͨÓÃÊý¾Ý¿âÊõÓïµÄÁÐ±í£º<a href="http://hea-www.harvard.edu/MST/simul/software/docs/pkgs/pgsql/glossary/glossary.html">http://hea-www.harvard.edu/MST/simul/software/docs/pkgs/pgsql/glossary/glossary.html</a> \r
+ ¡£ </p>\r
+ <h4><a name="4.18"></a>4.18) \r
+ ΪʲôÎÒÊÕµ½´íÎó¡°<i>ERROR: Memory exhausted in AllocSetAlloc()</i>¡±£¿</h4>\r
+ <p>ÕâºÜ¿ÉÄÜÊÇϵͳµÄÐéÄâÄÚ´æÓùâÁË£¬»òÕßÄں˶ÔijЩ×ÊÔ´Óнϵ͵ÄÏÞÖÆÖµ¡£ÔÚÆô¶¯ postmaster ֮ǰÊÔÊÔÏÂÃæµÄÃüÁ <br> \r
+ <br>\r
+ ulimit -d 262144<br> \r
+ limit datasize 256m<br> \r
+ <br>\r
+ È¡¾öÓÚÄãÓÃµÄ shell£¬ÉÏÃæÃüÁîÖ»ÓÐÒ»ÌõÄܳɹ¦£¬µ«ÊÇËü½«°ÑÄãµÄ½ø³ÌÊý¾Ý¶ÎÏÞÖÆÉèµÃ±È½Ï¸ß£¬Òò¶øÒ²ÐíÄÜÈòéѯÍê³É¡£ÕâÌõÃüÁîÓ¦ÓÃÓÚµ±Ç°½ø³Ì£¬ÒÔ¼°ËùÓÐÔÚÕâÌõÃüÁîÔËÐк󴴽¨µÄ×Ó½ø³Ì¡£Èç¹ûÄãÊÇÔÚÔËÐÐSQL¿Í»§¶ËʱÒòΪºǫ́·µ»ØÁËÌ«¶àµÄÊý¾Ý¶ø³öÏÖÎÊÌ⣬ÇëÔÚÔËÐпͻ§¶Ë֮ǰִÐÐÉÏÊöÃüÁî¡£</p> \r
+ <h4><a name="4.19"></a>4.19) \r
+ ÎÒÈçºÎ²ÅÄÜÖªµÀËùÔËÐÐµÄ PostgreSQL µÄ°æ±¾£¿</h4> \r
+ <p>´Ó psql À¼üÈë SELECT version()£»<br> \r
+ </p>\r
+ <h4><a name="4.20"></a>4.20) \r
+ ΪʲôÎҵĴó¶ÔÏó²Ù×÷µ¼Ö´íÎó¡°<I>invalid large obj descriptor¡±£¨·Ç·¨µÄ´ó¶ÔÏóÃèÊö·û£©</I>£¿</h4> \r
+ <p>ÄãÐèÒªÔÚʹÓÃÈκδó¶ÔÏó¾ä±úµÄÇ°ºó·ÅÉÏ BEGIN WORK ºÍ COMMIT£¬Ò²¾ÍÊÇ˵£¬°üΧ lo_open ... lo_close¡£ <br> \r
+ <br>\r
+ Ä¿Ç° PostgreSQL Ç¿ÖÆʵʩÕâÌõ¹æÔò£ºÔÚÊÂÎñÌύʱ¹Ø±Õ´ó¶ÔÏó¾ä±ú£¬ÕâÑù£¬£¨Ã»ÓвÉÓÃÊÂÎñʱ£©£¬Ê״ζԴó¶ÔÏó¾ä±ú×öÈκÎÊÂÇéµÄÆóͼ¶¼»áµ¼ÖÂÒ»¸ö invalid large obj descriptor¡£ËùÒÔ£¬Èç¹ûÄãûÓÐʹÓÃÒ»¸öÊÂÎñ£¬ÒÔÇ°Äܹ¤×÷µÄ´úÂ루ÖÁÉÙÊÇ´ó¶àÊýʱ¼ä£©½«»áÉú³ÉÕâôһ¸ö´íÎóÐÅÏ¢¡£ <br> \r
+ <br>\r
+ Èç¹ûÄãʹÓÿͻ§¶Ë½Ó¿Ú£¬Èç ODBC£¬Äã¿ÉÄÜÐèÒª set auto-commit off¡£</p> \r
+ <h4><a name="4.21"></a>4.21) ÎÒÈçºÎ´´½¨Ò»¸öȱʡֵÊǵ±Ç°Ê±¼äµÄ×ֶΣ¿</h4> \r
+ <p>ʹÓà CURRENT_TIMESTAMP£º<br> \r
+ <br>\r
+ CREATE TABLE test(x int, modtime timestamp DEFAULT CURRENT_TIMESTAMP);</p> \r
+ <h4><a name="4.22"></a>4.22) ΪʲôʹÓà IN µÄ×Ó²éѯÕâôÂý£¿</h4> \r
+ <p>Ä¿Ç°£¬ÎÒÃÇͨ¹ýΪÍâ²éѯµÄÿһÐÐ˳ÐòɨÃè×Ó²éѯµÄ½á¹ûÀ´Á¬½Ó×Ó²éѯºÍÍâ²éѯ¡£Èç¹û×Ó²éѯ·µ»ØÉÙÊý¼¸ÐУ¬¶øÍâ²éѯ·µ»ØºÜ¶àÐУ¬IN Ö´Ðеúܿ졣ΪÁ˼ӿìÆäËû IN ²éѯµÄÖ´ÐУ¬¿ÉÒÔÓà EXISTS Ìæ»» IN£º <br> \r
+ <br>\r
+ SELECT *<br> \r
+ FROM tab<br> \r
+ WHERE col IN (SELECT subcol FROM subtab);<br> \r
+ <br>\r
+ ¸ÄΪ£º <br>\r
+ <br>\r
+ SELECT *<br> \r
+ FROM tab<br> \r
+ WHERE EXISTS (SELECT subcol FROM subtab WHERE subcol = col);<br> \r
+ <br>\r
+ ºóÕßÒªÏëÖ´Ðеøü¿ì£¬subcol Ó¦¸ÃÊÇÒ»¸öË÷ÒýÁС£ÎÒÃÇÏ£ÍûÔÚδÀ´µÄ·¢²¼°æ±¾ÖÐÐÞ²¹Õâ¸öÏÞÖÆ¡£</p> \r
+ <h4><a name="4.23"></a>4.23) ÎÒÔõÑù½øÐÐ outer join £¨ÍâÁ¬½Ó£©£¿</h4> \r
+ <p>PostgreSQL ²ÉÓñê×¼µÄ SQL Óï·¨Ö§³ÖÍâÁ¬½Ó¡£ÕâÀïÊÇÁ½¸öÀý×Ó£º<br> \r
+ <br>\r
+ SELECT *<br> \r
+ FROM t1 LEFT OUTER JOIN t2 ON (t1.col = t2.col);<br> \r
+ <br>\r
+ »ò <br>\r
+ SELECT *<br> \r
+ FROM t1 LEFT OUTER JOIN t2 USING (col);<br> \r
+ <br>\r
+ ÕâÁ½¸öµÈ¼ÛµÄ²éѯÔÚ t1.col ºÍ t2.col ÉÏ×öÁ¬½Ó£¬²¢ÇÒ·µâ»?t1 ÖÐËùÓÐδÁ¬½ÓµÄÐУ¨ÄÇЩÔÚ t2 ÖÐûÓÐÆ¥ÅäµÄÐУ©¡£ÓÒ[Íâ]Á¬½Ó(RIGHT OUTER JOIN)½«·µ»Ø t2 ÖÐδÁ¬½ÓµÄÐС£ÍêÈ«ÍâÁ¬½Ó£¨FULL OUTER JOIN£©½«·µ»Ø t1 ºÍ t2 ÖÐδÁ¬½ÓµÄÐС£¹Ø¼ü×Ö OUTER ÔÚ×ó[Íâ]Á¬½Ó¡¢ÓÒ[Íâ]Á¬½ÓºÍÍêÈ«[Íâ]Á¬½ÓÖÐÊÇ¿ÉÑ¡µÄ£¬ÆÕͨÁ¬½Ó±»³ÉΪÄÚÁ¬½Ó£¨INNER JOIN£©¡£<br> \r
+ <br>\r
+ ÔÚ´ËÇ°µÄ°æ±¾ÖУ¬ÍâÁ¬½Ó¿ÉÒÔÓà UNION ºÍ NOT IN À´Ä£Äâ¡£ÀýÈ磬ÏÂÃæµÄÀý×ÓÔÚ±í tab1 ºÍ tab2 Ö®¼ä×öÍâÁ¬½Ó£º<br> \r
+ <br>\r
+ SELECT tab1.col1, tab2.col2<br> \r
+ FROM tab1, tab2<br> \r
+ WHERE tab1.col1 = tab2.col1<br> \r
+ <br>\r
+ UNION ALL<br> \r
+ <br>\r
+ SELECT tab1.col1, NULL<br> \r
+ FROM tab1<br> \r
+ WHERE tab1.col1 NOT IN (SELECT tab2.col1 FROM tab2)<br> \r
+ ORDER BY col1</p> \r
+ <h4><a name="4.24"></a>4.24) \r
+ ÈçºÎʹÓÃÉæ¼°¶à¸öÊý¾Ý¿âµÄ²éѯ£¿</h4>\r
+ <p>ûÓа취²éѯµ±Ç°Êý¾Ý¿âÖ®ÍâµÄÊý¾Ý¿â¡£ÒòΪ PostgreSQL ¼ÓÔØÊý¾Ý¿âÏà¹ØµÄϵͳĿ¼£¨ÏµÍ³±í£©£¬¿çÊý¾Ý¿âµÄ²éѯÈçºÎÖ´ÐÐҲδÃ÷È·¡£<br> \r
+ <br>\r
+ contrib/dblink ÔÊÐí²ÉÓú¯Êýµ÷ÓÃʵÏÖ¿ç¿â²éѯ¡£µ±È»¿ÉÒÔͬʱÁ¬½Óµ½²»Í¬µÄÊý¾Ý¿â²¢ÔÚ¿Í»§¶ËºÏ²¢½á¹û¡£</p> \r
+ <h4><a name="4.25"></a>4.25) \r
+ ÈçºÎÈú¯Êý·µ»Ø¶àÐлò¶àÁУ¿</h4>\r
+ <p>¿ÉÒÔÔÚ PL/pgSQL º¯ÊýÖÐʹÓà refcursors ·µ»Ø½á¹û¼¯¡£²Î¿´ \r
+ <a href="http://www.PostgreSQL.org/idocs/index.php?plpgsql-cursors.html"> http://www.PostgreSQL.org/idocs/index.php?plpgsql-cursors.html</a>, 23.7.3.3½Ú¡£<br> \r
+ </p>\r
+ <h4><a name="4.26"></a>4.26) ΪʲôÔÚ \r
+ PL/PgSQL º¯ÊýÖв»ÄÜ¿É¿¿µØ´´½¨»òɾ³ýÁÙʱ±í£¿</h4> \r
+ <p>PL/PgSQL \r
+ »º´æº¯ÊýµÄÄÚÈÝ£¬ÓÉ´Ë´øÀ´µÄÒ»¸ö²»ºÃµÄ¸±×÷ÓÃÊÇÈôÒ»¸ö PL/PgSQL \r
+ º¯Êý·ÃÎÊÁËÒ»¸öÁÙʱ±í£¬È»ºó¸Ã±í±»É¾³ý²¢Öؽ¨ÁË£¬ÔòÔٴε÷Óøú¯Êý½«Ê§°Ü£¬ÒòΪ»º´æµÄº¯ÊýÄÚÈÝÈÔȻָÏò¾ÉµÄÁÙʱ±í¡£½â¾öµÄ·½·¨ÊÇÔÚ \r
+ PL/PgSQL ÖÐÓÃ EXECUTE \r
+ ¶ÔÁÙʱ±í½øÐзÃÎÊ¡£ÕâÑù»á±£Ö¤²éѯÔÚÖ´ÐÐÇ°×ÜÊÇÖØзÖÎö¡£</p>\r
+ <h4><a name="4.27"></a>4.27) \r
+ ÓÐÄÄЩÊý¾Ý¸´ÖÆÑ¡Ï</h4>\r
+ <p>Óм¸ÖÖÖ÷/´Ó·½Ê½µÄ¸´ÖÆÑ¡Ïî¡£ÕâЩѡÏîÖ»ÔÊÐíÖ÷Êý¾Ý¿â½øÐиüУ¬´ÓÊý¾Ý¿âÖ»ÄܽøÐжÁ¡£ÍøÒ³ \r
+ <a href="http://gborg.PostgreSQL.org/genpage?replication_research">http://gborg.PostgreSQL.org/genpage?replication_research</a> \r
+ µÄ×îºóÁгöÁËÕâЩѡÏî¡£ÔÚ <a href="http://gborg.PostgreSQL.org/project/pgreplication/projdisplay.php"> http://gborg.PostgreSQL.org/project/pgreplication/projdisplay.php</a> \r
+ ÕýÔÚ½øÐÐÒ»¸ö¶àÖ÷±¾¸´ÖƵĽâ¾ö·½°¸¡£</p> \r
+ <h4><a name="4.28"></a>4.28) \r
+ ÓÐÄÄЩÊý¾Ý¼ÓÃÜÑ¡Ï\r
+ <CENTER>\r
+ </CENTER>\r
+ </h4>\r
+ <p>contrib/pgcrypto °üº¬Á˺ܶàÔÚ SQL \r
+ ²éѯÖÐʹÓõļÓÃܺ¯Êý¡£¼ÓÃÜ¿Í»§¶Ëµ½·þÎñÆ÷¶Ë´«ÊäÊý¾ÝµÄΨһ·½·¨ÊÇÔÚ pg_hba.conf \r
+ ÖвÉÓà hostss ¡£ <br> \r
+ <br>\r
+ 7.3 \r
+ °æ±¾ÖÐ×Ô¶¯¶ÔÊý¾Ý¿âÓû§ÃÜÂë½øÐмÓÃÜ¡£ÔÚÒÔÇ°µÄ°æ±¾ÖУ¬±ØÐëÔÚ \r
+ postgresql.conf Öдò¿ª PASSWORD_ENCRYPTION \r
+ Ñ¡Ïî¡£·þÎñÆ÷¿ÉÒÔÔËÐÐÔÚ¼ÓÃܵÄÎļþϵͳÉÏ£¨ÒÔ´ïµ½¼ÓÃܵÄÄ¿µÄ£©¡£<br>\r
+ <br>\r
+ --------------------------------------------------------------------------------</p>\r
+ <h2 align="center">À©Õ¹ PostgreSQL</h2> \r
+ <h4><a name="5.1"></a>5.1) \r
+ ÎÒдÁËÒ»¸öÓû§¶¨Ò庯Êý¡£µ±ÎÒÔÚ psql ÀïÔËÐÐʱ£¬ÎªÊ²Ã´»áµ¼Ö core dump£¿</h4> \r
+ <p>²úÉúÕâ¸öÎÊÌâµÄÔÒòºÜ¶à¡£ÇëÏÈÔÚÒ»¸öµ¥¶ÀµÄ²âÊÔ³ÌÐòÖвâÊÔÄãµÄ×Ô¶¨Ò庯Êý¡£</p>\r
+ <h4><a name="5.2"></a>5.2) ÎÒÈçºÎÄܸø \r
+ PostgreSQL ¹±Ï×һЩͦ²»´íµÄÐÂÀàÐͺͺ¯Êý£¿</h4> \r
+ <p>½«ÄãµÄÀ©Õ¹·¢Ë͵½ pgsql-hackers \r
+ ÓʼþÁÐ±í£¬ËüÃÇ×îÖջᱻ·Åµ½ contrib/ ×ÓĿ¼¡£<br> \r
+ </p>\r
+ <h4><a name="5.3"></a>5.3) ÎÒÔõÑùдһ¸ö·µ»ØÒ»ÌõÔª×éµÄ C º¯Êý£¿</h4> \r
+ <p>ÔÚ PostgreSQL 7.3 ÒÔºóµÄ°æ±¾ÖУ¬C, PL/PgSQL ºÍ SQL \r
+ ÍêÈ«Ö§³Ö·µ»ØֵΪ±íµÄº¯Êý¡£¸ü¶àÐÅÏ¢Çë²Î¿¼ \r
+ ³ÌÐòÔ±Ö¸ÄÏ£¨the Programmer's Guide£©¡£ÔÚ contrib/tablefunc \r
+ ÖÐÓÐÒ»¸öÀý×ÓÊÇÓà C дµÄ·µ»ØֵΪ±íµÄº¯Êý¡£</p> \r
+ <h4><a name="5.4"></a>5.4) \r
+ ÎÒÐÞ¸ÄÁËÒ»¸öÔ´Îļþ£¬ÎªÊ²Ã´ÖØбàÒëºóûÓп´µ½¸Ä±ä£¿</h4>\r
+ <p> Makefiles ÖÐûÓаüº¬Í·ÎļþµÄÕýÈ·ÒÀÀµ¡£Äú±ØÐëÏÈ×ömake \r
+ clean£¬ ÔÙ×öÒ»´Î make ¡£Èç¹ûÄúʹÓõÄÊÇ GCC \r
+ £¬Ôò¿ÉÒÔ²ÉÓÃÑ¡Ïî --enable-depend \r
+ ÈñàÒëÆ÷×Ô¶¯Éú³ÉÍ·ÎļþµÄÒÀÀµ¹Øϵ¡£</p>\r
+ </BODY>\r
+</HTML>\r