-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\r
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" dir="ltr">\r
- <head>\r
- <title>\r
- PostgreSQL: PostgreSQL ³£¼ûÎÊÌ⣨FAQ£©\r
- </title>\r
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />\r
- </head>\r
-\r
- <body>\r
-\r
-<h1>PostgreSQL ³£¼ûÎÊÌ⣨FAQ£©</h1>\r
-<p>\r
-×î½ü¸üУº2005 Äê 06 Ô 02 ÈÕ ÐÇÆÚÎå 22:27:35 CST\r
-</p>\r
-<p>\r
- Ŀǰά»¤ÈËÔ±£ºBruce Momjian (<a href="mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</a>)<br/>\r
- ÖÐÎÄ°æά»¤ÈËÔ±£ºdoudou586 £¨doudou586_2005@yahoo.com.cn£©\r
-</p>\r
-<p>\r
- ±¾ÎĵµµÄ×îа汾¿ÉÒÔÔÚ\r
- <a href="http://www.postgresql.org/files/documentation/faqs/FAQ.html">http://www.postgresql.org/files/documentation/faqs/FAQ.html</a>²é¿´¡£\r
-</p>\r
-<p>\r
- Óë²Ù×÷ϵͳƽ̨Ïà¹ØµÄÎÊÌâÔÚ<a href="http://www.postgresql.org/docs/faq/">http://www.postgresql.org/docs/faq/</a>Àï»Ø´ð¡£<br/>\r
-</p>\r
-<hr/>\r
-\r
-<div><h2>³£¼ûÎÊÌâ</h2></div>\r
-\r
-<p>\r
-<a href="#1.1">1.1</a>)PostgreSQL ÊÇʲô£¿¸ÃÔõô·¢Òô£¿<br/>\r
-<a href="#1.2">1.2</a>)PostgreSQL µÄ°æȨÊÇʲô£¿<br/>\r
-<a href="#1.3">1.3</a>)PostgreSQL ¿ÉÒÔÔËÐÐÔÚÄÄЩ²Ù×÷ϵͳƽ̨ÉÏ£¿<br/>\r
-<a href="#1.4">1.4</a>)ÎÒ´ÓÄÄÀïÄܵõ½ PostgreSQL£¿<br/>\r
-<a href="#1.5">1.5</a>)ÎÒ´ÓÄÄÀïÄܵõ½¶Ô PostgreSQL µÄÖ§³Ö£¿<br/>\r
-<a href="#1.6">1.6</a>)ÎÒÈçºÎÌá½»Ò»¸öBUG±¨¸æ£¿<br/>\r
-<a href="#1.7">1.7</a>)×îаæµÄPostgreSQL ÊÇʲô£¿<br/>\r
-<a href="#1.8">1.8</a>)Äܹ»»ñÈ¡µÄ×îÐÂÎĵµÓÐÄÄЩ£¿<br/>\r
-<a href="#1.9">1.9</a>)ÎÒÈçºÎÁ˽âÒÑÖªµÄ BUG »òÔÝȱµÄ¹¦ÄÜ£¿<br/>\r
-<a href="#1.10">1.10</a>)ÎÒÓ¦¸ÃÔõÑùѧϰ SQL £¿<br/>\r
-<a href="#1.11">1.11</a>)ÎÒÓ¦¸ÃÔõÑù¼ÓÈ뿪·¢¶ÓÎ飿<br/>\r
-<a href="#1.12">1.12</a>)PostgreSQL ºÍÆäËûÊý¾Ý¿âϵͳ±ÈÆðÀ´ÈçºÎ£¿<br/> \r
-<a href="#1.13">1.13</a>)Ë¿ØÖƺ͹ÜÀíPostgreSQL £¿\r
-</p>\r
-\r
-<div><h2>Óû§¿Í»§¶ËÎÊÌâ</h2></div>\r
-<p>\r
-<a href="#2.1">2.1</a>)ÎÒÃÇ¿ÉÒÔÓÃʲôÓïÑÔºÍ PostgreSQL ´ò½»µÀ£¿<br/>\r
-<a href="#2.2">2.2</a>)ÓÐʲô¹¤¾ß¿ÉÒÔ°Ñ PostgreSQL ÓÃÓÚ Web Ò³Ã棿<br/>\r
-<a href="#2.3">2.3</a>)PostgreSQL ÓµÓÐͼÐÎÓû§½çÃæÂð£¿<br/>\r
-</p>\r
-\r
-<div><h2>ϵͳ¹ÜÀíÎÊÌâ</h2></div>\r
-<p>\r
-<a href="#3.1">3.1</a>)ÎÒÔõÑù²ÅÄÜ°Ñ PostgreSQL ×°ÔÚ /usr/local/pgsql ÒÔÍâµÄµØ·½£¿<br/>\r
-<a href="#3.2">3.2</a>)ÎÒÈçºÎ¿ØÖÆÀ´×ÔÆäËûÖ÷»úµÄÁ¬½Ó£¿<br/>\r
-<a href="#3.3">3.3</a>)ÎÒÔõÑùµ÷ÕûÊý¾Ý¿âÒýÇæÒÔ»ñµÃ¸üºÃµÄÐÔÄÜ£¿<br/>\r
-<a href="#3.4">3.4</a>)PostgreSQL Àï¿ÉÒÔ»ñµÃʲôÑùµÄµ÷ÊÔÌØÐÔ£¿<br/>\r
-<a href="#3.5">3.5</a>)ΪʲôÔÚÊÔͼÁ¬½ÓµÇ¼ʱÊÕµ½¡°Sorry, too many clients¡± ÏûÏ¢£¿<br/>\r
-<a href="#3.6">3.6</a>)ΪʲôҪÔÚÉý¼¶ PostgreSQL Ö÷Òª·¢²¼°æ±¾Ê±×ö dump ºÍ restore £¿<br/>\r
-<a href="#3.7">3.7</a>)(ʹÓÃPostgreSQL)ÎÒÐèҪʹÓÃʲô¼ÆËã»úÓ²¼þ £¿<br/>\r
-</p>\r
-\r
-<div><h2>²Ù×÷ÎÊÌâ</h2></div>\r
-<p>\r
-<a href="#4.1">4.1</a>)ÈçºÎֻѡÔñÒ»¸ö²éѯ½á¹ûµÄÍ·¼¸ÐУ¿»òÊÇËæ»úµÄÒ»ÐУ¿<br/>\r
-<a href="#4.2">4.2</a>)ÈçºÎ²é¿´±í¡¢Ë÷Òý¡¢Êý¾Ý¿âÒÔ¼°Óû§µÄ¶¨Ò壿ÈçºÎ²é¿´<i>psql</i>ÀïÓõ½µÄ²éѯָÁî²¢ÏÔʾËüÃÇ£¿<br/>\r
-<a href="#4.3">4.3</a>)ÈçºÎ¸ü¸ÄÒ»¸ö×ֶεÄÊý¾ÝÀàÐÍ£¿<br/>\r
-<a href="#4.4">4.4</a>)Ò»ÐмǼ£¬Ò»¸ö±í£¬Ò»¸ö¿âµÄ×î´ó³ß´çÊǶàÉÙ£¿<br/>\r
-<a href="#4.5">4.5</a>)´æ´¢Ò»¸öµäÐ͵ÄÎı¾ÎļþÀïµÄÊý¾ÝÐèÒª¶àÉÙ´ÅÅ̿ռ䣿<br/>\r
-<a href="#4.6">4.6</a>)ΪʲôÎҵIJéѯºÜÂý£¿ÎªÊ²Ã´ÕâЩ²éѯûÓÐÀûÓÃË÷Òý£¿<br/>\r
-<a href="#4.7">4.7</a>)ÎÒÈçºÎ²ÅÄÜ¿´µ½²éѯÓÅ»¯Æ÷ÊÇÔõÑùÆÀ¹À´¦ÀíÎҵIJéѯµÄ£¿<br/>\r
-<a href="#4.8">4.8</a>)ÎÒÔõÑù×öÕýÔò±í´ïʽËÑË÷ºÍ´óСдÎ޹صÄÕýÔò±í´ïʽ²éÕÒ£¿ÔõÑùÀûÓÃË÷Òý½øÐдóСдÎ޹زéÕÒ£¿<br/>\r
-<a href="#4.9">4.9</a>)ÔÚÒ»¸ö²éѯÀÎÒÔõÑù¼ì²âÒ»¸ö×Ö¶ÎÊÇ·ñΪ NULL£¿ÎÒÈçºÎ²ÅÄÜ׼ȷÅÅÐò¶ø²»ÂÛij×Ö¶ÎÊÇ·ñº¬NULLÖµ£¿<br/>\r
-<a href="#4.10">4.10</a>)¸÷ÖÖ×Ö·ûÀàÐÍÖ®¼äÓÐʲô²»Í¬£¿<br/>\r
-<a href="#4.11.1">4.11.1</a>)ÎÒÔõÑù´´½¨Ò»¸öÐòÁкÅ/×Ô¶¯µÝÔöµÄ×ֶΣ¿<br/>\r
-<a href="#4.11.2">4.11.2</a>)ÎÒÈçºÎ»ñµÃÒ»¸ö²åÈëµÄÐòÁкŵÄÖµ£¿<br/>\r
-<a href="#4.11.3">4.11.3</a>)ʹÓà currval() »áµ¼ÖºÍÆäËûÓû§µÄÎÉÂÒÇé¿ö£¨race condition£©Âð£¿<br/>\r
-<a href="#4.11.4">4.11.4</a>)Ϊʲô²»ÔÚÊÂÎñÒì³£ÖÐÖ¹ºóÖØÓÃÐòÁкÅÄØ£¿ÎªÊ²Ã´ÔÚÐòÁкÅ×ֶεÄÈ¡ÖµÖдæÔÚ¼ä¶ÏÄØ£¿<br/>\r
-<a href="#4.12">4.12</a>)ʲôÊÇ OID£¿Ê²Ã´ÊÇ CTID £¿<br/>\r
-<a href="#4.13">4.13</a>)ΪʲôÎÒÊÕµ½´íÎóÐÅÏ¢¡°<i>ERROR: Memory exhausted in AllocSetAlloc()</i>¡±£¿<br/>\r
-<a href="#4.14">4.14</a>)ÎÒÈçºÎ²ÅÄÜÖªµÀËùÔËÐÐµÄ PostgreSQL µÄ°æ±¾£¿<br/>\r
-<a href="#4.15">4.15</a>)ÎÒÈçºÎ´´½¨Ò»¸öȱʡֵÊǵ±Ç°Ê±¼äµÄ×ֶΣ¿<br/>\r
-<a href="#4.16">4.16</a>)ÈçºÎ½øÐÐ outer join £¨ÍâÁ¬½Ó£©£¿<br/>\r
-<a href="#4.17">4.17</a>)ÈçºÎʹÓÃÉæ¼°¶à¸öÊý¾Ý¿âµÄ²éѯ£¿<br/>\r
-<a href="#4.18">4.18</a>)ÈçºÎÈú¯Êý·µ»Ø¶àÐлò¶àÁУ¿<br/>\r
-<a href="#4.19">4.19</a>)ΪʲôÎÒÔÚʹÓÃPL/PgSQLº¯Êý´æÈ¡ÁÙʱ±íʱ»áÊÕµ½´íÎóÐÅÏ¢¡°relation with OID ##### does not exist¡±£¿<br/>\r
-<a href="#4.20">4.20</a>)Ä¿Ç°ÓÐÄÄЩÊý¾Ý¸´ÖÆ·½°¸¿ÉÓã¿<br/>\r
-</p>\r
-\r
-<hr/>\r
-\r
-<div><h2>³£¼ûÎÊÌâ</h2></div>\r
-\r
-<h4><a name="1.1"></a>1.1)PostgreSQL ÊÇʲô£¿¸ÃÔõô·¢Òô£¿</h4>\r
-<p>\r
-PostgreSQL ¶Á×÷ <i>Post-Gres-Q-L</i>£¬ÓÐʱºòÒ²¼ò³ÆΪ<i>Postgres</i> ¡£\r
-</p>\r
-<p>\r
- PostgreSQL ÊÇÃæÏòÄ¿±êµÄ¹ØϵÊý¾Ý¿âϵͳ£¬Ëü¾ßÓд«Í³ÉÌÒµÊý¾Ý¿âϵͳµÄËùÓй¦ÄÜ£¬Í¬Ê±ÓÖº¬Óн«ÔÚÏÂÒ»´ú DBMS ϵͳµÄʹÓõÄÔöÇ¿ÌØÐÔ¡£\r
- PostgreSQL ÊÇ×ÔÓÉÃâ·ÑµÄ£¬²¢ÇÒËùÓÐÔ´´úÂ붼¿ÉÒÔ»ñµÃ¡£\r
-</p>\r
-\r
-<p>\r
- PostgreSQL µÄ¿ª·¢¶ÓÎéÖ÷ҪΪ־ԸÕߣ¬ËûÃDZ鲼ÊÀ½ç¸÷µØ²¢Í¨¹ý»¥ÁªÍø½øÐÐÁªÏµ£¬ÕâÊÇÒ»¸öÉçÇø¿ª·¢ÏîÄ¿£¬Ëü²»±»Èκι«Ë¾¿ØÖÆ¡£\r
- ÈçÏë¼ÓÈ뿪·¢¶ÓÎ飬Çë²Î¼û¿ª·¢ÈËÔ±³£¼ûÎÊÌ⣨FAQ£©\r
- <a href="http://www.postgresql.org/files/documentation/faqs/FAQ_DEV.html">http://www.postgresql.org/files/documentation/faqs/FAQ_DEV.html</a>\r
-</p>\r
-\r
-\r
-<h4><a name="1.2"></a>1.2)PostgreSQL µÄ°æȨÊÇʲô?</h4>\r
-<p>\r
-PostgreSQLµÄ·¢²¼×ñ´Ó¾µäµÄBSD°æȨ¡£¹ØÓÚÔ´´úÂëµÄÈçºÎʹÓÃûÓÐÈκÎÏÞÖÆ£¬ÎÒÃǺÜϲ»¶ÕâÖÖ·½Ê½²¢ÇÒ»¹Ã»ÓдòËã¸Ä±äËü¡£\r
-</p>\r
-<p>\r
-ÏÂÃæ¾ÍÊÇÎÒÃÇʹÓõÄBSD°æȨÄÚÈÝ£º\r
-</p>\r
-\r
-<p>\r
- ²¿·Ö°æȨ£¨c£©1996-2005£¬PostgreSQL È«Çò¿ª·¢Ð¡×飬²¿·Ö°æȨ£¨c£©1994-1996 ¼ÓÖÝ´óѧ¶ÊÂ\r
-</p>\r
-\r
-<p>\r
- £¨Portions copyright (c) 1996-2005, PostgreSQL Global Development Group Portions Copyright (c) 1994-6 Regents of the University of California£©\r
-</p>\r
-\r
-<p>\r
- ÔÊÐíΪÈκÎÄ¿µÄʹÓ㬿½±´£¬Ð޸ĺͷַ¢Õâ¸öÈí¼þºÍËüµÄÎĵµ¶ø²»ÊÕÈ¡ÈκηÑÓã¬\r
- ²¢ÇÒÎÞÐëÇ©ÊðÒò´Ë¶ø²úÉúµÄÖ¤Ã÷£¬Ç°ÌáÊÇÉÏÃæµÄ°æȨÉùÃ÷ºÍ±¾¶ÎÒÔ¼°ÏÂÃæÁ½¶ÎÎÄ×Ö³öÏÖÔÚËùÓп½±´ÖС£\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
- ÔÚÈκÎÇé¿öÏ£¬¼ÓÖÝ´óѧ¶¼²»³Ðµ£ÒòʹÓôËÈí¼þ¼°ÆäÎĵµ¶øµ¼ÖµĶÔÈκε±ÊÂÈ˵ÄÖ±½ÓµÄ£¬\r
- ¼ä½ÓµÄ£¬ÌØÊâµÄ£¬¸½¼ÓµÄ»òÕßÏà°é¶øÉúµÄË𻵣¬°üÀ¨ÀûÒæËðʧµÄÔðÈΣ¬¼´Ê¹¼ÓÖÝ´óѧÒѾ½¨ÒéÁËÕâЩËðʧµÄ¿ÉÄÜÐÔʱҲÊÇÈç´Ë¡£\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
-\r
-<p>\r
- ¼ÓÖÝ´óѧÃ÷È··ÅÆúÈκα£Ö¤£¬°üÀ¨µ«²»¾ÖÏÞÓÚijһÌض¨ÓÃ;µÄÉÌÒµºÍÀûÒæµÄÒþº¬±£Ö¤¡£\r
- ÕâÀïÌṩµÄÕâ·ÝÈí¼þÊÇ»ùÓÚ¡°µ±×÷ÊÇ¡±µÄ»ù´¡µÄ£¬Òò¶ø¼ÓÖÝ´óѧûÓÐÔðÈÎÌṩά»¤£¬Ö§³Ö£¬¸üУ¬ÔöÇ¿»òÕßÐ޸ĵķþÎñ¡£\r
-</p>\r
-\r
-<p>\r
- £¨THE 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
-\r
-</p>\r
-\r
-<h4><a name="1.3"></a>1.3)PostgreSQL ¿ÉÒÔÔËÐÐÔÚÄÄЩ²Ù×÷ϵͳƽ̨ÉÏ£¿</h4>\r
-\r
-<p>\r
- Ò»°ã˵À´£¬Ò»¸öÏÖ´úµÄ UNIX ¼æÈݵÄƽ̨¶¼ÄÜÔËÐÐ PostgreSQL ¡£ÔÚ°²×°Ö¸ÄÏÀïÁгöÁË·¢²¼Ê±¾¹ýÃ÷È·²âÊÔµÄƽ̨¡£\r
-</p>\r
-\r
-<p>\r
- PostgreSQlÒ²¿ÉÒÔÖ±½ÓÔËÐÐÔÚ»ùÓÚ΢ÈíWindows-NTµÄ²Ù×÷ϵͳ£¬ÈçWin2000£¬WinXP ºÍ Win2003£¬ÒÑÖÆ×÷Íê³ÉµÄ°²×°°ü¿É´Ó\r
- <a href="http://pgfoundry.org/projects/pginstaller">http://pgfoundry.org/projects/pginstaller</a>ÏÂÔØ£¬»ùÓÚMSDOSµÄWindows²Ù×÷ϵͳ\r
- £¨Win95£¬Win98£¬WinMe£©ÐèҪͨ¹ýCygwinÄ£Äâ»·¾³ÔËÐÐPostgreSQL¡£\r
-</p>\r
-\r
-<p>\r
- ͬʱҲÓÐÒ»¸öΪNovell Netware 6¿ª·¢µÄ°æ±¾¿É´Ó<a href="http://forge.novell.com"> http://forge.novell.com </a>»ñÈ¡£¬ÎªOS/2¿ª·¢µÄ°æ±¾¿É´Ó\r
- <a href="http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&button=Search&key=postgreSQL&stype=all&sort=type&dir=%2F">\r
- http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&button=Search&key=postgreSQL&stype=all&sort=type&dir=%2F</a>\r
-</p>\r
-\r
-<h4><a name="1.4"></a>1.4)ÎÒ´ÓÄÄÀïÄܵõ½ PostgreSQL£¿</h4>\r
-\r
-<p>\r
- ͨ¹ýä¯ÀÀÆ÷¿É´Ó<a href="http://www.postgresql.org/ftp/">http://www.postgresql.org/ftp/</a>ÏÂÔØ£¬Ò²¿Éͨ¹ýFTP£¬´Ó\r
- <a href="ftp://ftp.PostgreSQL.org/pub/">ftp://ftp.PostgreSQL.org/pub/</a>Õ¾µãÏÂÔØ¡£\r
-</p>\r
-\r
-\r
-<h4><a name="1.5"></a>1.5)ÎÒ´ÓÄÄÀïÄܵõ½¶Ô PostgreSQL µÄÖ§³Ö£¿</h4>\r
-<p>\r
- PostgreSQLÉçÇøͨ¹ýÓʼþÁбíΪÆä´ó¶àÊýÓû§Ìṩ°ïÖú£¬¼ÓÈëÓʼþÁбíµÄÖ÷Õ¾µãÊÇ<a href="http://www.postgresql.org/community/lists/"> http://www.postgresql.org/community/lists/</a>£¬Ò»°ãÇé¿öÏ£¬ÏȼÓÈë<i>General</i> »ò <i>Bug</i>ÓʼþÁбíÊÇÒ»¸ö½ÏºÃµÄ¿ªÊ¼¡£\r
-</p>\r
-\r
-<p>\r
- Ö÷ÒªµÄIRCƵµÀÊÇÔÚFreeNode(<i>irc.freenode.net</i>)µÄ<i>#postgresql</i>£¬ÎªÁËÁ¬ÉÏ´ËƵµÀ£¬¿ÉÒÔʹÓÃUNIX³ÌÐòirc£¬ÆäÖ¸Áî¸ñʽ£º\r
- irc -c '#postgresql' "$USER" irc.freenode.net £¬»òÕßʹÓÃÆäËûIRC¿Í»§¶Ë³ÌÐò¡£ÔÚ´ËÍøÂçÖл¹´æÔÚÒ»¸öPostgreSQLµÄÎ÷°àÑÀƵµÀ(<i>#postgersql-es</i>)ºÍ·¨ÓïƵµÀ\r
- (<i>#postgresql-fr</i>)¡£Í¬ÑùµØ£¬ÔÚEFNETÉÏÒ²ÓÐÒ»¸öPostgreSQLµÄ½»Á÷ƵµÀ¡£\r
-</p>\r
-\r
-<p>\r
- ÉÌÒµÖ§³Ö¹«Ë¾µÄÁбíÔÚ<a href=" http://techdocs.postgresql.org/companies.php"> http://techdocs.postgresql.org/companies.php</a>¡£\r
-</p>\r
-\r
-\r
-\r
-<h4><a name="1.6"></a>1.6)ÎÒÈçºÎÌá½»Ò»¸öBUG±¨¸æ£¿</h4>\r
-<p>\r
- ¿É·ÃÎÊ <a href="http://www.postgresql.org/support/submitbug">http://www.postgresql.org/support/submitbug</a>£¬ÌîдBugÉϱ¨±í¸ñ¼´¿É¡£\r
-</p>\r
-\r
-<p>\r
- ͬÑùÒ²¿É·ÃÎÊftpÕ¾µã<a href="ftp://ftp.PostgreSQL.org/pub/">ftp://ftp.PostgreSQL.org/pub/</a> ¼ì²éÓÐÎÞ¸üеÄPostgreSQL°æ±¾»ò²¹¶¡¡£\r
-</p>\r
-\r
-\r
-\r
-<h4><a name="1.7"></a>1.7)×îаæµÄPostgreSQL ÊÇʲô£¿</h4>\r
-<p>\r
- PostgreSQL ×îеİ汾ÊÇ°æ±¾ 8.0.2 £¨Òë×¢£ºÏÖ×îа汾Ϊ8.0.3£©¡£\r
-</p>\r
-\r
-<p>\r
- ÎÒÃǼƻ®Ã¿Äê·¢²¼Ò»¸öÖ÷Òª°æ±¾£¬Ã¿¼¸¸öÔ·¢²¼Ò»¸öС°æ±¾¡£\r
-</p>\r
-\r
-\r
-<h4><a name="1.8"></a>1.8)Äܹ»»ñÈ¡µÄ×îÐÂÎĵµÓÐÄÄЩ£¿</h4>\r
-\r
-<p>\r
- PostgreSQL°üº¬´óÁ¿µÄÎĵµ£¬Ö÷ÒªÓÐһЩÊֲᣬÊÖ²áÒ³ºÍһЩµÄ²âÊÔÀý×Ó¡£²Î¼û /doc Ŀ¼£¨Òë×¢£ºÓ¦Îª $PGHOME/doc£©¡£\r
- Ä㻹¿ÉÒÔÔÚÏßä¯ÀÀ PostgreSQL µÄÊֲᣬÆäµØÖ·ÊÇ£º<a href="http://www.PostgreSQL.org/docs">http://www.PostgreSQL.org/docs</a>¡£\r
-</p>\r
-<p>\r
- ÓÐÁ½±¾¹ØÓÚ PostgreSQL µÄÊéÔÚÏßÌṩ£¬ÔÚ\r
- <a href="http://www.PostgreSQL.org/docs/awbook.html">http://www.PostgreSQL.org/docs/awbook.html</a>\r
- ºÍ <a href="http://www.commandprompt.com/ppbook/">http://www.commandprompt.com/ppbook/</a> ¡£\r
- Ò²ÓдóÁ¿µÄPostgreSQLÊé¼®¿É¹©¹ºÂò£¬ÆäÖÐ×îΪÁ÷ÐеÄÒ»±¾ÊÇÓÉKorry Douglas±àдµÄ¡£ÔÚ \r
- <a href="http://techdocs.PostgreSQL.org/techdocs/bookreviews.php">http://techdocs.PostgreSQL.org/techdocs/bookreviews.php</a>ÉÏ\r
- ÉÏÓдóÁ¿ÓйØPostgreSQLÊé¼®µÄ¼ò½é¡£\r
- ÔÚ <a href="http://techdocs.PostgreSQL.org/">http://techdocs.PostgreSQL.org/</a>ÉÏÊÕ¼¯ÁËÓÐ¹Ø PostgreSQL µÄ´óÁ¿¼¼ÊõÎÄÕ¡£\r
-</p>\r
-\r
-<p>\r
- ¿Í»§¶ËµÄÃüÁîÐгÌÐò<i>psql</i>ÓÐһЩÒÔ \d ¿ªÍ·µÄÃüÁ¿ÉÏÔʾ¹ØÓÚÀàÐÍ£¬²Ù×÷·û£¬º¯Êý£¬»ã×ܵȵÄÐÅÏ¢£¬Ê¹Óà \? ¿ÉÒÔÏÔʾËùÓпÉÓõÄÃüÁî¡£\r
-</p>\r
-\r
-<p>\r
- ÎÒÃÇµÄ web Õ¾µã°üº¬¸ü¶àµÄÎĵµ¡£\r
-</p>\r
-\r
-<h4><a name="1.9"></a>1.9)ÎÒÈçºÎÁ˽âÒÑÖªµÄ BUG »òÔÝȱµÄ¹¦ÄÜ£¿</h4>\r
-<p>\r
- PostgreSQL Ö§³ÖÒ»¸öÀ©Õ¹Á赀 SQL-92 µÄ×Ó¼¯¡£²ÎÔÄÎÒÃǵÄ<a href="http://www.postgresql.org/docs/faqs.TODO.html">TODO</a> ÁÐ±í£¬»ñÈ¡Ò»¸öÒÑÖªBug£¬ÔÝȱµÄ¹¦Äܺͽ«À´µÄ¼Æ»®¡£\r
-</p>\r
-\r
-\r
-<h4><a name="1.10"></a>1.10)ÎÒÓ¦¸ÃÔõÑùѧϰ SQL £¿</h4>\r
-<p>\r
- Ê×ÏÈ¿¼ÂÇÉÏÊöÌáµ½µÄÓëPostgreSQLÏà¹ØµÄÊé¼®£¬ÁíÍâÒ»±¾ÊÇ<i>Teach Yourself SQL in 21 Days, Second Edition</i>£¬\r
- ÎÒÃǵÄÐí¶àÓû§Ï²»¶<i>The Practical SQL Handbook</i> Bowman, Judith S., et al., Addison-Wesley£¬ÆäËûµÄÔòϲ»¶\r
- <i>The Complete Reference SQL</i>, Groff et al., McGraw-Hill¡£\r
-</p>\r
-\r
-\r
-<h4><a name="1.11"></a>1.11)ÎÒÓ¦¸ÃÔõÑù¼ÓÈ뿪·¢¶ÓÎ飿</h4>\r
-<p>\r
- Ïê¼û<a href="http://www.postgresql.org/docs/faqs.FAQ_DEV.html"> Developer's FAQ </a>¡£\r
-</p>\r
-\r
-\r
-<h4><a name="1.12"></a>1.12)PostgreSQL ºÍÆäËûÊý¾Ý¿âϵͳ±ÈÆðÀ´ÈçºÎ£¿</h4>\r
-<p>\r
-ÆÀ¼ÛÈí¼þÓкü¸ÖÖ·½·¨£ºÌØÐÔ£¬ÐÔÄÜ£¬¿É¿¿ÐÔ£¬Ö§³ÖºÍ¼Û¸ñ¡£\r
-</p>\r
-<dl>\r
- <dt><b>ÌØÐÔ</b></dt>\r
- <dd>\r
- PostgreSQL ÓµÓдóÐÍÉÌÓà DBMS Àï´ó¶àÊýÌØÐÔ£¬\r
- ÀýÈ磺ÊÂÎñ£¬×Ó²éѯ£¬´¥·¢Æ÷£¬ÊÓͼ£¬Íâ¼ü²Î¿¼ÍêÕûÐԺ͸´ÔÓµÄËøµÈ¡£\r
- ÎÒÃÇ»¹ÓÐһЩËüÃÇûÓеÄÌØÐÔ£¬ÈçÓû§¶¨ÒåÀàÐÍ£¬¼Ì³Ð£¬¹æÔòºÍ¶à°æ±¾²¢ÐпØÖÆÒÔ¼õÉÙËøµÄÕùÓõȡ£<br/>\r
- </dd>\r
-\r
- <dt><b>ÐÔÄÜ</b></dt>\r
- <dd>\r
- PostgreSQL ºÍÆäËûÉÌÓúͿªÔ´µÄÊý¾Ý¿â¾ßÓÐÀàËƵÄÐÔÄÜ¡£\r
- ¶ÔijЩ´¦ÀíËü±È½Ï¿ì£¬¶ÔÆäËûһЩ´¦ÀíËü±È½ÏÂý¡£\r
- ÓëÆäËûÊý¾Ý¿âÏà±È£¬ÎÒÃǵÄÐÔÄÜͨ³£ÔÚ +/- 10%Ö®¼ä¡£<br/>\r
- </dd>\r
-\r
- <dt><b>¿É¿¿ÐÔ</b></dt>\r
- <dd>\r
- ÎÒÃÇÖªµÀ DBMS ±ØÐëÊÇ¿É¿¿µÄ£¬·ñÔòËü¾ÍÒ»µãÓö¼Ã»ÓС£\r
- ÎÒÃÇŬÁ¦×öµ½·¢²¼¾¹ýÈÏÕæ²âÊԵģ¬Îȶ¨µÄ³ô³æ×îÉٵĴúÂ롣ÿ¸ö°æ±¾ÖÁÉÙÓÐÒ»¸öÔ嵀 beta\r
- ²âÊÔʱ¼ä£¬²¢ÇÒÎÒÃǵķ¢²¼ÀúÊ·ÏÔʾÎÒÃÇ¿ÉÒÔÌṩÎȶ¨µÄ£¬Àι̵ģ¬¿ÉÓÃÓÚÉú²úʹÓõİ汾¡£ÎÒÃÇÏàÐÅ\r
- ÔÚÕâ·½ÃæÎÒÃÇÓëÆäËûµÄÊý¾Ý¿âÈí¼þÊÇÏ൱µÄ¡£<br/>\r
- </dd>\r
- \r
- <dt><b>Ö§³Ö</b></dt>\r
- <dd>\r
- ÎÒÃǵÄÓʼþÁбíÌṩһ¸ö·Ç³£´óµÄ¿ª·¢ÈËÔ±ºÍÓû§µÄ×éÒÔ°ïÖú½â¾öËùÅöµ½µÄÈκÎÎÊÌâ¡£\r
- ÎÒÃDz»Äܱ£Ö¤¿Ï¶¨Äܽâ¾öÎÊÌ⣬Ïà±È֮ϣ¬ÉÌÓà DBMS Ò²²¢²»ÊÇ×ÜÄܹ»Ìṩ½â¾ö·½·¨¡£\r
- Ö±½ÓÓ뿪·¢ÈËÔ±£¬Óû§Èº£¬ÊÖ²áºÍÔ´³ÌÐò½Ó´¥Áî PostgreSQL µÄÖ§³Ö±ÈÆäËû DBMS\r
- »¹ÒªºÃ¡£»¹ÓÐһЩÉÌÒµÐÔµÄÔ¤°ü×°µÄÖ§³Ö£¬¿ÉÒÔ¸øÌṩ¸øÄÇЩÐèÒªµÄÈË¡££¨²ÎÔÄ FAQ Ìõ¿î 1.5 С½Ú£©<br/>\r
- </dd>\r
-\r
- <dt><b>¼Û¸ñ</b></dt>\r
- <dd>\r
- ÎÒÃǶÔÈκÎÓÃ;¶¼Ãâ·Ñ£¬°üÀ¨ÉÌÓúͷÇÉÌÓÃÄ¿µÄ¡£\r
- Äã¿ÉÒÔ²»¼ÓÏÞÖƵØÏòÄãµÄ²úÆ·Àï¼ÓÈëÎÒÃǵĴúÂ룬³ýÁËÄÇЩÎÒÃÇÔÚÉÏÃæµÄ°æȨÉùÃ÷ÀïÉùÃ÷µÄ BSD ·ç¸ñµÄ°æȨÍâ¡£\r
- </dd>\r
-\r
-</dl>\r
-\r
-\r
-<h4><a name="1.13"></a>1.13)Ë¿ØÖÆPostgreSQL £¿</h4>\r
-<p>\r
- Èç¹ûÄãÔÚÑ°ÕÒPostgreSQLµÄÕÆÃÅÈË£¬»òÊÇʲôÖÐÑëίԱ»á£¬»òÊÇʲôËùÊô¹«Ë¾£¬ÄãÖ»ÄÜ·ÅÆúÁË---ÒòΪһ¸öÒ²²»´æÔÚ£¬µ«ÎÒÃǵÄÈ·ÓÐÒ»¸ö\r
- ίԱ»áºÍCVS¹ÜÀí×飬µ«ÕâЩ¹¤×÷×éµÄÉèÁ¢Ö÷ÒªÊÇΪÁ˽øÐйÜÀí¹¤×÷¶ø²»ÊǶÔPostgreSQL½øÐпØÖÆ£¬PostgreSQLÏîÄ¿ÊÇÓÉÈκÎÈ˾ù\r
- ¿É²Î¼ÓµÄ¿ª·¢ÈËÔ±ÉçÇøºÍËùÓÐÓû§¿ØÖƵģ¬ÄãËùÐèÒª×öµÄ¾ÍÊǼÓÈëÓʼþÁÐ±í£¬²ÎÓëÌÖÂÛ¼´¿É£¨Òª²ÎÓëPostgreSQLµÄ¿ª·¢Ïê¼û\r
- <a href="http://www.postgresql.org/docs/faqs.FAQ_DEV.html"> Developer's FAQ </a>»ñÈ¡ÐÅÏ¢£©¡£\r
-</p>\r
-\r
-<hr/>\r
-\r
-\r
-<div> <h2>Óû§¿Í»§¶ËÎÊÌâ</h2> </div>\r
-\r
-<h4><a name="2.1"></a>2.1)ÎÒÃÇ¿ÉÒÔÓÃʲôÓïÑÔºÍ PostgreSQL ´ò½»µÀ£¿</h4>\r
-<p>\r
- PostgreSQL(ȱʡÇé¿ö)Ö»°²×°ÓÐCºÍÄÚǶʽCµÄ½Ó¿Ú£¬ÆäËûµÄ½Ó¿Ú¶¼ÊǶÀÁ¢µÄÏîÄ¿£¬Äܹ»·Ö±ðÏÂÔØ£¬ÕâЩ½Ó¿ÚÏîÄ¿¶ÀÁ¢µÄºÃ´¦\r
- ÊÇËûÃÇ¿ÉÒÔÓи÷×Եķ¢²¼¼Æ»®ºÍ¸÷×Ô¶ÀÁ¢µÄ¿ª·¢×é¡£\r
-</p>\r
-<p>\r
- һЩ±à³ÌÓïÑÔÈçPHP¶¼ÓзÃÎÊ PostgreSQL µÄ½Ó¿Ú£¬Perl,TCL,PythonÒÔ¼°ºÜ¶àÆäËûÓïÑԵĽӿÚÔÚ\r
- <a href="http://gborg.postgresql.org/"> http://gborg.postgresql.org </a>ÉϵÄ<i>Drivers/Interfaces</i>С½Ú¿ÉÕÒµ½£¬\r
- ²¢ÇÒͨ¹ýInternetºÜÈÝÒ×ËÑË÷µ½¡£\r
-</p>\r
-\r
-\r
-\r
-<h4><a name="2.2"></a>2.2)ÓÐʲô¹¤¾ß¿ÉÒÔ°Ñ PostgreSQL ÓÃÓÚ Web Ò³Ã棿</h4>\r
-<p>\r
- Ò»¸ö½éÉÜÒÔÊý¾Ý¿âΪºǫ́µÄͦ²»´íµÄÕ¾µãÊÇ£º<a href="http://www.webreview.com">http://www.webreview.com</a>¡£\r
-</p>\r
-<p>\r
- ¶ÔÓÚ Web ¼¯³É£¬PHP ÊÇÒ»¸ö¼«ºÃµÄ½Ó¿Ú¡£ËüÔÚ£º<a href="http://www.php.net/">http://www.php.net/</a>¡£\r
-</p>\r
-<p>\r
- ¶ÔÓÚ¸´ÔÓµÄÈÎÎñ£¬ºÜ¶àÈ˲ÉÓà Perl ½Ó¿ÚºÍ CGI.pm »ò mod_perl ¡£\r
-</p>\r
-\r
-\r
-<h4><a name="2.3"></a>2.3)PostgreSQL ÓµÓÐͼÐÎÓû§½çÃæÂð£¿</h4>\r
-<p>\r
- Êǵģ¬ÔÚ <a href="http://techdocs.postgresql.org/guides/GUITools">http://techdocs.postgresql.org/guides/GUITools</a>ÓÐÒ»¸öÏêϸµÄÁÐ±í¡£\r
-</p>\r
-\r
-\r
-\r
-<hr/>\r
-\r
-<div> <h2>ϵͳ¹ÜÀíÎÊÌâ</h2> </div>\r
-\r
-<h4><a name="3.1"></a>3.1)ÎÒÔõÑùÄÜ°Ñ PostgreSQL ×°ÔÚ /usr/local/pgsql ÒÔÍâµÄµØ·½£¿</h4>\r
-<p>\r
- ÔÚÔËÐÐ configure ʱ¼ÓÉÏ --prefix Ñ¡Ïî¡£\r
-</p>\r
-\r
-\r
-<h4><a name="3.2"></a>3.2)ÎÒÈçºÎ¿ØÖÆÀ´×ÔÆäËûÖ÷»úµÄÁ¬½Ó£¿</h4>\r
-<p>\r
- ȱʡʱ£¬PostgreSQL Ö»ÔÊÐíͨ¹ý unix ÓòÌ×½Ó×Ö»òTCP/IP·½Ê½ÇÒÀ´×Ô±¾»úµÄÁ¬½Ó¡£\r
- ÄãÖ»ÓÐÔÚÐÞ¸ÄÁËÅäÖÃÎļþ<i>postgresql.conf</i>ÖеÄ<i>listen_addresses</i>£¬ÇÒÒ²ÔÚÅäÖÃÎļþ<i>pg_hba.conf</i>Öдò¿ªÁË\r
- Ö÷»úΪ»ù´¡£¨ host-based £©µÄÉí·ÝÈÏÖ¤£¬²¢ÖØÐÂÆô¶¯PostgreSQL£¬·ñÔòÆäËû»úÆ÷ÊDz»ÄÜÓëÄãµÄPostgreSQL·þÎñÆ÷Á¬½ÓµÄ¡£\r
-</p>\r
-\r
-\r
-<h4><a name="3.3"></a>3.3)ÎÒÔõÑùµ÷ÕûÊý¾Ý¿âÒýÇæÒÔ»ñµÃ¸üºÃµÄÐÔÄÜ£¿</h4>\r
-<p>\r
- ÓÐÈý¸öÖ÷Òª·½Ãæ¿ÉÒÔÌáÉýPostgreSQLµÄDZÄÜ¡£\r
-</p>\r
-\r
-<dl>\r
- <dt><b>²éѯ·½Ê½µÄ±ä»¯</b></dt>\r
- <dd>\r
- ÕâÖ÷ÒªÉæ¼°Ð޸IJéѯ·½Ê½ÒÔ»ñÈ¡¸üºÃµÄÐÔÄÜ:\r
- <ul>\r
- <li>´´½¨Ë÷Òý£¬°üÀ¨±í´ïʽºÍ²¿·ÖË÷Òý£»</li>\r
- <li>ʹÓÃCOPYÓï¾ä´úÌæ¶à¸öInsertÓï¾ä£»</li>\r
- <li>½«¶à¸öSQLÓï¾ä×é³ÉÒ»¸öÊÂÎñÒÔ¼õÉÙÌá½»ÊÂÎñµÄ¿ªÏú£»</li>\r
- <li>´ÓÒ»¸öË÷ÒýÖÐÌáÈ¡¶àÌõ¼Ç¼ʱʹÓÃCLUSTER£»</li>\r
- <li>´ÓÒ»¸ö²éѯ½á¹ûÖÐÈ¡³ö²¿·Ö¼Ç¼ʱʹÓÃLIMIT£»</li>\r
- <li>ʹÓÃÔ¤±àÒëʽ²éѯ£¨Prepared Query)£»</li>\r
- <li>ʹÓÃANALYZEÒÔ±£³Ö¾«È·µÄÓÅ»¯Í³¼Æ£»</li>\r
- <li>¶¨ÆÚʹÓà VACUUM »ò <i>pg_autovacuum</i></li>\r
- <li>½øÐдóÁ¿Êý¾Ý¸ü¸ÄʱÏÈɾ³ýË÷Òý£¨È»ºóÖؽ¨Ë÷Òý£©</li>\r
- </ul>\r
- </dd>\r
-\r
- <dt><b>·þÎñÆ÷µÄÅäÖÃ</b></dt>\r
- <dd>\r
- ÅäÖÃÎļþ<i>postgres.conf</i>ÖеĺܶàÉèÖö¼»áÓ°ÏìÐÔÄÜ£¬ËùÓвÎÊýµÄÁбí¿É¼û£º\r
- <a href="http://www.postgresql.org/docs/current/static/runtime.html">Administration Guide/Server Run-time Environment/Run-time Configuration</a>£¬\r
- ÓйزÎÊýµÄ½âÊͿɼû£º<a href="http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html">\r
- http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html </a> ºÍ \r
- <a href="http://www.varlena.com/varlena/GeneralBits/Tidbits/perf.html">http://www.varlena.com/varlena/GeneralBits/Tidbits/perf.html</a>¡£\r
- </dd>\r
-\r
- <dt><b>Ó²¼þµÄÑ¡Ôñ</b></dt>\r
- <dd>\r
- ¼ÆËã»úÓ²¼þ¶ÔÐÔÄܵÄÓ°Ïì¿Éä¯ÀÀ <a href="http://candle.pha.pa.us/main/writings/pgsql/hw_performance/index.html">\r
- http://candle.pha.pa.us/main/writings/pgsql/hw_performance/index.html</a> ºÍ \r
- <a href="http://www.powerpostgresql.com/PerfList/">http://www.powerpostgresql.com/PerfList/</a>¡£\r
- </dd>\r
-\r
-</dl>\r
-\r
-\r
-<h4><a name="3.4"></a>3.4)PostgreSQL Àï¿ÉÒÔ»ñµÃʲôÑùµÄµ÷ÊÔÌØÐÔ£¿</h4>\r
-<p>\r
- PostgreSQL ÓкܶàÀàËÆ<i> log_* </i>µÄ·þÎñÆ÷ÅäÖñäÁ¿¿ÉÓÃÓÚ²éѯµÄ´òÓ¡ºÍ½ø³Ìͳ¼Æ£¬¶øÕâЩ¹¤×÷¶Ôµ÷ÊÔºÍÐÔÄܲâÊÔºÜÓаïÖú¡£\r
-</p>\r
-\r
-\r
-\r
-<h4><a name="3.5"></a>3.5)ΪʲôÔÚÊÔͼÁ¬½ÓʱÊÕµ½¡°Sorry, too many clients¡±ÏûÏ¢£¿</h4>\r
-<p>\r
- Õâ±íʾÄãÒѴﵽȱʡ100¸ö²¢·¢ºǫ́½ø³ÌÊýµÄÏÞÖÆ£¬ÄãÐèҪͨ¹ýÐÞ¸Ä<i>postgresql.conf</i>ÎļþÖеÄ<i>max_connections</i>ÖµÀ´\r
- Ôö¼ÓpostmasterµÄºǫ́²¢·¢´¦ÀíÊý£¬Ð޸ĺóÐèÖØÐÂÆô¶¯<i>postmaster</i>¡£\r
-</p>\r
-\r
-\r
-<h4><a name="3.6"></a>3.6)ΪʲôҪÔÚÉý¼¶ PostgreSQL Ö÷Òª·¢²¼°æ±¾Ê±×ö dump ºÍ restore £¿</h4>\r
-<p>\r
- PostgreSQL ¿ª·¢×é¶Ôÿ´ÎСµÄÉý¼¶½ö×öÁ˽ÏÉÙµÄÐ޸ģ¬Òò´Ë´Ó 7.4.0 Éý¼¶µ½ 7.4.1 ²»ÐèÒª dump ºÍ restore¡£\r
- µ«ÊÇÖ÷ÒªµÄÉý¼¶£¨ÀýÈç´Ó 7.3 µ½ 7.4£©Í¨³£»áÐÞ¸Äϵͳ±íºÍÊý¾Ý±íµÄÄÚ²¿¸ñʽ¡£\r
- ÕâЩ±ä»¯Ò»°ã±È½Ï¸´ÔÓ£¬Òò´ËÎÒÃDz»Î¬Êý¾ÝÎļþµÄÏòºó¼æÈÝ¡£\r
- dump ½«Êý¾Ý°´ÕÕͨÓõĸñʽÊä³ö£¬Ëæºó¿ÉÒÔ±»ÖØмÓÔز¢Ê¹ÓÃеÄÄÚ²¿¸ñʽ¡£\r
-</p>\r
-\r
-<h4><a name="3.7"></a>3.7)(ʹÓÃPostgreSQL)ÎÒÐèҪʹÓÃʲô¼ÆËã»úÓ²¼þ £¿</h4>\r
-<p>\r
- ÓÉÓÚ¼ÆËã»úÓ²¼þ´ó¶àÊýÊǼæÈݵģ¬ÈËÃÇ×ÜÊÇÇãÏòÓÚÏàÐÅËùÓмÆËã»úÓ²¼þÖÊÁ¿Ò²ÊÇÏàͬµÄ¡£ÊÂʵÉϲ»ÊÇ£¬\r
- ECC RAM£¨´øÆæżУÑéµÄÄڴ棩£¬SCSI £¨Ó²ÅÌ£©ºÍÓÅÖʵÄÖ÷°å±ÈһЩ±ãÒË»õÒª¸ü¼Ó¿É¿¿ÇÒ¾ßÓиüºÃµÄÐÔÄÜ¡£PostgreSQL¼¸ºõ¿ÉÒÔÔËÐÐÔÚÈκÎÓ²¼þÉÏ£¬\r
- µ«Èç¹û¿É¿¿ÐÔºÍÐÔÄܶÔÄãµÄϵͳºÜÖØÒª£¬Äã¾ÍÐèҪȫÃæµÄÑо¿Ò»ÏÂÄãµÄÓ²¼þÅäÖÃÁË¡£ÔÚÎÒÃǵÄÓʼþÁбíÉÏÒ²ÓйØÓÚ\r
- Ó²¼þÅäÖúÍÐԼ۱ȵÄÌÖÂÛ¡£\r
-</p>\r
-\r
-\r
-<hr/>\r
-\r
-<div><h2>²Ù×÷ÎÊÌâ</h2> </div>\r
-\r
-\r
-<h4><a name="4.1"></a>4.1)ÈçºÎֻѡÔñÒ»¸ö²éѯ½á¹ûµÄÍ·¼¸ÐУ¿»òÊÇËæ»úµÄÒ»ÐУ¿</h4>\r
-<p>\r
- Èç¹ûÄãÖ»ÊÇÒªÌáÈ¡¼¸ÐÐÊý¾Ý£¬²¢ÇÒÄãÔÚÖ´ÐвéѯÖÐÖªµÀÈ·ÇеÄÐÐÊý£¬Äã¿ÉÒÔʹÓÃLIMIT¹¦ÄÜ¡£\r
- Èç¹ûÓÐÒ»¸öË÷ÒýÓë <i> ORDER BY</i>ÖеÄÌõ¼þÆ¥Å䣬PostgreSQL ¿ÉÄܾÍÖ»´¦ÀíÒªÇóµÄÍ·¼¸Ìõ¼Ç¼£¬\r
- £¨·ñÔò½«¶ÔÕû¸ö²éѯ½øÐд¦ÀíÖ±µ½Éú³ÉÐèÒªµÄÐУ©¡£Èç¹ûÔÚÖ´Ðвéѯ¹¦ÄÜʱ²»ÖªµÀÈ·ÇеļǼÊý£¬\r
- ¿ÉʹÓÃÓαê(cursor)ºÍFETCH¹¦ÄÜ¡£\r
-</p>\r
-<p>\r
- ¿ÉʹÓÃÒÔÏ·½·¨ÌáÈ¡Ò»ÐÐËæ»ú¼Ç¼µÄ£º\r
-</p>\r
-<pre>\r
- SELECT cols\r
- FROM tab\r
- ORDER BY random()\r
- LIMIT 1 ;\r
-</pre>\r
-\r
-\r
-\r
-<h4><a name="4.2"></a>4.2)ÈçºÎ²é¿´±í¡¢Ë÷Òý¡¢Êý¾Ý¿âÒÔ¼°Óû§µÄ¶¨Ò壿ÈçºÎ²é¿´<i>psql</i>ÀïÓõ½µÄ²éѯָÁî²¢ÏÔʾËüÃÇ£¿</h4>\r
-<p>\r
- ÔÚ<i>psql</i>ÖÐʹÓà \dt ÃüÁîÀ´ÏÔʾÊý¾Ý±íµÄ¶¨Ò壬ҪÁ˽â<i>psql</i>ÖеÄÍêÕûÃüÁîÁбí¿ÉʹÓÃ\? £¬ÁíÍ⣬ÄãÒ²¿ÉÒÔÔĶÁ <i>psql</i> µÄÔ´´úÂë\r
- Îļþ<i>pgsql/src/bin/psql/describe.c</i>£¬Ëü°üÀ¨ÎªÉú³É<i>psql</i>·´Ð±¸ÜÃüÁîµÄÊä³öµÄËùÓÐ SQL ÃüÁî¡£Ä㻹¿ÉÒÔ´ø <i>-E</i> Ñ¡ÏîÆô¶¯ <i>psql</i>£¬\r
- ÕâÑùËü½«´òÓ¡³öÖ´ÐÐÄãÔÚ<i>psql</i>ÖÐËù¸ø³öµÄÃüÁîµÄÄÚ²¿Êµ¼ÊʹÓõÄSQL²éѯ¡£PostgreSQLÒ²ÌṩÁËÒ»¸ö¼æÈÝSQLµÄINFORMATION SCHEMA½Ó¿Ú£¬\r
- Äã¿ÉÒÔ´ÓÕâÀï»ñÈ¡¹ØÓÚÊý¾Ý¿âµÄÐÅÏ¢¡£\r
-</p>\r
-<p>\r
- ÔÚϵͳÖÐÓÐһЩÒÔ<i>pg_</i> ´òÍ·µÄϵͳ±íÒ²ÃèÊöÁ˱íµÄ¶¨Òå¡£\r
-</p>\r
-<p>\r
- ʹÓà <i>psql -l</i> Ö¸Áî¿ÉÒÔÁгöËùÓеÄÊý¾Ý¿â¡£\r
-</p>\r
-<p>\r
- Ò²¿ÉÒÔä¯ÀÀһϠ<i>pgsql/src/tutorial/syscat.source</i>Îļþ£¬ËüÁоÙÁ˺ܶà¿É´ÓÊý¾Ý¿âϵͳ±íÖлñÈ¡ÐÅÏ¢µÄSELECTÓï·¨¡£\r
-</p>\r
-\r
-\r
-<h4><a name="4.3"></a>4.3)ÈçºÎ¸ü¸ÄÒ»¸ö×ֶεÄÊý¾ÝÀàÐÍ£¿</h4>\r
-<p>\r
- ÔÚ8.0°æ±¾Àï¸ü¸ÄÒ»¸ö×ֶεÄÊý¾ÝÀàÐͺÜÈÝÒ×£¬¿ÉʹÓà ALTER TABLE ALTER COLUMN TYPE ¡£\r
-</p>\r
-<p>\r
- ÔÚÒÔÇ°µÄ°æ±¾ÖУ¬¿ÉÒÔÕâÑù×ö£º\r
-</p>\r
-<pre>\r
- BEGIN;\r
- ALTER TABLE tab ADD COLUMN new_col new_data_type;\r
- UPDATE tab SET new_col = CAST(old_col AS new_data_type);\r
- ALTER TABLE tab DROP COLUMN old_col;\r
- COMMIT;\r
-</pre>\r
-<p>\r
- ÄãÈ»ºó¿ÉÒÔʹÓÃ<i>VACUUM FULL tab </i>Ö¸ÁîÀ´Ê¹ÏµÍ³ÊÕ»ØÎÞЧÊý¾ÝËùÕ¼ÓõĿռ䡣\r
-</p>\r
-\r
-<h4><a name="4.4"></a>4.4)Ò»ÐмǼ£¬Ò»¸ö±í£¬Ò»¸ö¿âµÄ×î´ó³ß´çÊǶàÉÙ£¿</h4>\r
-<p>\r
- ÏÂÃæÊÇһЩÏÞÖÆ£º\r
-</p>\r
-<blockquote>\r
- <table>\r
- <tbody>\r
- <tr><td>Ò»¸öÊý¾Ý¿â×î´ó³ß´ç£¿</td><td>ÎÞÏÞÖÆ£¨ÒÑ´æÔÚÓÐ 32TB µÄÊý¾Ý¿â£©</td></tr>\r
- <tr><td>Ò»¸ö±íµÄ×î´ó³ß´ç£¿</td><td>32 TB</td></tr>\r
- <tr><td>Ò»ÐмǼµÄ×î´ó³ß´ç£¿</td><td>1.6 TB</td></tr>\r
- <tr><td>Ò»¸ö×ֶεÄ×î´ó³ß´ç?</td><td>1 GB</td></tr>\r
- <tr><td>Ò»¸ö±íÀï×î´óÐÐÊý£¿</td><td>ÎÞÏÞÖÆ</td></tr>\r
- <tr><td>Ò»¸ö±íÀï×î´óÁÐÊý£¿</td><td>250-1600 £¨ÓëÁÐÀàÐÍÓйأ©</td></tr>\r
- <tr><td>Ò»¸ö±íÀïµÄ×î´óË÷ÒýÊýÁ¿£¿</td><td>ÎÞÏÞÖÆ</td></tr>\r
- </tbody>\r
-</table>\r
-</blockquote>\r
-\r
-<p>\r
- µ±È»£¬Êµ¼ÊÉÏûÓÐÕæÕýµÄÎÞÏÞÖÆ£¬»¹ÊÇÒªÊÜ¿ÉÓôÅÅ̿ռ䡢¿ÉÓÃÄÚ´æ/½»»»ÇøµÄÖÆÔ¼¡£\r
- ÊÂʵÉÏ£¬µ±ÕâЩÊýÖµ±äµÃÒì³£µØ´óʱ£¬ÏµÍ³ÐÔÄÜÒ²»áÊܴܺóÓ°Ïì¡£\r
-</p>\r
-\r
-<p>\r
- ±íµÄ×î´ó³ß´ç 32 TB ²»ÐèÒª²Ù×÷ϵͳ¶Ô´óÎļþµÄÖ§³Ö¡£´ó±íÓöà¸ö 1 GB µÄÎļþ´æ´¢£¬Òò´ËÎļþϵͳ³ß´çµÄÏÞÖÆÊDz»ÖØÒªµÄ¡£\r
-</p>\r
-<p>\r
- Èç¹ûȱʡµÄ¿é´óСÔö³¤µ½ 32K £¬×î´óµÄ±í³ß´çºÍ×î´óÁÐÊý»¹¿ÉÒÔÔö¼Óµ½Ëı¶¡£\r
-</p>\r
-\r
-\r
-<h4><a name="4.5"></a>4.5)´æ´¢Ò»¸öµäÐ͵ÄÎı¾ÎļþÀïµÄÊý¾ÝÐèÒª¶àÉÙ´ÅÅ̿ռ䣿</h4>\r
-<p>\r
- Ò»¸ö Postgres Êý¾Ý¿â£¨´æ´¢Ò»¸öÎı¾Îļþ£©ËùÕ¼ÓõĿռä×î¶à¿ÉÄÜÐèÒªÏ൱ÓÚÕâ¸öÎı¾Îļþ×ÔÉí´óС5±¶µÄ´ÅÅ̿ռ䡣\r
-</p>\r
-<p>\r
- ÀýÈ磬¼ÙÉèÓÐÒ»¸ö 100,000 ÐеÄÎļþ£¬Ã¿ÐÐÓÐÒ»¸öÕûÊýºÍÒ»¸öÎı¾ÃèÊö¡£\r
- ¼ÙÉèÎı¾´®µÄƽ¾ù³¤¶ÈΪ20×Ö½Ú¡£Îı¾ÎļþÕ¼Óà 2.8 MB¡£´æ·ÅÕâЩÊý¾ÝµÄ PostgreSQL Êý¾Ý¿âÎļþ´óÔ¼ÊÇ 6.4 MB:\r
-</p>\r
-<pre>\r
- 32 ×Ö½Ú: ÿÐеÄÍ·£¨¹À¼ÆÖµ£©\r
- 24 ×Ö½Ú: Ò»¸öÕûÊýÐÍ×ֶκÍÒ»¸öÎı¾ÐÍ×Ö¶Î\r
- + 4 ×Ö½Ú: Ò³ÃæÄÚÖ¸ÏòÔª×éµÄÖ¸Õë\r
- ----------------------------------------\r
- 60 ×Ö½ÚÿÐÐ\r
-\r
- PostgreSQL Êý¾ÝÒ³µÄ´óСÊÇ 8192 ×Ö½Ú (8 KB)£¬Ôò£º\r
-\r
- 8192 ×Ö½Úÿҳ\r
- ------------------- = 136 ÐÐ/Êý¾ÝÒ³£¨ÏòÏÂÈ¡Õû£©\r
- 60 ×Ö½ÚÿÐÐ\r
-\r
- 100000 Êý¾ÝÐÐ\r
- -------------------- = 735 Êý¾ÝÒ³£¨ÏòÉÏÈ¡Õû£©\r
- 128 ÐÐÿҳ\r
-\r
- 735 Êý¾ÝÒ³ * 8192 ×Ö½Ú/Ò³ = 6,021,120 ×Ö½Ú£¨6 MB£©\r
-</pre>\r
-\r
-<p>\r
- Ë÷Òý²»ÐèÒªÕâô¶àµÄ¶îÍâÏûºÄ£¬µ«Ò²È·Êµ°üÀ¨±»Ë÷ÒýµÄÊý¾Ý£¬Òò´ËËüÃÇÒ²¿ÉÄܴܺó¡£\r
-</p>\r
-<p>\r
- ¿ÕÖµ<i>NULL</i>´æ·ÅÔÚλͼÖУ¬Òò´ËÕ¼ÓúÜÉٵĿռ䡣\r
-</p>\r
-\r
-<h4><a name="4.6"></a>4.6)ΪʲôÎҵIJéѯºÜÂý£¿ÎªÊ²Ã´ÕâЩ²éѯûÓÐÀûÓÃË÷Òý£¿</h4>\r
-<p>\r
- ²¢·Çÿ¸ö²éѯ¶¼»á×Ô¶¯Ê¹ÓÃË÷Òý¡£Ö»ÓÐÔÚ±íµÄ´óС³¬¹ýÒ»¸ö×îСֵ£¬²¢ÇÒ²éѯֻ»áÑ¡ÖбíÖнÏС±ÈÀýµÄ¼Ç¼ʱ²Å»á²ÉÓÃË÷Òý¡£\r
- ÕâÊÇÒòΪË÷ÒýɨÃèÒýÆðµÄËæ¼´´ÅÅÌ´æÈ¡¿ÉÄܱÈÖ±½ÓµØ¶ÁÈ¡±í£¨Ë³ÐòɨÃ裩¸üÂý¡£\r
-</p>\r
-<p>\r
- ΪÁËÅжÏÊÇ·ñʹÓÃË÷Òý£¬PostgreSQL±ØÐë»ñµÃÓйرíµÄͳ¼ÆÖµ¡£ÕâЩͳ¼ÆÖµ¿ÉÒÔʹÓà VACUUM ANALYZE£¬»ò ANALYZE »ñµÃ¡£\r
- ʹÓÃͳ¼ÆÖµ£¬ÓÅ»¯Æ÷ÖªµÀ±íÖÐÓжàÉÙÐУ¬¾ÍÄܹ»¸üºÃµØÅжÏÊÇ·ñÀûÓÃË÷Òý¡£\r
- ͳ¼ÆÖµ¶ÔÈ·¶¨ÓÅ»¯µÄÁ¬½Ó˳ÐòºÍÁ¬½Ó·½·¨Ò²ºÜÓÐÓá£ÔÚ±íµÄÄÚÈÝ·¢Éú±ä»¯Ê±£¬Ó¦¶¨ÆÚ½øÐÐͳ¼ÆÖµµÄ¸üÐÂÊÕ¼¯¡£\r
-</p>\r
-<p>\r
- Ë÷Òýͨ³£²»ÓÃÓÚ ORDER BY »òÖ´ÐÐÁ¬½Ó¡£¶ÔÒ»¸ö´ó±íµÄÒ»´Î˳ÐòɨÃ裬ÔÙ×öÒ»¸öÏÔʽµÄÅÅÐòͨ³£±ÈË÷ÒýɨÃèÒª¿ì¡£\r
-</p>\r
-\r
-<p>\r
- µ«ÊÇ£¬ÔÚ LIMIT ºÍ ORDER BY ½áºÏʹÓÃʱ¾³£»áʹÓÃË÷Òý£¬ÒòΪÕâÖ»»á·µ»Ø±íµÄһС²¿·Ö¡£\r
- ʵ¼ÊÉÏ£¬ËäÈ» MAX() ºÍ MIN() ²¢²»Ê¹ÓÃË÷Òý£¬Í¨¹ý¶Ô\r
- ORDER BY ºÍ LLIMIT ʹÓÃË÷ÒýÈ¡µÃ×î´óÖµºÍ×îСֵҲÊÇ¿ÉÒԵģº\r
-</p>\r
-<pre>\r
- SELECT col\r
- FROM tab\r
- ORDER BY col [ DESC ]\r
- LIMIT 1;\r
-</pre>\r
-<p>\r
- Èç¹ûÄãÈ·ÐÅPostgreSQLµÄÓÅ»¯Æ÷ʹÓÃ˳ÐòɨÃèÊDz»ÕýÈ·µÄ£¬Äã¿ÉÒÔʹÓÃ<code>SET enable_seqscan TO 'off'</code>Ö¸Á\r
- È»ºóÔÙ´ÎÔËÐвéѯ£¬Äã¾Í¿ÉÒÔ¿´³öʹÓÃÒ»¸öË÷ÒýɨÃèÊÇ·ñȷʵҪ¿ìһЩ¡£\r
-</p>\r
-\r
-<p>\r
- µ±Ê¹ÓÃͨÅä·û²Ù×÷£¬ÀýÈç <i>LIKE</i> »ò <i>~</i> ʱ£¬Ë÷ÒýÖ»ÄÜÔÚÌض¨µÄÇé¿öÏÂʹÓãº\r
-</p>\r
-<ul>\r
- <li>×Ö·û´®µÄ¿ªÊ¼²¿·Ö±ØÐëÊÇÆÕͨ×Ö·û´®£¬Ò²¾ÍÊÇ˵£º\r
- <ul>\r
- <li> <i>LIKE</i> ģʽ²»ÄÜÒÔ <i>%</i> ´òÍ·¡£</li>\r
- <li> <i>~</i> £¨ÕýÔò±í´ïʽ£©Ä£Ê½±ØÐëÒÔ <i>^</i> ´òÍ·¡£</li>\r
- </ul>\r
- </li>\r
- <li>×Ö·û´®²»ÄÜÒÔÆ¥Åä¶à¸ö×Ö·ûµÄģʽÀà´òÍ·£¬ÀýÈç [a-e]¡£</li>\r
- <li>´óСдÎ޹صIJéÕÒ£¬Èç ILIKE ºÍ ~* µÈ²»Ê¹ÓÃË÷Òý£¬µ«¿ÉÒÔÓà <a href="#4.8">4.8</a> ½ÚÃèÊöµÄº¯ÊýË÷Òý¡£</li>\r
- <li>ÔÚ×ö initdb ʱ±ØÐë²ÉÓÃȱʡµÄ±¾µØÉèÖà C locale£¬ÒòΪϵͳ²»¿ÉÄÜÖªµÀÔÚ·ÇC localeÇé¿öʱÏÂÒ»¸ö×î´ó×Ö·ûÊÇʲô¡£\r
- ÔÚÕâÖÖÇé¿öÏ£¬Äã¿ÉÒÔ´´½¨Ò»¸öÌØÊâµÄ<code>text_pattern_ops</code>Ë÷ÒýÀ´ÓÃÓÚ<small>LIKE</small>µÄË÷Òý¡£\r
- </li>\r
-</ul>\r
-<p>\r
- ÔÚ8.0֮ǰµÄ°æ±¾ÖУ¬³ý·ÇÒª²éѯµÄÊý¾ÝÀàÐͺÍË÷ÒýµÄÊý¾ÝÀàÐÍÏàÆ¥Å䣬·ñÔòË÷Òý¾³£ÊÇδ±»Óõ½£¬ÌرðÊǶÔint2,int8ºÍÊýÖµÐ͵ÄË÷Òý¡£\r
-</p>\r
-\r
-<h4><a name="4.7"></a>4.7)ÎÒÈçºÎ²ÅÄÜ¿´µ½²éѯÓÅ»¯Æ÷ÊÇÔõÑùÆÀ¹À´¦ÀíÎҵIJéѯ£¿</h4>\r
-<p>\r
- ²Î¿¼ <small>EXPLAIN</small> ÊÖ²áÒ³¡£\r
-</p>\r
-\r
-<h4><a name="4.8"></a>4.8)ÎÒÔõÑù×öÕýÔò±í´ïʽËÑË÷ºÍ´óСдÎ޹صÄÕýÔò±í´ïʽ²éÕÒ£¿ÔõÑùÀûÓÃË÷Òý½øÐдóСдÎ޹زéÕÒ£¿</h4>\r
-<p>\r
- ²Ù×÷·û <i> ~ </i> ´¦ÀíÕýÔò±í´ïʽƥÅ䣬¶ø <i>~*</i> ´¦Àí´óСдÎ޹صÄÕýÔò±í´ïʽƥÅä¡£´óдЩÎÞ¹ØµÄ LIKE ±äÖÖ³ÉΪ ILIKE¡£\r
-</p>\r
-<p>\r
- ´óСдÎ޹صĵÈʽ±È½Ïͨ³£Ð´×ö£º\r
-</p>\r
-<pre> SELECT *\r
- FROM tab\r
- WHERE lower(col) = 'abc';\r
-</pre>\r
-<p>\r
- ÕâÑù½«²»»áʹÓñê×¼µÄË÷Òý¡£µ«ÊÇ¿ÉÒÔ´´½¨Ò»¸ö¿É±»ÀûÓõĺ¯ÊýË÷Òý:\r
-</p>\r
-<pre> CREATE INDEX tabindex ON tab (lower(col));\r
-</pre>\r
-\r
-<h4><a name="4.9"></a>4.9)ÔÚÒ»¸ö²éѯÀÎÒÔõÑù¼ì²âÒ»¸ö×Ö¶ÎÊÇ·ñΪ <i>NULL</i> £¿ÎÒÈçºÎ²ÅÄÜ׼ȷÅÅÐò¶ø²»ÂÛij×Ö¶ÎÊÇ·ñº¬ <i>NULL</i> Öµ£¿</h4>\r
-<p>\r
- Óà <small>IS NULL</small> ºÍ <small>IS NOT NULL</small> ²âÊÔÕâ¸ö×ֶΣ¬¾ßÌå·½·¨ÈçÏ£º\r
-</p>\r
-<pre> SELECT *\r
- FROM tab\r
- WHERE col IS NULL;\r
-</pre>\r
-\r
-<p>ΪÁËÄܶԺ¬ <small>NULL</small>×Ö¶ÎÅÅÐò£¬¿ÉÔÚ <small>ORDER BY</small> Ìõ¼þÖÐʹÓà <small>IS NULL</small>ºÍ\r
- <small>IS NOT NULL</small> ÐÞÊηû£¬Ìõ¼þΪÕæ <i>true</i> ½«±ÈÌõ¼þΪ¼Ù<i>false</i> ÅÅÔÚÇ°Ã棬ÏÂÃæµÄÀý×ӾͻὫº¬\r
- NULL µÄ¼Ç¼ÅÅÔÚ½á¹ûµÄÉÏÃ沿·Ö£º\r
-</p>\r
-<pre> SELECT *\r
- FROM tab\r
- ORDER BY (col IS NOT NULL)\r
-</pre>\r
-\r
-<h4><a name="4.10"></a>4.10)¸÷ÖÖ×Ö·ûÀàÐÍÖ®¼äÓÐʲô²»Í¬£¿</h4>\r
-<blockquote>\r
- <table>\r
- <tbody>\r
- <tr><th>ÀàÐÍ</th><th>ÄÚ²¿Ãû³Æ</th><th>˵Ã÷</th></tr>\r
- <tr><td>VARCHAR(n)</td><td>varchar</td><td>Ö¸¶¨ÁË×î´ó³¤¶È£¬±ä³¤×Ö·û´®£¬²»×㶨Ò峤¶ÈµÄ²¿·Ö²»²¹Æë</td></tr>\r
- <tr><td>CHAR(n)</td><td>bpchar</td><td>¶¨³¤×Ö·û´®£¬Êµ¼ÊÊý¾Ý²»×㶨Ò峤¶Èʱ£¬ÒÔ¿Õ¸ñ²¹Æë</td></tr>\r
- <tr><td>TEXT</td><td>text</td><td>ûÓÐÌرðµÄÉÏÏÞÏÞÖÆ£¨½öÊÜÐеÄ×î´ó³¤¶ÈÏÞÖÆ£©</td></tr>\r
- <tr><td>BYTEA</td><td>bytea</td><td>±ä³¤×Ö½ÚÐòÁУ¨Ê¹ÓÃNULLÒ²ÊÇÔÊÐíµÄ£©</td></tr>\r
- <tr><td>"char"</td><td>char</td><td>Ò»¸ö×Ö·û</td></tr>\r
- </tbody>\r
- </table>\r
-</blockquote>\r
-\r
-<p>\r
- ÔÚϵͳ±íºÍÔÚһЩ´íÎóÐÅÏ¢ÀïÄ㽫¿´µ½ÄÚ²¿Ãû³Æ¡£\r
-</p>\r
-<p>\r
- ÉÏÃæËùÁеÄÇ°ËÄÖÖÀàÐÍÊÇ"varlena"£¨±ä³¤£©ÀàÐÍ£¨Ò²¾ÍÊÇ˵£¬¿ªÍ·µÄËĸö×Ö½ÚÊdz¤¶È£¬ºóÃæ²ÅÊÇÊý¾Ý£©¡£\r
- ÓÚÊÇʵ¼ÊÕ¼ÓõĿռä±ÈÉùÃ÷µÄ´óСҪ¶àһЩ¡£\r
- È»¶øÕâЩÀàÐͶ¼¿ÉÒÔ±»Ñ¹Ëõ´æ´¢£¬Ò²¿ÉÒÔÓà TOAST ÍÑ»ú´æ´¢£¬Òò´Ë´ÅÅÌ¿Õ¼äÒ²¿ÉÄܱÈÔ¤ÏëµÄÒªÉÙ¡£\r
-</p>\r
-<p>\r
- <small>VARCHAR(n)</small> ÔÚ´æ´¢ÏÞÖÆÁË×î´ó³¤¶ÈµÄ±ä³¤×Ö·û´®ÊÇ×îºÃµÄ¡£\r
- <small>TEXT</small> ÊÊÓÃÓÚ´æ´¢×î´ó¿É´ï 1G×óÓÒµ«Î´¶¨ÒåÏÞÖƳ¤¶ÈµÄ×Ö·û´®¡£\r
-</p>\r
-<p>\r
- <small>CHAR(n)</small> ×îÊʺÏÓÚ´æ´¢³¤¶ÈÏàͬµÄ×Ö·û´®¡£ <small>CHAR(n)</small>»á¸ù¾ÝËù¸ø¶¨µÄ×ֶ㤶ÈÒÔ¿Õ¸ñ²¹×㣨²»×ãµÄ×Ö¶ÎÄÚÈÝ£©£¬\r
- ¶ø <small>VARCHAR(n)</small> Ö»´æ´¢Ëù¸ø¶¨µÄÊý¾ÝÄÚÈÝ¡£\r
- <small>BYTEA</small> ÓÃÓÚ´æ´¢¶þ½øÖÆÊý¾Ý£¬ÓÈÆäÊÇ°üº¬ NULL ×Ö½ÚµÄÖµ¡£ÕâЩÀàÐ;ßÓÐÏàËƵÄÐÔÄÜÌØÐÔ¡£\r
-</p>\r
-\r
-\r
-\r
-<h4><a name="4.11.1"></a>4.11.1)ÎÒÔõÑù´´½¨Ò»¸öÐòÁкÅ/×Ô¶¯µÝÔöµÄ×ֶΣ¿</h4>\r
-<p>\r
- PostgreSQL Ö§³Ö SERIAL Êý¾ÝÀàÐÍ¡£ËüÔÚ×Ö¶ÎÉÏ×Ô¶¯´´½¨Ò»¸öÐòÁкÍË÷Òý¡£ÀýÈ磺\r
-</p>\r
-<pre>\r
- CREATE TABLE person ( \r
- id SERIAL, \r
- name TEXT \r
- );\r
-</pre>\r
-<p>\r
- »á×Ô¶¯×ª»»Îª£º\r
-</p>\r
-<pre>\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
-</pre>\r
-<p>\r
- ²Î¿¼ create_sequence ÊÖ²áÒ³»ñÈ¡¹ØÓÚÐòÁеĸü¶àÐÅÏ¢¡£\r
-</p>\r
-\r
-\r
-<h4><a name="4.11.2"></a>4.11.2)ÎÒÈçºÎ»ñµÃÒ»¸ö²åÈëµÄÐòÁкŵÄÖµ£¿</h4>\r
-<p>\r
- Ò»ÖÖ·½·¨ÊÇÔÚ²åÈë֮ǰÏÈÓú¯Êý nextval() ´ÓÐòÁжÔÏóÀï¼ìË÷³öÏÂÒ»¸ö SERIAL Öµ£¬È»ºóÔÙÏÔʽ²åÈ롣ʹÓÃ\r
- <a href="#4.11.1"> 4.11.1</a> ÀïµÄÀý±í£¬¿ÉÓÃαÂëÕâÑùÃèÊö£º\r
-</p>\r
-<pre>\r
- new_id = execute("SELECT nextval('person_id_seq')");\r
- execute("INSERT INTO person (id, name) VALUES (new_id, 'Blaise Pascal')");\r
-</pre>\r
-<p>\r
- ÕâÑù»¹ÄÜÔÚÆäËû²éѯÖÐʹÓôæ·ÅÔÚ new_id ÀïµÄÐÂÖµ£¨ÀýÈ磬×÷Ϊ person ±íµÄÍâ¼ü£©¡£\r
- ×¢Òâ×Ô¶¯´´½¨µÄ SEQUENCE ¶ÔÏóµÄÃû³Æ½«»áÊÇ <<i>table</i>>_<<i>serialcolumn</i>>_<i>seq</i>£¬\r
- ÕâÀï table ºÍ serialcolumn ·Ö±ðÊÇÄãµÄ±íµÄÃû³ÆºÍÄãµÄ SERIAL ×ֶεÄÃû³Æ¡£\r
-</p>\r
-<p>\r
- ÀàËƵģ¬ÔÚ SERIAL ¶ÔÏóȱʡ²åÈëºóÄã¿ÉÒÔÓú¯Êý currval() ¼ìË÷¸Õ¸³ÖµµÄ SERIAL Öµ£¬ÀýÈ磺\r
-</p>\r
-<pre>\r
- execute("INSERT INTO person (name) VALUES ('Blaise Pascal')");\r
- new_id = execute("SELECT currval('person_id_seq')");\r
-</pre>\r
-\r
-<h4><a name="4.11.3"></a>4.11.3)ʹÓà <i>currval()</i> »áµ¼ÖºÍÆäËûÓû§µÄ³åÍ»Çé¿ö£¨race condition£©Âð£¿</h4>\r
-<p>\r
- ²»»á¡£<i>currval()</i> ·µ»ØµÄÊÇÄã±¾´Î»á»°½ø³ÌËù¸³µÄÖµ¶ø²»ÊÇËùÓÐÓû§µÄµ±Ç°Öµ¡£<br/>\r
-</p>\r
-\r
-<h4><a name="4.11.4"></a>4.11.4)Ϊʲô²»ÔÚÊÂÎñÒì³£ÖÐÖ¹ºóÖØÓÃÐòÁкÅÄØ£¿ÎªÊ²Ã´ÔÚÐòÁкÅ×ֶεÄÈ¡ÖµÖдæÔÚ¼ä¶ÏÄØ£¿</h4>\r
-<p>\r
- ΪÁËÌá¸ß²¢·¢ÐÔ£¬ÐòÁкÅÔÚÐèÒªµÄʱºò¸³ÓèÕýÔÚÔËÐеÄÊÂÎñ£¬²¢ÇÒÔÚÊÂÎñ½áÊø֮ǰ²»½øÐÐËø¶¨£¬\r
- Õâ¾Í»áµ¼ÖÂÒì³£ÖÐÖ¹µÄÊÂÎñºó£¬ÐòÁкŻá³öÏÖ¼ä¸ô¡£\r
-</p>\r
-\r
-<h4><br/><a name="4.12"></a>4.12)ʲôÊÇ <small>OID</small> £¿Ê²Ã´ÊÇ <small>CTID</small> £¿</h4>\r
-<p>\r
- PostgreSQL Àï´´½¨µÄÿһÐмǼ¶¼»á»ñµÃÒ»¸öΨһµÄ<small>OID</small>£¬³ý·ÇÔÚ´´½¨±íʱʹÓÃ<small>WITHOUT OIDS</small>Ñ¡Ïî¡£\r
- <small>OID</small>´´½¨Ê±»á×Ô¶¯Éú³ÉÒ»¸ö4×Ö½ÚµÄÕûÊý£¬ËùÓÐ OID ÔÚÕû¸ö PostgreSQL ÖоùÊÇΨһµÄ¡£ È»¶ø£¬ËüÔÚ³¬¹ý40ÒÚʱ½«Òç³ö£¬\r
- <small>OID</small>´Ëºó»á³öÏÖÖظ´¡£PostgreSQL ÔÚËüµÄÄÚ²¿ÏµÍ³±íÀïʹÓà OID ÔÚ±íÖ®¼ä½¨Á¢ÁªÏµ¡£\r
-</p>\r
-<p> \r
- ÔÚÓû§µÄÊý¾Ý±íÖУ¬×îºÃÊÇʹÓÃ<small>SERIAl</small>À´´úÌæ<small>OID</small>\r
- ÒòΪ<small>SERIAL</small>Ö»ÊDZ£Ö¤ÔÚµ¥¸ö±íÖÐÊý¾ÝÊÇΨһµÄ£¬ÕâÑùËüÒç³öµÄ¿ÉÄÜÐԾͷdz£Ð¡ÁË£¬\r
- <small>SERIAL8</small>¿ÉÓÃÀ´±£´æ8×Ö½ÚµÄÐòÁкÅ×ֶΡ£\r
-</p>\r
-\r
-<p>\r
- <small>CTID</small> ÓÃÓÚ±êʶ´ø×ÅÊý¾Ý¿é£¨µØÖ·£©ºÍ£¨¿éÄÚ£©Æ«ÒƵÄÌض¨µÄÎïÀíÐС£\r
- <small>CTID</small> ÔڼǼ±»¸ü¸Ä»òÖØÔغó·¢Éú¸Ä±ä¡£Ë÷ÒýÈë¿ÚʹÓÃËüÃÇÖ¸ÏòÎïÀíÐС£\r
-</p>\r
-\r
-\r
-<h4><a name="4.13"></a>4.13)ΪʲôÎÒÊÕµ½´íÎóÐÅÏ¢¡°<i>ERROR: Memory exhausted in AllocSetAlloc()</i>¡±£¿</h4>\r
-<p>\r
- ÕâºÜ¿ÉÄÜÊÇϵͳµÄÐéÄâÄÚ´æÓùâÁË£¬»òÕßÄں˶ÔijЩ×ÊÔ´Óнϵ͵ÄÏÞÖÆÖµ¡£ÔÚÆô¶¯ postmaster ֮ǰÊÔÊÔÏÂÃæµÄÃüÁ\r
-</p>\r
-<pre>\r
- ulimit -d 262144\r
- limit datasize 256m\r
-</pre>\r
-<p>\r
- È¡¾öÓÚÄãÓÃµÄ shell£¬ÉÏÃæÃüÁîÖ»ÓÐÒ»ÌõÄܳɹ¦£¬µ«ÊÇËü½«°ÑÄãµÄ½ø³ÌÊý¾Ý¶ÎÏÞÖÆÉèµÃ±È½Ï¸ß£¬\r
- Òò¶øÒ²ÐíÄÜÈòéѯÍê³É¡£ÕâÌõÃüÁîÓ¦ÓÃÓÚµ±Ç°½ø³Ì£¬ÒÔ¼°ËùÓÐÔÚÕâÌõÃüÁîÔËÐк󴴽¨µÄ×Ó½ø³Ì¡£\r
- Èç¹ûÄãÊÇÔÚÔËÐÐSQL¿Í»§¶ËʱÒòΪºǫ́·µ»ØÁËÌ«¶àµÄÊý¾Ý¶ø³öÏÖÎÊÌ⣬ÇëÔÚÔËÐпͻ§¶Ë֮ǰִÐÐÉÏÊöÃüÁî¡£\r
-</p>\r
-\r
-<h4><a name="4.14"></a>4.14)ÎÒÈçºÎ²ÅÄÜÖªµÀËùÔËÐÐµÄ PostgreSQL µÄ°æ±¾£¿</h4>\r
-<p>\r
- ´Ó psql ÀÊäÈë <code>SELECT version();</code>Ö¸Áî¡£\r
-</p>\r
-\r
-<h4><a name="4.15"></a>4.15)ÎÒÈçºÎ´´½¨Ò»¸öȱʡֵÊǵ±Ç°Ê±¼äµÄ×ֶΣ¿</h4>\r
-<p>\r
- ʹÓà CURRENT_TIMESTAMP£º\r
-</p>\r
-<pre>\r
- CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );\r
-</pre>\r
-\r
-\r
-<h4><a name="4.16"></a>4.16)ÎÒÔõÑù½øÐÐ outer join £¨ÍâÁ¬½Ó£©£¿</h4>\r
-<p>\r
- PostgreSQL ²ÉÓñê×¼µÄ SQL Óï·¨Ö§³ÖÍâÁ¬½Ó¡£ÕâÀïÊÇÁ½¸öÀý×Ó£º\r
-</p>\r
-<pre>\r
- SELECT *\r
- FROM t1 LEFT OUTER JOIN t2 ON (t1.col = t2.col);\r
-</pre>\r
-<p>»òÊÇ</p>\r
-<pre>\r
- SELECT *\r
- FROM t1 LEFT OUTER JOIN t2 USING (col);\r
-</pre>\r
-<p>\r
- ÕâÁ½¸öµÈ¼ÛµÄ²éѯÔÚ t1.col ºÍ t2.col ÉÏ×öÁ¬½Ó£¬²¢ÇÒ·µ»Ø t1 ÖÐËùÓÐδÁ¬½ÓµÄÐУ¨ÄÇЩÔÚ t2 ÖÐûÓÐÆ¥ÅäµÄÐУ©¡£\r
- ÓÒ[Íâ]Á¬½Ó(RIGHT OUTER JOIN)½«·µ»Ø t2 ÖÐδÁ¬½ÓµÄÐС£\r
- ÍêÈ«ÍâÁ¬½Ó£¨FULL OUTER JOIN£©½«·µ»Ø t1 ºÍ t2 ÖÐδÁ¬½ÓµÄÐС£\r
- ¹Ø¼ü×Ö OUTER ÔÚ×ó[Íâ]Á¬½Ó¡¢ÓÒ[Íâ]Á¬½ÓºÍÍêÈ«[Íâ]Á¬½ÓÖÐÊÇ¿ÉÑ¡µÄ£¬ÆÕͨÁ¬½Ó±»³ÆΪÄÚÁ¬½Ó£¨INNER JOIN£©¡£\r
-</p>\r
-\r
-\r
-<h4><a name="4.17"></a>4.17)ÈçºÎʹÓÃÉæ¼°¶à¸öÊý¾Ý¿âµÄ²éѯ£¿</h4>\r
-<p>\r
- ûÓа취²éѯµ±Ç°Êý¾Ý¿âÖ®ÍâµÄÊý¾Ý¿â¡£\r
- ÒòΪ PostgreSQL Òª¼ÓÔØÓëÊý¾Ý¿âÏà¹ØµÄϵͳĿ¼£¨ÏµÍ³±í£©£¬Òò´Ë¿çÊý¾Ý¿âµÄ²éѯÈçºÎÖ´ÐÐÊDz»¶¨µÄ¡£\r
-</p>\r
-<p>\r
- ¸½¼ÓÔöֵģ¿écontrib/dblinkÔÊÐí²ÉÓú¯Êýµ÷ÓÃʵÏÖ¿ç¿â²éѯ¡£µ±È»Óû§Ò²¿ÉÒÔͬʱÁ¬½Óµ½²»Í¬µÄÊý¾Ý¿âÖ´ÐвéѯȻºóÔÚ¿Í»§¶ËºÏ²¢½á¹û¡£\r
-</p>\r
-\r
-<h4><a name="4.18"></a>4.18)ÈçºÎÈú¯Êý·µ»Ø¶àÐлò¶àÁУ¿</h4>\r
-<p>\r
- ÔÚº¯ÊýÖзµ»ØÊý¾Ý¼Ç¼¼¯µÄ¹¦ÄÜÊǺÜÈÝÒ×ʹÓõģ¬ÏêÇé²Î¼û£º\r
- <a href="http://techdocs.postgresql.org/guides/SetReturningFunctions">http://techdocs.postgresql.org/guides/SetReturningFunctions</a>\r
-</p>\r
-\r
-<h4><a name="4.19"></a>4.19)ΪʲôÎÒÔÚʹÓÃPL/PgSQLº¯Êý´æÈ¡ÁÙʱ±íʱ»áÊÕµ½´íÎóÐÅÏ¢¡°relation with OID ##### does not exist¡±£¿</h4>\r
-<p>\r
- PL/PgSQL»á»º´æº¯ÊýµÄÄÚÈÝ£¬ÓÉ´Ë´øÀ´µÄÒ»¸ö²»ºÃµÄ¸±×÷ÓÃÊÇÈôÒ»¸ö PL/PgSQL\r
- º¯Êý·ÃÎÊÁËÒ»¸öÁÙʱ±í£¬È»ºó¸Ã±í±»É¾³ý²¢Öؽ¨ÁË£¬ÔòÔٴε÷Óøú¯Êý½«Ê§°Ü£¬\r
- ÒòΪ»º´æµÄº¯ÊýÄÚÈÝÈÔȻָÏò¾ÉµÄÁÙʱ±í¡£½â¾öµÄ·½·¨ÊÇÔÚ PL/PgSQL ÖÐÓÃ<small>EXECUTE</small>\r
- ¶ÔÁÙʱ±í½øÐзÃÎÊ¡£ÕâÑù»á±£Ö¤²éѯÔÚÖ´ÐÐÇ°×ܻᱻÖØнâÎö¡£\r
-</p>\r
-\r
-<h4><a name="4.27"></a>4.27)Ä¿Ç°ÓÐÄÄЩÊý¾Ý¸´ÖÆ·½°¸¿ÉÓã¿</h4>\r
-<p>\r
- ¡°¸´ÖÆ¡±Ö»ÊÇÒ»¸öÊõÓÓкü¸ÖÖ¸´ÖƼ¼Êõ¿ÉʹÓã¬Ã¿ÖÖ¶¼ÓÐÓŵãºÍȱµã£º\r
-</p>\r
-<p>\r
- Ö÷/´Ó¸´ÖÆ·½Ê½ÊÇÔÊÐíÒ»¸öÖ÷·þÎñÆ÷½ÓÊܶÁ/дµÄÉêÇ룬¶ø¶à¸ö´Ó·þÎñÆ÷Ö»ÄܽÓÊܶÁ/<small>SELECT</small>²éѯµÄÉêÇ룬\r
- Ä¿Ç°×îÁ÷ÐÐÇÒÊÇÃâ·ÑµÄÖ÷/´Ó PostgreSQL¸´ÖÆ·½°¸ÊÇ \r
- <a href="http://gborg.postgresql.org/project/slony1/projdisplay.php">Slony-I </a>¡£\r
-</p>\r
-<p>\r
- ¶à¸öÖ÷·þÎñÆ÷µÄ¸´ÖÆ·½Ê½ÔÊÐí½«¶Á/дµÄÉêÇë·¢Ë͸ø¶ą̀µÄ¼ÆËã»ú£¬ÕâÖÖ·½Ê½ÓÉÓÚÐèÒªÔÚ¶ą̀·þÎñÆ÷Ö®¼äͬ²½Êý¾Ý±ä¶¯\r
- ¿ÉÄÜ»á´øÀ´½ÏÑÏÖصÄÐÔÄÜËðʧ£¬<a href="http://pgfoundry.org/projects/pgcluster/">Pgcluster</a>ÊÇÄ¿Ç°ÕâÖÖ·½°¸\r
- ÖÐ×îºÃµÄ£¬¶øÇÒ»¹¿ÉÒÔÃâ·ÑÏÂÔØ¡£\r
-</p>\r
-<p>\r
- Ò²ÓÐһЩÉÌÒµÐ踶·ÑºÍ»ùÓÚÓ²¼þµÄÊý¾Ý¸´ÖÆ·½°¸£¬Ö§³ÖÉÏÊö¸÷ÖÖ¸´ÖÆÄ£ÐÍ¡£\r
-</p>\r
-\r
-\r
-\r
-</body>\r
-</html>\r
-\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" dir="ltr">
+ <head>
+ <title>
+ PostgreSQL: PostgreSQL ³£¼ûÎÊÌ⣨FAQ£©
+ </title>
+ <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
+ </head>
+
+ <body>
+
+<h1>PostgreSQL ³£¼ûÎÊÌ⣨FAQ£©</h1>
+<p>
+×î½ü¸üУº2005 Äê 06 Ô 02 ÈÕ ÐÇÆÚÎå 22:27:35 CST
+</p>
+<p>
+ Ŀǰά»¤ÈËÔ±£ºBruce Momjian (<a href="mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</a>)<br/>
+ ÖÐÎÄ°æά»¤ÈËÔ±£ºdoudou586 £¨doudou586_2005@yahoo.com.cn£©
+</p>
+<p>
+ ±¾ÎĵµµÄ×îа汾¿ÉÒÔÔÚ
+ <a href="http://www.postgresql.org/files/documentation/faqs/FAQ.html">http://www.postgresql.org/files/documentation/faqs/FAQ.html</a>²é¿´¡£
+</p>
+<p>
+ Óë²Ù×÷ϵͳƽ̨Ïà¹ØµÄÎÊÌâÔÚ<a href="http://www.postgresql.org/docs/faq/">http://www.postgresql.org/docs/faq/</a>Àï»Ø´ð¡£<br/>
+</p>
+<hr/>
+
+<div><h2>³£¼ûÎÊÌâ</h2></div>
+
+<p>
+<a href="#1.1">1.1</a>)PostgreSQL ÊÇʲô£¿¸ÃÔõô·¢Òô£¿<br/>
+<a href="#1.2">1.2</a>)PostgreSQL µÄ°æȨÊÇʲô£¿<br/>
+<a href="#1.3">1.3</a>)PostgreSQL ¿ÉÒÔÔËÐÐÔÚÄÄЩ²Ù×÷ϵͳƽ̨ÉÏ£¿<br/>
+<a href="#1.4">1.4</a>)ÎÒ´ÓÄÄÀïÄܵõ½ PostgreSQL£¿<br/>
+<a href="#1.5">1.5</a>)ÎÒ´ÓÄÄÀïÄܵõ½¶Ô PostgreSQL µÄÖ§³Ö£¿<br/>
+<a href="#1.6">1.6</a>)ÎÒÈçºÎÌá½»Ò»¸öBUG±¨¸æ£¿<br/>
+<a href="#1.7">1.7</a>)×îаæµÄPostgreSQL ÊÇʲô£¿<br/>
+<a href="#1.8">1.8</a>)Äܹ»»ñÈ¡µÄ×îÐÂÎĵµÓÐÄÄЩ£¿<br/>
+<a href="#1.9">1.9</a>)ÎÒÈçºÎÁ˽âÒÑÖªµÄ BUG »òÔÝȱµÄ¹¦ÄÜ£¿<br/>
+<a href="#1.10">1.10</a>)ÎÒÓ¦¸ÃÔõÑùѧϰ SQL £¿<br/>
+<a href="#1.11">1.11</a>)ÎÒÓ¦¸ÃÔõÑù¼ÓÈ뿪·¢¶ÓÎ飿<br/>
+<a href="#1.12">1.12</a>)PostgreSQL ºÍÆäËûÊý¾Ý¿âϵͳ±ÈÆðÀ´ÈçºÎ£¿<br/>
+<a href="#1.13">1.13</a>)Ë¿ØÖƺ͹ÜÀíPostgreSQL £¿
+</p>
+
+<div><h2>Óû§¿Í»§¶ËÎÊÌâ</h2></div>
+<p>
+<a href="#2.1">2.1</a>)ÎÒÃÇ¿ÉÒÔÓÃʲôÓïÑÔºÍ PostgreSQL ´ò½»µÀ£¿<br/>
+<a href="#2.2">2.2</a>)ÓÐʲô¹¤¾ß¿ÉÒÔ°Ñ PostgreSQL ÓÃÓÚ Web Ò³Ã棿<br/>
+<a href="#2.3">2.3</a>)PostgreSQL ÓµÓÐͼÐÎÓû§½çÃæÂð£¿<br/>
+</p>
+
+<div><h2>ϵͳ¹ÜÀíÎÊÌâ</h2></div>
+<p>
+<a href="#3.1">3.1</a>)ÎÒÔõÑù²ÅÄÜ°Ñ PostgreSQL ×°ÔÚ /usr/local/pgsql ÒÔÍâµÄµØ·½£¿<br/>
+<a href="#3.2">3.2</a>)ÎÒÈçºÎ¿ØÖÆÀ´×ÔÆäËûÖ÷»úµÄÁ¬½Ó£¿<br/>
+<a href="#3.3">3.3</a>)ÎÒÔõÑùµ÷ÕûÊý¾Ý¿âÒýÇæÒÔ»ñµÃ¸üºÃµÄÐÔÄÜ£¿<br/>
+<a href="#3.4">3.4</a>)PostgreSQL Àï¿ÉÒÔ»ñµÃʲôÑùµÄµ÷ÊÔÌØÐÔ£¿<br/>
+<a href="#3.5">3.5</a>)ΪʲôÔÚÊÔͼÁ¬½ÓµÇ¼ʱÊÕµ½¡°Sorry, too many clients¡± ÏûÏ¢£¿<br/>
+<a href="#3.6">3.6</a>)ΪʲôҪÔÚÉý¼¶ PostgreSQL Ö÷Òª·¢²¼°æ±¾Ê±×ö dump ºÍ restore £¿<br/>
+<a href="#3.7">3.7</a>)(ʹÓÃPostgreSQL)ÎÒÐèҪʹÓÃʲô¼ÆËã»úÓ²¼þ £¿<br/>
+</p>
+
+<div><h2>²Ù×÷ÎÊÌâ</h2></div>
+<p>
+<a href="#4.1">4.1</a>)ÈçºÎֻѡÔñÒ»¸ö²éѯ½á¹ûµÄÍ·¼¸ÐУ¿»òÊÇËæ»úµÄÒ»ÐУ¿<br/>
+<a href="#4.2">4.2</a>)ÈçºÎ²é¿´±í¡¢Ë÷Òý¡¢Êý¾Ý¿âÒÔ¼°Óû§µÄ¶¨Ò壿ÈçºÎ²é¿´<i>psql</i>ÀïÓõ½µÄ²éѯָÁî²¢ÏÔʾËüÃÇ£¿<br/>
+<a href="#4.3">4.3</a>)ÈçºÎ¸ü¸ÄÒ»¸ö×ֶεÄÊý¾ÝÀàÐÍ£¿<br/>
+<a href="#4.4">4.4</a>)Ò»ÐмǼ£¬Ò»¸ö±í£¬Ò»¸ö¿âµÄ×î´ó³ß´çÊǶàÉÙ£¿<br/>
+<a href="#4.5">4.5</a>)´æ´¢Ò»¸öµäÐ͵ÄÎı¾ÎļþÀïµÄÊý¾ÝÐèÒª¶àÉÙ´ÅÅ̿ռ䣿<br/>
+<a href="#4.6">4.6</a>)ΪʲôÎҵIJéѯºÜÂý£¿ÎªÊ²Ã´ÕâЩ²éѯûÓÐÀûÓÃË÷Òý£¿<br/>
+<a href="#4.7">4.7</a>)ÎÒÈçºÎ²ÅÄÜ¿´µ½²éѯÓÅ»¯Æ÷ÊÇÔõÑùÆÀ¹À´¦ÀíÎҵIJéѯµÄ£¿<br/>
+<a href="#4.8">4.8</a>)ÎÒÔõÑù×öÕýÔò±í´ïʽËÑË÷ºÍ´óСдÎ޹صÄÕýÔò±í´ïʽ²éÕÒ£¿ÔõÑùÀûÓÃË÷Òý½øÐдóСдÎ޹زéÕÒ£¿<br/>
+<a href="#4.9">4.9</a>)ÔÚÒ»¸ö²éѯÀÎÒÔõÑù¼ì²âÒ»¸ö×Ö¶ÎÊÇ·ñΪ NULL£¿ÎÒÈçºÎ²ÅÄÜ׼ȷÅÅÐò¶ø²»ÂÛij×Ö¶ÎÊÇ·ñº¬NULLÖµ£¿<br/>
+<a href="#4.10">4.10</a>)¸÷ÖÖ×Ö·ûÀàÐÍÖ®¼äÓÐʲô²»Í¬£¿<br/>
+<a href="#4.11.1">4.11.1</a>)ÎÒÔõÑù´´½¨Ò»¸öÐòÁкÅ/×Ô¶¯µÝÔöµÄ×ֶΣ¿<br/>
+<a href="#4.11.2">4.11.2</a>)ÎÒÈçºÎ»ñµÃÒ»¸ö²åÈëµÄÐòÁкŵÄÖµ£¿<br/>
+<a href="#4.11.3">4.11.3</a>)ʹÓà currval() »áµ¼ÖºÍÆäËûÓû§µÄÎÉÂÒÇé¿ö£¨race condition£©Âð£¿<br/>
+<a href="#4.11.4">4.11.4</a>)Ϊʲô²»ÔÚÊÂÎñÒì³£ÖÐÖ¹ºóÖØÓÃÐòÁкÅÄØ£¿ÎªÊ²Ã´ÔÚÐòÁкÅ×ֶεÄÈ¡ÖµÖдæÔÚ¼ä¶ÏÄØ£¿<br/>
+<a href="#4.12">4.12</a>)ʲôÊÇ OID£¿Ê²Ã´ÊÇ CTID £¿<br/>
+<a href="#4.13">4.13</a>)ΪʲôÎÒÊÕµ½´íÎóÐÅÏ¢¡°<i>ERROR: Memory exhausted in AllocSetAlloc()</i>¡±£¿<br/>
+<a href="#4.14">4.14</a>)ÎÒÈçºÎ²ÅÄÜÖªµÀËùÔËÐÐµÄ PostgreSQL µÄ°æ±¾£¿<br/>
+<a href="#4.15">4.15</a>)ÎÒÈçºÎ´´½¨Ò»¸öȱʡֵÊǵ±Ç°Ê±¼äµÄ×ֶΣ¿<br/>
+<a href="#4.16">4.16</a>)ÈçºÎ½øÐÐ outer join £¨ÍâÁ¬½Ó£©£¿<br/>
+<a href="#4.17">4.17</a>)ÈçºÎʹÓÃÉæ¼°¶à¸öÊý¾Ý¿âµÄ²éѯ£¿<br/>
+<a href="#4.18">4.18</a>)ÈçºÎÈú¯Êý·µ»Ø¶àÐлò¶àÁУ¿<br/>
+<a href="#4.19">4.19</a>)ΪʲôÎÒÔÚʹÓÃPL/PgSQLº¯Êý´æÈ¡ÁÙʱ±íʱ»áÊÕµ½´íÎóÐÅÏ¢¡°relation with OID ##### does not exist¡±£¿<br/>
+<a href="#4.20">4.20</a>)Ä¿Ç°ÓÐÄÄЩÊý¾Ý¸´ÖÆ·½°¸¿ÉÓã¿<br/>
+</p>
+
+<hr/>
+
+<div><h2>³£¼ûÎÊÌâ</h2></div>
+
+<h4><a name="1.1"></a>1.1)PostgreSQL ÊÇʲô£¿¸ÃÔõô·¢Òô£¿</h4>
+<p>
+PostgreSQL ¶Á×÷ <i>Post-Gres-Q-L</i>£¬ÓÐʱºòÒ²¼ò³ÆΪ<i>Postgres</i> ¡£
+</p>
+<p>
+ PostgreSQL ÊÇÃæÏòÄ¿±êµÄ¹ØϵÊý¾Ý¿âϵͳ£¬Ëü¾ßÓд«Í³ÉÌÒµÊý¾Ý¿âϵͳµÄËùÓй¦ÄÜ£¬Í¬Ê±ÓÖº¬Óн«ÔÚÏÂÒ»´ú DBMS ϵͳµÄʹÓõÄÔöÇ¿ÌØÐÔ¡£
+ PostgreSQL ÊÇ×ÔÓÉÃâ·ÑµÄ£¬²¢ÇÒËùÓÐÔ´´úÂ붼¿ÉÒÔ»ñµÃ¡£
+</p>
+
+<p>
+ PostgreSQL µÄ¿ª·¢¶ÓÎéÖ÷ҪΪ־ԸÕߣ¬ËûÃDZ鲼ÊÀ½ç¸÷µØ²¢Í¨¹ý»¥ÁªÍø½øÐÐÁªÏµ£¬ÕâÊÇÒ»¸öÉçÇø¿ª·¢ÏîÄ¿£¬Ëü²»±»Èκι«Ë¾¿ØÖÆ¡£
+ ÈçÏë¼ÓÈ뿪·¢¶ÓÎ飬Çë²Î¼û¿ª·¢ÈËÔ±³£¼ûÎÊÌ⣨FAQ£©
+ <a href="http://www.postgresql.org/files/documentation/faqs/FAQ_DEV.html">http://www.postgresql.org/files/documentation/faqs/FAQ_DEV.html</a>
+</p>
+
+
+<h4><a name="1.2"></a>1.2)PostgreSQL µÄ°æȨÊÇʲô?</h4>
+<p>
+PostgreSQLµÄ·¢²¼×ñ´Ó¾µäµÄBSD°æȨ¡£¹ØÓÚÔ´´úÂëµÄÈçºÎʹÓÃûÓÐÈκÎÏÞÖÆ£¬ÎÒÃǺÜϲ»¶ÕâÖÖ·½Ê½²¢ÇÒ»¹Ã»ÓдòËã¸Ä±äËü¡£
+</p>
+<p>
+ÏÂÃæ¾ÍÊÇÎÒÃÇʹÓõÄBSD°æȨÄÚÈÝ£º
+</p>
+
+<p>
+ ²¿·Ö°æȨ£¨c£©1996-2005£¬PostgreSQL È«Çò¿ª·¢Ð¡×飬²¿·Ö°æȨ£¨c£©1994-1996 ¼ÓÖÝ´óѧ¶ÊÂ
+</p>
+
+<p>
+ £¨Portions copyright (c) 1996-2005, PostgreSQL Global Development Group Portions Copyright (c) 1994-6 Regents of the University of California£©
+</p>
+
+<p>
+ ÔÊÐíΪÈκÎÄ¿µÄʹÓ㬿½±´£¬Ð޸ĺͷַ¢Õâ¸öÈí¼þºÍËüµÄÎĵµ¶ø²»ÊÕÈ¡ÈκηÑÓã¬
+ ²¢ÇÒÎÞÐëÇ©ÊðÒò´Ë¶ø²úÉúµÄÖ¤Ã÷£¬Ç°ÌáÊÇÉÏÃæµÄ°æȨÉùÃ÷ºÍ±¾¶ÎÒÔ¼°ÏÂÃæÁ½¶ÎÎÄ×Ö³öÏÖÔÚËùÓп½±´ÖС£
+</p>
+
+<p>
+ £¨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.£©
+</p>
+
+<p>
+ ÔÚÈκÎÇé¿öÏ£¬¼ÓÖÝ´óѧ¶¼²»³Ðµ£ÒòʹÓôËÈí¼þ¼°ÆäÎĵµ¶øµ¼ÖµĶÔÈκε±ÊÂÈ˵ÄÖ±½ÓµÄ£¬
+ ¼ä½ÓµÄ£¬ÌØÊâµÄ£¬¸½¼ÓµÄ»òÕßÏà°é¶øÉúµÄË𻵣¬°üÀ¨ÀûÒæËðʧµÄÔðÈΣ¬¼´Ê¹¼ÓÖÝ´óѧÒѾ½¨ÒéÁËÕâЩËðʧµÄ¿ÉÄÜÐÔʱҲÊÇÈç´Ë¡£
+</p>
+
+<p>
+ £¨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.£©
+</p>
+
+<p>
+ ¼ÓÖÝ´óѧÃ÷È··ÅÆúÈκα£Ö¤£¬°üÀ¨µ«²»¾ÖÏÞÓÚijһÌض¨ÓÃ;µÄÉÌÒµºÍÀûÒæµÄÒþº¬±£Ö¤¡£
+ ÕâÀïÌṩµÄÕâ·ÝÈí¼þÊÇ»ùÓÚ¡°µ±×÷ÊÇ¡±µÄ»ù´¡µÄ£¬Òò¶ø¼ÓÖÝ´óѧûÓÐÔðÈÎÌṩά»¤£¬Ö§³Ö£¬¸üУ¬ÔöÇ¿»òÕßÐ޸ĵķþÎñ¡£
+</p>
+
+<p>
+ £¨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.£©<br/>
+
+</p>
+
+<h4><a name="1.3"></a>1.3)PostgreSQL ¿ÉÒÔÔËÐÐÔÚÄÄЩ²Ù×÷ϵͳƽ̨ÉÏ£¿</h4>
+
+<p>
+ Ò»°ã˵À´£¬Ò»¸öÏÖ´úµÄ UNIX ¼æÈݵÄƽ̨¶¼ÄÜÔËÐÐ PostgreSQL ¡£ÔÚ°²×°Ö¸ÄÏÀïÁгöÁË·¢²¼Ê±¾¹ýÃ÷È·²âÊÔµÄƽ̨¡£
+</p>
+
+<p>
+ PostgreSQlÒ²¿ÉÒÔÖ±½ÓÔËÐÐÔÚ»ùÓÚ΢ÈíWindows-NTµÄ²Ù×÷ϵͳ£¬ÈçWin2000£¬WinXP ºÍ Win2003£¬ÒÑÖÆ×÷Íê³ÉµÄ°²×°°ü¿É´Ó
+ <a href="http://pgfoundry.org/projects/pginstaller">http://pgfoundry.org/projects/pginstaller</a>ÏÂÔØ£¬»ùÓÚMSDOSµÄWindows²Ù×÷ϵͳ
+ £¨Win95£¬Win98£¬WinMe£©ÐèҪͨ¹ýCygwinÄ£Äâ»·¾³ÔËÐÐPostgreSQL¡£
+</p>
+
+<p>
+ ͬʱҲÓÐÒ»¸öΪNovell Netware 6¿ª·¢µÄ°æ±¾¿É´Ó<a href="http://forge.novell.com"> http://forge.novell.com </a>»ñÈ¡£¬ÎªOS/2¿ª·¢µÄ°æ±¾¿É´Ó
+ <a href="http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&button=Search&key=postgreSQL&stype=all&sort=type&dir=%2F">
+ http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&button=Search&key=postgreSQL&stype=all&sort=type&dir=%2F</a>
+</p>
+
+<h4><a name="1.4"></a>1.4)ÎÒ´ÓÄÄÀïÄܵõ½ PostgreSQL£¿</h4>
+
+<p>
+ ͨ¹ýä¯ÀÀÆ÷¿É´Ó<a href="http://www.postgresql.org/ftp/">http://www.postgresql.org/ftp/</a>ÏÂÔØ£¬Ò²¿Éͨ¹ýFTP£¬´Ó
+ <a href="ftp://ftp.PostgreSQL.org/pub/">ftp://ftp.PostgreSQL.org/pub/</a>Õ¾µãÏÂÔØ¡£
+</p>
+
+
+<h4><a name="1.5"></a>1.5)ÎÒ´ÓÄÄÀïÄܵõ½¶Ô PostgreSQL µÄÖ§³Ö£¿</h4>
+<p>
+ PostgreSQLÉçÇøͨ¹ýÓʼþÁбíΪÆä´ó¶àÊýÓû§Ìṩ°ïÖú£¬¼ÓÈëÓʼþÁбíµÄÖ÷Õ¾µãÊÇ<a href="http://www.postgresql.org/community/lists/"> http://www.postgresql.org/community/lists/</a>£¬Ò»°ãÇé¿öÏ£¬ÏȼÓÈë<i>General</i> »ò <i>Bug</i>ÓʼþÁбíÊÇÒ»¸ö½ÏºÃµÄ¿ªÊ¼¡£
+</p>
+
+<p>
+ Ö÷ÒªµÄIRCƵµÀÊÇÔÚFreeNode(<i>irc.freenode.net</i>)µÄ<i>#postgresql</i>£¬ÎªÁËÁ¬ÉÏ´ËƵµÀ£¬¿ÉÒÔʹÓÃUNIX³ÌÐòirc£¬ÆäÖ¸Áî¸ñʽ£º
+ irc -c '#postgresql' "$USER" irc.freenode.net £¬»òÕßʹÓÃÆäËûIRC¿Í»§¶Ë³ÌÐò¡£ÔÚ´ËÍøÂçÖл¹´æÔÚÒ»¸öPostgreSQLµÄÎ÷°àÑÀƵµÀ(<i>#postgersql-es</i>)ºÍ·¨ÓïƵµÀ
+ (<i>#postgresql-fr</i>)¡£Í¬ÑùµØ£¬ÔÚEFNETÉÏÒ²ÓÐÒ»¸öPostgreSQLµÄ½»Á÷ƵµÀ¡£
+</p>
+
+<p>
+ ÉÌÒµÖ§³Ö¹«Ë¾µÄÁбíÔÚ<a href=" http://techdocs.postgresql.org/companies.php"> http://techdocs.postgresql.org/companies.php</a>¡£
+</p>
+
+
+
+<h4><a name="1.6"></a>1.6)ÎÒÈçºÎÌá½»Ò»¸öBUG±¨¸æ£¿</h4>
+<p>
+ ¿É·ÃÎÊ <a href="http://www.postgresql.org/support/submitbug">http://www.postgresql.org/support/submitbug</a>£¬ÌîдBugÉϱ¨±í¸ñ¼´¿É¡£
+</p>
+
+<p>
+ ͬÑùÒ²¿É·ÃÎÊftpÕ¾µã<a href="ftp://ftp.PostgreSQL.org/pub/">ftp://ftp.PostgreSQL.org/pub/</a> ¼ì²éÓÐÎÞ¸üеÄPostgreSQL°æ±¾»ò²¹¶¡¡£
+</p>
+
+
+
+<h4><a name="1.7"></a>1.7)×îаæµÄPostgreSQL ÊÇʲô£¿</h4>
+<p>
+ PostgreSQL ×îеİ汾ÊÇ°æ±¾ 8.0.2 £¨Òë×¢£ºÏÖ×îа汾Ϊ8.0.3£©¡£
+</p>
+
+<p>
+ ÎÒÃǼƻ®Ã¿Äê·¢²¼Ò»¸öÖ÷Òª°æ±¾£¬Ã¿¼¸¸öÔ·¢²¼Ò»¸öС°æ±¾¡£
+</p>
+
+
+<h4><a name="1.8"></a>1.8)Äܹ»»ñÈ¡µÄ×îÐÂÎĵµÓÐÄÄЩ£¿</h4>
+
+<p>
+ PostgreSQL°üº¬´óÁ¿µÄÎĵµ£¬Ö÷ÒªÓÐһЩÊֲᣬÊÖ²áÒ³ºÍһЩµÄ²âÊÔÀý×Ó¡£²Î¼û /doc Ŀ¼£¨Òë×¢£ºÓ¦Îª $PGHOME/doc£©¡£
+ Ä㻹¿ÉÒÔÔÚÏßä¯ÀÀ PostgreSQL µÄÊֲᣬÆäµØÖ·ÊÇ£º<a href="http://www.PostgreSQL.org/docs">http://www.PostgreSQL.org/docs</a>¡£
+</p>
+<p>
+ ÓÐÁ½±¾¹ØÓÚ PostgreSQL µÄÊéÔÚÏßÌṩ£¬ÔÚ
+ <a href="http://www.PostgreSQL.org/docs/awbook.html">http://www.PostgreSQL.org/docs/awbook.html</a>
+ ºÍ <a href="http://www.commandprompt.com/ppbook/">http://www.commandprompt.com/ppbook/</a> ¡£
+ Ò²ÓдóÁ¿µÄPostgreSQLÊé¼®¿É¹©¹ºÂò£¬ÆäÖÐ×îΪÁ÷ÐеÄÒ»±¾ÊÇÓÉKorry Douglas±àдµÄ¡£ÔÚ
+ <a href="http://techdocs.PostgreSQL.org/techdocs/bookreviews.php">http://techdocs.PostgreSQL.org/techdocs/bookreviews.php</a>ÉÏ
+ ÉÏÓдóÁ¿ÓйØPostgreSQLÊé¼®µÄ¼ò½é¡£
+ ÔÚ <a href="http://techdocs.PostgreSQL.org/">http://techdocs.PostgreSQL.org/</a>ÉÏÊÕ¼¯ÁËÓÐ¹Ø PostgreSQL µÄ´óÁ¿¼¼ÊõÎÄÕ¡£
+</p>
+
+<p>
+ ¿Í»§¶ËµÄÃüÁîÐгÌÐò<i>psql</i>ÓÐһЩÒÔ \d ¿ªÍ·µÄÃüÁ¿ÉÏÔʾ¹ØÓÚÀàÐÍ£¬²Ù×÷·û£¬º¯Êý£¬»ã×ܵȵÄÐÅÏ¢£¬Ê¹Óà \? ¿ÉÒÔÏÔʾËùÓпÉÓõÄÃüÁî¡£
+</p>
+
+<p>
+ ÎÒÃÇµÄ web Õ¾µã°üº¬¸ü¶àµÄÎĵµ¡£
+</p>
+
+<h4><a name="1.9"></a>1.9)ÎÒÈçºÎÁ˽âÒÑÖªµÄ BUG »òÔÝȱµÄ¹¦ÄÜ£¿</h4>
+<p>
+ PostgreSQL Ö§³ÖÒ»¸öÀ©Õ¹Á赀 SQL-92 µÄ×Ó¼¯¡£²ÎÔÄÎÒÃǵÄ<a href="http://www.postgresql.org/docs/faqs.TODO.html">TODO</a> ÁÐ±í£¬»ñÈ¡Ò»¸öÒÑÖªBug£¬ÔÝȱµÄ¹¦Äܺͽ«À´µÄ¼Æ»®¡£
+</p>
+
+
+<h4><a name="1.10"></a>1.10)ÎÒÓ¦¸ÃÔõÑùѧϰ SQL £¿</h4>
+<p>
+ Ê×ÏÈ¿¼ÂÇÉÏÊöÌáµ½µÄÓëPostgreSQLÏà¹ØµÄÊé¼®£¬ÁíÍâÒ»±¾ÊÇ<i>Teach Yourself SQL in 21 Days, Second Edition</i>£¬
+ ÎÒÃǵÄÐí¶àÓû§Ï²»¶<i>The Practical SQL Handbook</i> Bowman, Judith S., et al., Addison-Wesley£¬ÆäËûµÄÔòϲ»¶
+ <i>The Complete Reference SQL</i>, Groff et al., McGraw-Hill¡£
+</p>
+
+
+<h4><a name="1.11"></a>1.11)ÎÒÓ¦¸ÃÔõÑù¼ÓÈ뿪·¢¶ÓÎ飿</h4>
+<p>
+ Ïê¼û<a href="http://www.postgresql.org/docs/faqs.FAQ_DEV.html"> Developer's FAQ </a>¡£
+</p>
+
+
+<h4><a name="1.12"></a>1.12)PostgreSQL ºÍÆäËûÊý¾Ý¿âϵͳ±ÈÆðÀ´ÈçºÎ£¿</h4>
+<p>
+ÆÀ¼ÛÈí¼þÓкü¸ÖÖ·½·¨£ºÌØÐÔ£¬ÐÔÄÜ£¬¿É¿¿ÐÔ£¬Ö§³ÖºÍ¼Û¸ñ¡£
+</p>
+<dl>
+ <dt><b>ÌØÐÔ</b></dt>
+ <dd>
+ PostgreSQL ÓµÓдóÐÍÉÌÓà DBMS Àï´ó¶àÊýÌØÐÔ£¬
+ ÀýÈ磺ÊÂÎñ£¬×Ó²éѯ£¬´¥·¢Æ÷£¬ÊÓͼ£¬Íâ¼ü²Î¿¼ÍêÕûÐԺ͸´ÔÓµÄËøµÈ¡£
+ ÎÒÃÇ»¹ÓÐһЩËüÃÇûÓеÄÌØÐÔ£¬ÈçÓû§¶¨ÒåÀàÐÍ£¬¼Ì³Ð£¬¹æÔòºÍ¶à°æ±¾²¢ÐпØÖÆÒÔ¼õÉÙËøµÄÕùÓõȡ£<br/>
+ </dd>
+
+ <dt><b>ÐÔÄÜ</b></dt>
+ <dd>
+ PostgreSQL ºÍÆäËûÉÌÓúͿªÔ´µÄÊý¾Ý¿â¾ßÓÐÀàËƵÄÐÔÄÜ¡£
+ ¶ÔijЩ´¦ÀíËü±È½Ï¿ì£¬¶ÔÆäËûһЩ´¦ÀíËü±È½ÏÂý¡£
+ ÓëÆäËûÊý¾Ý¿âÏà±È£¬ÎÒÃǵÄÐÔÄÜͨ³£ÔÚ +/- 10%Ö®¼ä¡£<br/>
+ </dd>
+
+ <dt><b>¿É¿¿ÐÔ</b></dt>
+ <dd>
+ ÎÒÃÇÖªµÀ DBMS ±ØÐëÊÇ¿É¿¿µÄ£¬·ñÔòËü¾ÍÒ»µãÓö¼Ã»ÓС£
+ ÎÒÃÇŬÁ¦×öµ½·¢²¼¾¹ýÈÏÕæ²âÊԵģ¬Îȶ¨µÄ³ô³æ×îÉٵĴúÂ롣ÿ¸ö°æ±¾ÖÁÉÙÓÐÒ»¸öÔ嵀 beta
+ ²âÊÔʱ¼ä£¬²¢ÇÒÎÒÃǵķ¢²¼ÀúÊ·ÏÔʾÎÒÃÇ¿ÉÒÔÌṩÎȶ¨µÄ£¬Àι̵ģ¬¿ÉÓÃÓÚÉú²úʹÓõİ汾¡£ÎÒÃÇÏàÐÅ
+ ÔÚÕâ·½ÃæÎÒÃÇÓëÆäËûµÄÊý¾Ý¿âÈí¼þÊÇÏ൱µÄ¡£<br/>
+ </dd>
+
+ <dt><b>Ö§³Ö</b></dt>
+ <dd>
+ ÎÒÃǵÄÓʼþÁбíÌṩһ¸ö·Ç³£´óµÄ¿ª·¢ÈËÔ±ºÍÓû§µÄ×éÒÔ°ïÖú½â¾öËùÅöµ½µÄÈκÎÎÊÌâ¡£
+ ÎÒÃDz»Äܱ£Ö¤¿Ï¶¨Äܽâ¾öÎÊÌ⣬Ïà±È֮ϣ¬ÉÌÓà DBMS Ò²²¢²»ÊÇ×ÜÄܹ»Ìṩ½â¾ö·½·¨¡£
+ Ö±½ÓÓ뿪·¢ÈËÔ±£¬Óû§Èº£¬ÊÖ²áºÍÔ´³ÌÐò½Ó´¥Áî PostgreSQL µÄÖ§³Ö±ÈÆäËû DBMS
+ »¹ÒªºÃ¡£»¹ÓÐһЩÉÌÒµÐÔµÄÔ¤°ü×°µÄÖ§³Ö£¬¿ÉÒÔ¸øÌṩ¸øÄÇЩÐèÒªµÄÈË¡££¨²ÎÔÄ FAQ Ìõ¿î 1.5 С½Ú£©<br/>
+ </dd>
+
+ <dt><b>¼Û¸ñ</b></dt>
+ <dd>
+ ÎÒÃǶÔÈκÎÓÃ;¶¼Ãâ·Ñ£¬°üÀ¨ÉÌÓúͷÇÉÌÓÃÄ¿µÄ¡£
+ Äã¿ÉÒÔ²»¼ÓÏÞÖƵØÏòÄãµÄ²úÆ·Àï¼ÓÈëÎÒÃǵĴúÂ룬³ýÁËÄÇЩÎÒÃÇÔÚÉÏÃæµÄ°æȨÉùÃ÷ÀïÉùÃ÷µÄ BSD ·ç¸ñµÄ°æȨÍâ¡£
+ </dd>
+
+</dl>
+
+
+<h4><a name="1.13"></a>1.13)Ë¿ØÖÆPostgreSQL £¿</h4>
+<p>
+ Èç¹ûÄãÔÚÑ°ÕÒPostgreSQLµÄÕÆÃÅÈË£¬»òÊÇʲôÖÐÑëίԱ»á£¬»òÊÇʲôËùÊô¹«Ë¾£¬ÄãÖ»ÄÜ·ÅÆúÁË---ÒòΪһ¸öÒ²²»´æÔÚ£¬µ«ÎÒÃǵÄÈ·ÓÐÒ»¸ö
+ ίԱ»áºÍCVS¹ÜÀí×飬µ«ÕâЩ¹¤×÷×éµÄÉèÁ¢Ö÷ÒªÊÇΪÁ˽øÐйÜÀí¹¤×÷¶ø²»ÊǶÔPostgreSQL½øÐпØÖÆ£¬PostgreSQLÏîÄ¿ÊÇÓÉÈκÎÈ˾ù
+ ¿É²Î¼ÓµÄ¿ª·¢ÈËÔ±ÉçÇøºÍËùÓÐÓû§¿ØÖƵģ¬ÄãËùÐèÒª×öµÄ¾ÍÊǼÓÈëÓʼþÁÐ±í£¬²ÎÓëÌÖÂÛ¼´¿É£¨Òª²ÎÓëPostgreSQLµÄ¿ª·¢Ïê¼û
+ <a href="http://www.postgresql.org/docs/faqs.FAQ_DEV.html"> Developer's FAQ </a>»ñÈ¡ÐÅÏ¢£©¡£
+</p>
+
+<hr/>
+
+
+<div> <h2>Óû§¿Í»§¶ËÎÊÌâ</h2> </div>
+
+<h4><a name="2.1"></a>2.1)ÎÒÃÇ¿ÉÒÔÓÃʲôÓïÑÔºÍ PostgreSQL ´ò½»µÀ£¿</h4>
+<p>
+ PostgreSQL(ȱʡÇé¿ö)Ö»°²×°ÓÐCºÍÄÚǶʽCµÄ½Ó¿Ú£¬ÆäËûµÄ½Ó¿Ú¶¼ÊǶÀÁ¢µÄÏîÄ¿£¬Äܹ»·Ö±ðÏÂÔØ£¬ÕâЩ½Ó¿ÚÏîÄ¿¶ÀÁ¢µÄºÃ´¦
+ ÊÇËûÃÇ¿ÉÒÔÓи÷×Եķ¢²¼¼Æ»®ºÍ¸÷×Ô¶ÀÁ¢µÄ¿ª·¢×é¡£
+</p>
+<p>
+ һЩ±à³ÌÓïÑÔÈçPHP¶¼ÓзÃÎÊ PostgreSQL µÄ½Ó¿Ú£¬Perl,TCL,PythonÒÔ¼°ºÜ¶àÆäËûÓïÑԵĽӿÚÔÚ
+ <a href="http://gborg.postgresql.org/"> http://gborg.postgresql.org </a>ÉϵÄ<i>Drivers/Interfaces</i>С½Ú¿ÉÕÒµ½£¬
+ ²¢ÇÒͨ¹ýInternetºÜÈÝÒ×ËÑË÷µ½¡£
+</p>
+
+
+
+<h4><a name="2.2"></a>2.2)ÓÐʲô¹¤¾ß¿ÉÒÔ°Ñ PostgreSQL ÓÃÓÚ Web Ò³Ã棿</h4>
+<p>
+ Ò»¸ö½éÉÜÒÔÊý¾Ý¿âΪºǫ́µÄͦ²»´íµÄÕ¾µãÊÇ£º<a href="http://www.webreview.com">http://www.webreview.com</a>¡£
+</p>
+<p>
+ ¶ÔÓÚ Web ¼¯³É£¬PHP ÊÇÒ»¸ö¼«ºÃµÄ½Ó¿Ú¡£ËüÔÚ£º<a href="http://www.php.net/">http://www.php.net/</a>¡£
+</p>
+<p>
+ ¶ÔÓÚ¸´ÔÓµÄÈÎÎñ£¬ºÜ¶àÈ˲ÉÓà Perl ½Ó¿ÚºÍ CGI.pm »ò mod_perl ¡£
+</p>
+
+
+<h4><a name="2.3"></a>2.3)PostgreSQL ÓµÓÐͼÐÎÓû§½çÃæÂð£¿</h4>
+<p>
+ Êǵģ¬ÔÚ <a href="http://techdocs.postgresql.org/guides/GUITools">http://techdocs.postgresql.org/guides/GUITools</a>ÓÐÒ»¸öÏêϸµÄÁÐ±í¡£
+</p>
+
+
+
+<hr/>
+
+<div> <h2>ϵͳ¹ÜÀíÎÊÌâ</h2> </div>
+
+<h4><a name="3.1"></a>3.1)ÎÒÔõÑùÄÜ°Ñ PostgreSQL ×°ÔÚ /usr/local/pgsql ÒÔÍâµÄµØ·½£¿</h4>
+<p>
+ ÔÚÔËÐÐ configure ʱ¼ÓÉÏ --prefix Ñ¡Ïî¡£
+</p>
+
+
+<h4><a name="3.2"></a>3.2)ÎÒÈçºÎ¿ØÖÆÀ´×ÔÆäËûÖ÷»úµÄÁ¬½Ó£¿</h4>
+<p>
+ ȱʡʱ£¬PostgreSQL Ö»ÔÊÐíͨ¹ý unix ÓòÌ×½Ó×Ö»òTCP/IP·½Ê½ÇÒÀ´×Ô±¾»úµÄÁ¬½Ó¡£
+ ÄãÖ»ÓÐÔÚÐÞ¸ÄÁËÅäÖÃÎļþ<i>postgresql.conf</i>ÖеÄ<i>listen_addresses</i>£¬ÇÒÒ²ÔÚÅäÖÃÎļþ<i>pg_hba.conf</i>Öдò¿ªÁË
+ Ö÷»úΪ»ù´¡£¨ host-based £©µÄÉí·ÝÈÏÖ¤£¬²¢ÖØÐÂÆô¶¯PostgreSQL£¬·ñÔòÆäËû»úÆ÷ÊDz»ÄÜÓëÄãµÄPostgreSQL·þÎñÆ÷Á¬½ÓµÄ¡£
+</p>
+
+
+<h4><a name="3.3"></a>3.3)ÎÒÔõÑùµ÷ÕûÊý¾Ý¿âÒýÇæÒÔ»ñµÃ¸üºÃµÄÐÔÄÜ£¿</h4>
+<p>
+ ÓÐÈý¸öÖ÷Òª·½Ãæ¿ÉÒÔÌáÉýPostgreSQLµÄDZÄÜ¡£
+</p>
+
+<dl>
+ <dt><b>²éѯ·½Ê½µÄ±ä»¯</b></dt>
+ <dd>
+ ÕâÖ÷ÒªÉæ¼°Ð޸IJéѯ·½Ê½ÒÔ»ñÈ¡¸üºÃµÄÐÔÄÜ:
+ <ul>
+ <li>´´½¨Ë÷Òý£¬°üÀ¨±í´ïʽºÍ²¿·ÖË÷Òý£»</li>
+ <li>ʹÓÃCOPYÓï¾ä´úÌæ¶à¸öInsertÓï¾ä£»</li>
+ <li>½«¶à¸öSQLÓï¾ä×é³ÉÒ»¸öÊÂÎñÒÔ¼õÉÙÌá½»ÊÂÎñµÄ¿ªÏú£»</li>
+ <li>´ÓÒ»¸öË÷ÒýÖÐÌáÈ¡¶àÌõ¼Ç¼ʱʹÓÃCLUSTER£»</li>
+ <li>´ÓÒ»¸ö²éѯ½á¹ûÖÐÈ¡³ö²¿·Ö¼Ç¼ʱʹÓÃLIMIT£»</li>
+ <li>ʹÓÃÔ¤±àÒëʽ²éѯ£¨Prepared Query)£»</li>
+ <li>ʹÓÃANALYZEÒÔ±£³Ö¾«È·µÄÓÅ»¯Í³¼Æ£»</li>
+ <li>¶¨ÆÚʹÓà VACUUM »ò <i>pg_autovacuum</i></li>
+ <li>½øÐдóÁ¿Êý¾Ý¸ü¸ÄʱÏÈɾ³ýË÷Òý£¨È»ºóÖؽ¨Ë÷Òý£©</li>
+ </ul>
+ </dd>
+
+ <dt><b>·þÎñÆ÷µÄÅäÖÃ</b></dt>
+ <dd>
+ ÅäÖÃÎļþ<i>postgres.conf</i>ÖеĺܶàÉèÖö¼»áÓ°ÏìÐÔÄÜ£¬ËùÓвÎÊýµÄÁбí¿É¼û£º
+ <a href="http://www.postgresql.org/docs/current/static/runtime.html">Administration Guide/Server Run-time Environment/Run-time Configuration</a>£¬
+ ÓйزÎÊýµÄ½âÊͿɼû£º<a href="http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html">
+ http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html </a> ºÍ
+ <a href="http://www.varlena.com/varlena/GeneralBits/Tidbits/perf.html">http://www.varlena.com/varlena/GeneralBits/Tidbits/perf.html</a>¡£
+ </dd>
+
+ <dt><b>Ó²¼þµÄÑ¡Ôñ</b></dt>
+ <dd>
+ ¼ÆËã»úÓ²¼þ¶ÔÐÔÄܵÄÓ°Ïì¿Éä¯ÀÀ <a href="http://candle.pha.pa.us/main/writings/pgsql/hw_performance/index.html">
+ http://candle.pha.pa.us/main/writings/pgsql/hw_performance/index.html</a> ºÍ
+ <a href="http://www.powerpostgresql.com/PerfList/">http://www.powerpostgresql.com/PerfList/</a>¡£
+ </dd>
+
+</dl>
+
+
+<h4><a name="3.4"></a>3.4)PostgreSQL Àï¿ÉÒÔ»ñµÃʲôÑùµÄµ÷ÊÔÌØÐÔ£¿</h4>
+<p>
+ PostgreSQL ÓкܶàÀàËÆ<i> log_* </i>µÄ·þÎñÆ÷ÅäÖñäÁ¿¿ÉÓÃÓÚ²éѯµÄ´òÓ¡ºÍ½ø³Ìͳ¼Æ£¬¶øÕâЩ¹¤×÷¶Ôµ÷ÊÔºÍÐÔÄܲâÊÔºÜÓаïÖú¡£
+</p>
+
+
+
+<h4><a name="3.5"></a>3.5)ΪʲôÔÚÊÔͼÁ¬½ÓʱÊÕµ½¡°Sorry, too many clients¡±ÏûÏ¢£¿</h4>
+<p>
+ Õâ±íʾÄãÒѴﵽȱʡ100¸ö²¢·¢ºǫ́½ø³ÌÊýµÄÏÞÖÆ£¬ÄãÐèҪͨ¹ýÐÞ¸Ä<i>postgresql.conf</i>ÎļþÖеÄ<i>max_connections</i>ÖµÀ´
+ Ôö¼ÓpostmasterµÄºǫ́²¢·¢´¦ÀíÊý£¬Ð޸ĺóÐèÖØÐÂÆô¶¯<i>postmaster</i>¡£
+</p>
+
+
+<h4><a name="3.6"></a>3.6)ΪʲôҪÔÚÉý¼¶ PostgreSQL Ö÷Òª·¢²¼°æ±¾Ê±×ö dump ºÍ restore £¿</h4>
+<p>
+ PostgreSQL ¿ª·¢×é¶Ôÿ´ÎСµÄÉý¼¶½ö×öÁ˽ÏÉÙµÄÐ޸ģ¬Òò´Ë´Ó 7.4.0 Éý¼¶µ½ 7.4.1 ²»ÐèÒª dump ºÍ restore¡£
+ µ«ÊÇÖ÷ÒªµÄÉý¼¶£¨ÀýÈç´Ó 7.3 µ½ 7.4£©Í¨³£»áÐÞ¸Äϵͳ±íºÍÊý¾Ý±íµÄÄÚ²¿¸ñʽ¡£
+ ÕâЩ±ä»¯Ò»°ã±È½Ï¸´ÔÓ£¬Òò´ËÎÒÃDz»Î¬Êý¾ÝÎļþµÄÏòºó¼æÈÝ¡£
+ dump ½«Êý¾Ý°´ÕÕͨÓõĸñʽÊä³ö£¬Ëæºó¿ÉÒÔ±»ÖØмÓÔز¢Ê¹ÓÃеÄÄÚ²¿¸ñʽ¡£
+</p>
+
+<h4><a name="3.7"></a>3.7)(ʹÓÃPostgreSQL)ÎÒÐèҪʹÓÃʲô¼ÆËã»úÓ²¼þ £¿</h4>
+<p>
+ ÓÉÓÚ¼ÆËã»úÓ²¼þ´ó¶àÊýÊǼæÈݵģ¬ÈËÃÇ×ÜÊÇÇãÏòÓÚÏàÐÅËùÓмÆËã»úÓ²¼þÖÊÁ¿Ò²ÊÇÏàͬµÄ¡£ÊÂʵÉϲ»ÊÇ£¬
+ ECC RAM£¨´øÆæżУÑéµÄÄڴ棩£¬SCSI £¨Ó²ÅÌ£©ºÍÓÅÖʵÄÖ÷°å±ÈһЩ±ãÒË»õÒª¸ü¼Ó¿É¿¿ÇÒ¾ßÓиüºÃµÄÐÔÄÜ¡£PostgreSQL¼¸ºõ¿ÉÒÔÔËÐÐÔÚÈκÎÓ²¼þÉÏ£¬
+ µ«Èç¹û¿É¿¿ÐÔºÍÐÔÄܶÔÄãµÄϵͳºÜÖØÒª£¬Äã¾ÍÐèҪȫÃæµÄÑо¿Ò»ÏÂÄãµÄÓ²¼þÅäÖÃÁË¡£ÔÚÎÒÃǵÄÓʼþÁбíÉÏÒ²ÓйØÓÚ
+ Ó²¼þÅäÖúÍÐԼ۱ȵÄÌÖÂÛ¡£
+</p>
+
+
+<hr/>
+
+<div><h2>²Ù×÷ÎÊÌâ</h2> </div>
+
+
+<h4><a name="4.1"></a>4.1)ÈçºÎֻѡÔñÒ»¸ö²éѯ½á¹ûµÄÍ·¼¸ÐУ¿»òÊÇËæ»úµÄÒ»ÐУ¿</h4>
+<p>
+ Èç¹ûÄãÖ»ÊÇÒªÌáÈ¡¼¸ÐÐÊý¾Ý£¬²¢ÇÒÄãÔÚÖ´ÐвéѯÖÐÖªµÀÈ·ÇеÄÐÐÊý£¬Äã¿ÉÒÔʹÓÃLIMIT¹¦ÄÜ¡£
+ Èç¹ûÓÐÒ»¸öË÷ÒýÓë <i> ORDER BY</i>ÖеÄÌõ¼þÆ¥Å䣬PostgreSQL ¿ÉÄܾÍÖ»´¦ÀíÒªÇóµÄÍ·¼¸Ìõ¼Ç¼£¬
+ £¨·ñÔò½«¶ÔÕû¸ö²éѯ½øÐд¦ÀíÖ±µ½Éú³ÉÐèÒªµÄÐУ©¡£Èç¹ûÔÚÖ´Ðвéѯ¹¦ÄÜʱ²»ÖªµÀÈ·ÇеļǼÊý£¬
+ ¿ÉʹÓÃÓαê(cursor)ºÍFETCH¹¦ÄÜ¡£
+</p>
+<p>
+ ¿ÉʹÓÃÒÔÏ·½·¨ÌáÈ¡Ò»ÐÐËæ»ú¼Ç¼µÄ£º
+</p>
+<pre>
+ SELECT cols
+ FROM tab
+ ORDER BY random()
+ LIMIT 1 ;
+</pre>
+
+
+
+<h4><a name="4.2"></a>4.2)ÈçºÎ²é¿´±í¡¢Ë÷Òý¡¢Êý¾Ý¿âÒÔ¼°Óû§µÄ¶¨Ò壿ÈçºÎ²é¿´<i>psql</i>ÀïÓõ½µÄ²éѯָÁî²¢ÏÔʾËüÃÇ£¿</h4>
+<p>
+ ÔÚ<i>psql</i>ÖÐʹÓà \dt ÃüÁîÀ´ÏÔʾÊý¾Ý±íµÄ¶¨Ò壬ҪÁ˽â<i>psql</i>ÖеÄÍêÕûÃüÁîÁбí¿ÉʹÓÃ\? £¬ÁíÍ⣬ÄãÒ²¿ÉÒÔÔĶÁ <i>psql</i> µÄÔ´´úÂë
+ Îļþ<i>pgsql/src/bin/psql/describe.c</i>£¬Ëü°üÀ¨ÎªÉú³É<i>psql</i>·´Ð±¸ÜÃüÁîµÄÊä³öµÄËùÓÐ SQL ÃüÁî¡£Ä㻹¿ÉÒÔ´ø <i>-E</i> Ñ¡ÏîÆô¶¯ <i>psql</i>£¬
+ ÕâÑùËü½«´òÓ¡³öÖ´ÐÐÄãÔÚ<i>psql</i>ÖÐËù¸ø³öµÄÃüÁîµÄÄÚ²¿Êµ¼ÊʹÓõÄSQL²éѯ¡£PostgreSQLÒ²ÌṩÁËÒ»¸ö¼æÈÝSQLµÄINFORMATION SCHEMA½Ó¿Ú£¬
+ Äã¿ÉÒÔ´ÓÕâÀï»ñÈ¡¹ØÓÚÊý¾Ý¿âµÄÐÅÏ¢¡£
+</p>
+<p>
+ ÔÚϵͳÖÐÓÐһЩÒÔ<i>pg_</i> ´òÍ·µÄϵͳ±íÒ²ÃèÊöÁ˱íµÄ¶¨Òå¡£
+</p>
+<p>
+ ʹÓà <i>psql -l</i> Ö¸Áî¿ÉÒÔÁгöËùÓеÄÊý¾Ý¿â¡£
+</p>
+<p>
+ Ò²¿ÉÒÔä¯ÀÀһϠ<i>pgsql/src/tutorial/syscat.source</i>Îļþ£¬ËüÁоÙÁ˺ܶà¿É´ÓÊý¾Ý¿âϵͳ±íÖлñÈ¡ÐÅÏ¢µÄSELECTÓï·¨¡£
+</p>
+
+
+<h4><a name="4.3"></a>4.3)ÈçºÎ¸ü¸ÄÒ»¸ö×ֶεÄÊý¾ÝÀàÐÍ£¿</h4>
+<p>
+ ÔÚ8.0°æ±¾Àï¸ü¸ÄÒ»¸ö×ֶεÄÊý¾ÝÀàÐͺÜÈÝÒ×£¬¿ÉʹÓà ALTER TABLE ALTER COLUMN TYPE ¡£
+</p>
+<p>
+ ÔÚÒÔÇ°µÄ°æ±¾ÖУ¬¿ÉÒÔÕâÑù×ö£º
+</p>
+<pre>
+ BEGIN;
+ ALTER TABLE tab ADD COLUMN new_col new_data_type;
+ UPDATE tab SET new_col = CAST(old_col AS new_data_type);
+ ALTER TABLE tab DROP COLUMN old_col;
+ COMMIT;
+</pre>
+<p>
+ ÄãÈ»ºó¿ÉÒÔʹÓÃ<i>VACUUM FULL tab </i>Ö¸ÁîÀ´Ê¹ÏµÍ³ÊÕ»ØÎÞЧÊý¾ÝËùÕ¼ÓõĿռ䡣
+</p>
+
+<h4><a name="4.4"></a>4.4)Ò»ÐмǼ£¬Ò»¸ö±í£¬Ò»¸ö¿âµÄ×î´ó³ß´çÊǶàÉÙ£¿</h4>
+<p>
+ ÏÂÃæÊÇһЩÏÞÖÆ£º
+</p>
+<blockquote>
+ <table>
+ <tbody>
+ <tr><td>Ò»¸öÊý¾Ý¿â×î´ó³ß´ç£¿</td><td>ÎÞÏÞÖÆ£¨ÒÑ´æÔÚÓÐ 32TB µÄÊý¾Ý¿â£©</td></tr>
+ <tr><td>Ò»¸ö±íµÄ×î´ó³ß´ç£¿</td><td>32 TB</td></tr>
+ <tr><td>Ò»ÐмǼµÄ×î´ó³ß´ç£¿</td><td>1.6 TB</td></tr>
+ <tr><td>Ò»¸ö×ֶεÄ×î´ó³ß´ç?</td><td>1 GB</td></tr>
+ <tr><td>Ò»¸ö±íÀï×î´óÐÐÊý£¿</td><td>ÎÞÏÞÖÆ</td></tr>
+ <tr><td>Ò»¸ö±íÀï×î´óÁÐÊý£¿</td><td>250-1600 £¨ÓëÁÐÀàÐÍÓйأ©</td></tr>
+ <tr><td>Ò»¸ö±íÀïµÄ×î´óË÷ÒýÊýÁ¿£¿</td><td>ÎÞÏÞÖÆ</td></tr>
+ </tbody>
+</table>
+</blockquote>
+
+<p>
+ µ±È»£¬Êµ¼ÊÉÏûÓÐÕæÕýµÄÎÞÏÞÖÆ£¬»¹ÊÇÒªÊÜ¿ÉÓôÅÅ̿ռ䡢¿ÉÓÃÄÚ´æ/½»»»ÇøµÄÖÆÔ¼¡£
+ ÊÂʵÉÏ£¬µ±ÕâЩÊýÖµ±äµÃÒì³£µØ´óʱ£¬ÏµÍ³ÐÔÄÜÒ²»áÊܴܺóÓ°Ïì¡£
+</p>
+
+<p>
+ ±íµÄ×î´ó³ß´ç 32 TB ²»ÐèÒª²Ù×÷ϵͳ¶Ô´óÎļþµÄÖ§³Ö¡£´ó±íÓöà¸ö 1 GB µÄÎļþ´æ´¢£¬Òò´ËÎļþϵͳ³ß´çµÄÏÞÖÆÊDz»ÖØÒªµÄ¡£
+</p>
+<p>
+ Èç¹ûȱʡµÄ¿é´óСÔö³¤µ½ 32K £¬×î´óµÄ±í³ß´çºÍ×î´óÁÐÊý»¹¿ÉÒÔÔö¼Óµ½Ëı¶¡£
+</p>
+
+
+<h4><a name="4.5"></a>4.5)´æ´¢Ò»¸öµäÐ͵ÄÎı¾ÎļþÀïµÄÊý¾ÝÐèÒª¶àÉÙ´ÅÅ̿ռ䣿</h4>
+<p>
+ Ò»¸ö Postgres Êý¾Ý¿â£¨´æ´¢Ò»¸öÎı¾Îļþ£©ËùÕ¼ÓõĿռä×î¶à¿ÉÄÜÐèÒªÏ൱ÓÚÕâ¸öÎı¾Îļþ×ÔÉí´óС5±¶µÄ´ÅÅ̿ռ䡣
+</p>
+<p>
+ ÀýÈ磬¼ÙÉèÓÐÒ»¸ö 100,000 ÐеÄÎļþ£¬Ã¿ÐÐÓÐÒ»¸öÕûÊýºÍÒ»¸öÎı¾ÃèÊö¡£
+ ¼ÙÉèÎı¾´®µÄƽ¾ù³¤¶ÈΪ20×Ö½Ú¡£Îı¾ÎļþÕ¼Óà 2.8 MB¡£´æ·ÅÕâЩÊý¾ÝµÄ PostgreSQL Êý¾Ý¿âÎļþ´óÔ¼ÊÇ 6.4 MB:
+</p>
+<pre>
+ 32 ×Ö½Ú: ÿÐеÄÍ·£¨¹À¼ÆÖµ£©
+ 24 ×Ö½Ú: Ò»¸öÕûÊýÐÍ×ֶκÍÒ»¸öÎı¾ÐÍ×Ö¶Î
+ + 4 ×Ö½Ú: Ò³ÃæÄÚÖ¸ÏòÔª×éµÄÖ¸Õë
+ ----------------------------------------
+ 60 ×Ö½ÚÿÐÐ
+
+ PostgreSQL Êý¾ÝÒ³µÄ´óСÊÇ 8192 ×Ö½Ú (8 KB)£¬Ôò£º
+
+ 8192 ×Ö½Úÿҳ
+ ------------------- = 136 ÐÐ/Êý¾ÝÒ³£¨ÏòÏÂÈ¡Õû£©
+ 60 ×Ö½ÚÿÐÐ
+
+ 100000 Êý¾ÝÐÐ
+ -------------------- = 735 Êý¾ÝÒ³£¨ÏòÉÏÈ¡Õû£©
+ 128 ÐÐÿҳ
+
+ 735 Êý¾ÝÒ³ * 8192 ×Ö½Ú/Ò³ = 6,021,120 ×Ö½Ú£¨6 MB£©
+</pre>
+
+<p>
+ Ë÷Òý²»ÐèÒªÕâô¶àµÄ¶îÍâÏûºÄ£¬µ«Ò²È·Êµ°üÀ¨±»Ë÷ÒýµÄÊý¾Ý£¬Òò´ËËüÃÇÒ²¿ÉÄܴܺó¡£
+</p>
+<p>
+ ¿ÕÖµ<i>NULL</i>´æ·ÅÔÚλͼÖУ¬Òò´ËÕ¼ÓúÜÉٵĿռ䡣
+</p>
+
+<h4><a name="4.6"></a>4.6)ΪʲôÎҵIJéѯºÜÂý£¿ÎªÊ²Ã´ÕâЩ²éѯûÓÐÀûÓÃË÷Òý£¿</h4>
+<p>
+ ²¢·Çÿ¸ö²éѯ¶¼»á×Ô¶¯Ê¹ÓÃË÷Òý¡£Ö»ÓÐÔÚ±íµÄ´óС³¬¹ýÒ»¸ö×îСֵ£¬²¢ÇÒ²éѯֻ»áÑ¡ÖбíÖнÏС±ÈÀýµÄ¼Ç¼ʱ²Å»á²ÉÓÃË÷Òý¡£
+ ÕâÊÇÒòΪË÷ÒýɨÃèÒýÆðµÄËæ¼´´ÅÅÌ´æÈ¡¿ÉÄܱÈÖ±½ÓµØ¶ÁÈ¡±í£¨Ë³ÐòɨÃ裩¸üÂý¡£
+</p>
+<p>
+ ΪÁËÅжÏÊÇ·ñʹÓÃË÷Òý£¬PostgreSQL±ØÐë»ñµÃÓйرíµÄͳ¼ÆÖµ¡£ÕâЩͳ¼ÆÖµ¿ÉÒÔʹÓà VACUUM ANALYZE£¬»ò ANALYZE »ñµÃ¡£
+ ʹÓÃͳ¼ÆÖµ£¬ÓÅ»¯Æ÷ÖªµÀ±íÖÐÓжàÉÙÐУ¬¾ÍÄܹ»¸üºÃµØÅжÏÊÇ·ñÀûÓÃË÷Òý¡£
+ ͳ¼ÆÖµ¶ÔÈ·¶¨ÓÅ»¯µÄÁ¬½Ó˳ÐòºÍÁ¬½Ó·½·¨Ò²ºÜÓÐÓá£ÔÚ±íµÄÄÚÈÝ·¢Éú±ä»¯Ê±£¬Ó¦¶¨ÆÚ½øÐÐͳ¼ÆÖµµÄ¸üÐÂÊÕ¼¯¡£
+</p>
+<p>
+ Ë÷Òýͨ³£²»ÓÃÓÚ ORDER BY »òÖ´ÐÐÁ¬½Ó¡£¶ÔÒ»¸ö´ó±íµÄÒ»´Î˳ÐòɨÃ裬ÔÙ×öÒ»¸öÏÔʽµÄÅÅÐòͨ³£±ÈË÷ÒýɨÃèÒª¿ì¡£
+</p>
+
+<p>
+ µ«ÊÇ£¬ÔÚ LIMIT ºÍ ORDER BY ½áºÏʹÓÃʱ¾³£»áʹÓÃË÷Òý£¬ÒòΪÕâÖ»»á·µ»Ø±íµÄһС²¿·Ö¡£
+ ʵ¼ÊÉÏ£¬ËäÈ» MAX() ºÍ MIN() ²¢²»Ê¹ÓÃË÷Òý£¬Í¨¹ý¶Ô
+ ORDER BY ºÍ LLIMIT ʹÓÃË÷ÒýÈ¡µÃ×î´óÖµºÍ×îСֵҲÊÇ¿ÉÒԵģº
+</p>
+<pre>
+ SELECT col
+ FROM tab
+ ORDER BY col [ DESC ]
+ LIMIT 1;
+</pre>
+<p>
+ Èç¹ûÄãÈ·ÐÅPostgreSQLµÄÓÅ»¯Æ÷ʹÓÃ˳ÐòɨÃèÊDz»ÕýÈ·µÄ£¬Äã¿ÉÒÔʹÓÃ<code>SET enable_seqscan TO 'off'</code>Ö¸Á
+ È»ºóÔÙ´ÎÔËÐвéѯ£¬Äã¾Í¿ÉÒÔ¿´³öʹÓÃÒ»¸öË÷ÒýɨÃèÊÇ·ñȷʵҪ¿ìһЩ¡£
+</p>
+
+<p>
+ µ±Ê¹ÓÃͨÅä·û²Ù×÷£¬ÀýÈç <i>LIKE</i> »ò <i>~</i> ʱ£¬Ë÷ÒýÖ»ÄÜÔÚÌض¨µÄÇé¿öÏÂʹÓãº
+</p>
+<ul>
+ <li>×Ö·û´®µÄ¿ªÊ¼²¿·Ö±ØÐëÊÇÆÕͨ×Ö·û´®£¬Ò²¾ÍÊÇ˵£º
+ <ul>
+ <li> <i>LIKE</i> ģʽ²»ÄÜÒÔ <i>%</i> ´òÍ·¡£</li>
+ <li> <i>~</i> £¨ÕýÔò±í´ïʽ£©Ä£Ê½±ØÐëÒÔ <i>^</i> ´òÍ·¡£</li>
+ </ul>
+ </li>
+ <li>×Ö·û´®²»ÄÜÒÔÆ¥Åä¶à¸ö×Ö·ûµÄģʽÀà´òÍ·£¬ÀýÈç [a-e]¡£</li>
+ <li>´óСдÎ޹صIJéÕÒ£¬Èç ILIKE ºÍ ~* µÈ²»Ê¹ÓÃË÷Òý£¬µ«¿ÉÒÔÓà <a href="#4.8">4.8</a> ½ÚÃèÊöµÄº¯ÊýË÷Òý¡£</li>
+ <li>ÔÚ×ö initdb ʱ±ØÐë²ÉÓÃȱʡµÄ±¾µØÉèÖà C locale£¬ÒòΪϵͳ²»¿ÉÄÜÖªµÀÔÚ·ÇC localeÇé¿öʱÏÂÒ»¸ö×î´ó×Ö·ûÊÇʲô¡£
+ ÔÚÕâÖÖÇé¿öÏ£¬Äã¿ÉÒÔ´´½¨Ò»¸öÌØÊâµÄ<code>text_pattern_ops</code>Ë÷ÒýÀ´ÓÃÓÚ<small>LIKE</small>µÄË÷Òý¡£
+ </li>
+</ul>
+<p>
+ ÔÚ8.0֮ǰµÄ°æ±¾ÖУ¬³ý·ÇÒª²éѯµÄÊý¾ÝÀàÐͺÍË÷ÒýµÄÊý¾ÝÀàÐÍÏàÆ¥Å䣬·ñÔòË÷Òý¾³£ÊÇδ±»Óõ½£¬ÌرðÊǶÔint2,int8ºÍÊýÖµÐ͵ÄË÷Òý¡£
+</p>
+
+<h4><a name="4.7"></a>4.7)ÎÒÈçºÎ²ÅÄÜ¿´µ½²éѯÓÅ»¯Æ÷ÊÇÔõÑùÆÀ¹À´¦ÀíÎҵIJéѯ£¿</h4>
+<p>
+ ²Î¿¼ <small>EXPLAIN</small> ÊÖ²áÒ³¡£
+</p>
+
+<h4><a name="4.8"></a>4.8)ÎÒÔõÑù×öÕýÔò±í´ïʽËÑË÷ºÍ´óСдÎ޹صÄÕýÔò±í´ïʽ²éÕÒ£¿ÔõÑùÀûÓÃË÷Òý½øÐдóСдÎ޹زéÕÒ£¿</h4>
+<p>
+ ²Ù×÷·û <i> ~ </i> ´¦ÀíÕýÔò±í´ïʽƥÅ䣬¶ø <i>~*</i> ´¦Àí´óСдÎ޹صÄÕýÔò±í´ïʽƥÅä¡£´óдЩÎÞ¹ØµÄ LIKE ±äÖÖ³ÉΪ ILIKE¡£
+</p>
+<p>
+ ´óСдÎ޹صĵÈʽ±È½Ïͨ³£Ð´×ö£º
+</p>
+<pre> SELECT *
+ FROM tab
+ WHERE lower(col) = 'abc';
+</pre>
+<p>
+ ÕâÑù½«²»»áʹÓñê×¼µÄË÷Òý¡£µ«ÊÇ¿ÉÒÔ´´½¨Ò»¸ö¿É±»ÀûÓõĺ¯ÊýË÷Òý:
+</p>
+<pre> CREATE INDEX tabindex ON tab (lower(col));
+</pre>
+
+<h4><a name="4.9"></a>4.9)ÔÚÒ»¸ö²éѯÀÎÒÔõÑù¼ì²âÒ»¸ö×Ö¶ÎÊÇ·ñΪ <i>NULL</i> £¿ÎÒÈçºÎ²ÅÄÜ׼ȷÅÅÐò¶ø²»ÂÛij×Ö¶ÎÊÇ·ñº¬ <i>NULL</i> Öµ£¿</h4>
+<p>
+ Óà <small>IS NULL</small> ºÍ <small>IS NOT NULL</small> ²âÊÔÕâ¸ö×ֶΣ¬¾ßÌå·½·¨ÈçÏ£º
+</p>
+<pre> SELECT *
+ FROM tab
+ WHERE col IS NULL;
+</pre>
+
+<p>ΪÁËÄܶԺ¬ <small>NULL</small>×Ö¶ÎÅÅÐò£¬¿ÉÔÚ <small>ORDER BY</small> Ìõ¼þÖÐʹÓà <small>IS NULL</small>ºÍ
+ <small>IS NOT NULL</small> ÐÞÊηû£¬Ìõ¼þΪÕæ <i>true</i> ½«±ÈÌõ¼þΪ¼Ù<i>false</i> ÅÅÔÚÇ°Ã棬ÏÂÃæµÄÀý×ӾͻὫº¬
+ NULL µÄ¼Ç¼ÅÅÔÚ½á¹ûµÄÉÏÃ沿·Ö£º
+</p>
+<pre> SELECT *
+ FROM tab
+ ORDER BY (col IS NOT NULL)
+</pre>
+
+<h4><a name="4.10"></a>4.10)¸÷ÖÖ×Ö·ûÀàÐÍÖ®¼äÓÐʲô²»Í¬£¿</h4>
+<blockquote>
+ <table>
+ <tbody>
+ <tr><th>ÀàÐÍ</th><th>ÄÚ²¿Ãû³Æ</th><th>˵Ã÷</th></tr>
+ <tr><td>VARCHAR(n)</td><td>varchar</td><td>Ö¸¶¨ÁË×î´ó³¤¶È£¬±ä³¤×Ö·û´®£¬²»×㶨Ò峤¶ÈµÄ²¿·Ö²»²¹Æë</td></tr>
+ <tr><td>CHAR(n)</td><td>bpchar</td><td>¶¨³¤×Ö·û´®£¬Êµ¼ÊÊý¾Ý²»×㶨Ò峤¶Èʱ£¬ÒÔ¿Õ¸ñ²¹Æë</td></tr>
+ <tr><td>TEXT</td><td>text</td><td>ûÓÐÌرðµÄÉÏÏÞÏÞÖÆ£¨½öÊÜÐеÄ×î´ó³¤¶ÈÏÞÖÆ£©</td></tr>
+ <tr><td>BYTEA</td><td>bytea</td><td>±ä³¤×Ö½ÚÐòÁУ¨Ê¹ÓÃNULLÒ²ÊÇÔÊÐíµÄ£©</td></tr>
+ <tr><td>"char"</td><td>char</td><td>Ò»¸ö×Ö·û</td></tr>
+ </tbody>
+ </table>
+</blockquote>
+
+<p>
+ ÔÚϵͳ±íºÍÔÚһЩ´íÎóÐÅÏ¢ÀïÄ㽫¿´µ½ÄÚ²¿Ãû³Æ¡£
+</p>
+<p>
+ ÉÏÃæËùÁеÄÇ°ËÄÖÖÀàÐÍÊÇ"varlena"£¨±ä³¤£©ÀàÐÍ£¨Ò²¾ÍÊÇ˵£¬¿ªÍ·µÄËĸö×Ö½ÚÊdz¤¶È£¬ºóÃæ²ÅÊÇÊý¾Ý£©¡£
+ ÓÚÊÇʵ¼ÊÕ¼ÓõĿռä±ÈÉùÃ÷µÄ´óСҪ¶àһЩ¡£
+ È»¶øÕâЩÀàÐͶ¼¿ÉÒÔ±»Ñ¹Ëõ´æ´¢£¬Ò²¿ÉÒÔÓà TOAST ÍÑ»ú´æ´¢£¬Òò´Ë´ÅÅÌ¿Õ¼äÒ²¿ÉÄܱÈÔ¤ÏëµÄÒªÉÙ¡£
+</p>
+<p>
+ <small>VARCHAR(n)</small> ÔÚ´æ´¢ÏÞÖÆÁË×î´ó³¤¶ÈµÄ±ä³¤×Ö·û´®ÊÇ×îºÃµÄ¡£
+ <small>TEXT</small> ÊÊÓÃÓÚ´æ´¢×î´ó¿É´ï 1G×óÓÒµ«Î´¶¨ÒåÏÞÖƳ¤¶ÈµÄ×Ö·û´®¡£
+</p>
+<p>
+ <small>CHAR(n)</small> ×îÊʺÏÓÚ´æ´¢³¤¶ÈÏàͬµÄ×Ö·û´®¡£ <small>CHAR(n)</small>»á¸ù¾ÝËù¸ø¶¨µÄ×ֶ㤶ÈÒÔ¿Õ¸ñ²¹×㣨²»×ãµÄ×Ö¶ÎÄÚÈÝ£©£¬
+ ¶ø <small>VARCHAR(n)</small> Ö»´æ´¢Ëù¸ø¶¨µÄÊý¾ÝÄÚÈÝ¡£
+ <small>BYTEA</small> ÓÃÓÚ´æ´¢¶þ½øÖÆÊý¾Ý£¬ÓÈÆäÊÇ°üº¬ NULL ×Ö½ÚµÄÖµ¡£ÕâЩÀàÐ;ßÓÐÏàËƵÄÐÔÄÜÌØÐÔ¡£
+</p>
+
+
+
+<h4><a name="4.11.1"></a>4.11.1)ÎÒÔõÑù´´½¨Ò»¸öÐòÁкÅ/×Ô¶¯µÝÔöµÄ×ֶΣ¿</h4>
+<p>
+ PostgreSQL Ö§³Ö SERIAL Êý¾ÝÀàÐÍ¡£ËüÔÚ×Ö¶ÎÉÏ×Ô¶¯´´½¨Ò»¸öÐòÁкÍË÷Òý¡£ÀýÈ磺
+</p>
+<pre>
+ CREATE TABLE person (
+ id SERIAL,
+ name TEXT
+ );
+</pre>
+<p>
+ »á×Ô¶¯×ª»»Îª£º
+</p>
+<pre>
+ CREATE SEQUENCE person_id_seq;
+ CREATE TABLE person (
+ id INT4 NOT NULL DEFAULT nextval('person_id_seq'),
+ name TEXT
+ );
+</pre>
+<p>
+ ²Î¿¼ create_sequence ÊÖ²áÒ³»ñÈ¡¹ØÓÚÐòÁеĸü¶àÐÅÏ¢¡£
+</p>
+
+
+<h4><a name="4.11.2"></a>4.11.2)ÎÒÈçºÎ»ñµÃÒ»¸ö²åÈëµÄÐòÁкŵÄÖµ£¿</h4>
+<p>
+ Ò»ÖÖ·½·¨ÊÇÔÚ²åÈë֮ǰÏÈÓú¯Êý nextval() ´ÓÐòÁжÔÏóÀï¼ìË÷³öÏÂÒ»¸ö SERIAL Öµ£¬È»ºóÔÙÏÔʽ²åÈ롣ʹÓÃ
+ <a href="#4.11.1"> 4.11.1</a> ÀïµÄÀý±í£¬¿ÉÓÃαÂëÕâÑùÃèÊö£º
+</p>
+<pre>
+ new_id = execute("SELECT nextval('person_id_seq')");
+ execute("INSERT INTO person (id, name) VALUES (new_id, 'Blaise Pascal')");
+</pre>
+<p>
+ ÕâÑù»¹ÄÜÔÚÆäËû²éѯÖÐʹÓôæ·ÅÔÚ new_id ÀïµÄÐÂÖµ£¨ÀýÈ磬×÷Ϊ person ±íµÄÍâ¼ü£©¡£
+ ×¢Òâ×Ô¶¯´´½¨µÄ SEQUENCE ¶ÔÏóµÄÃû³Æ½«»áÊÇ <<i>table</i>>_<<i>serialcolumn</i>>_<i>seq</i>£¬
+ ÕâÀï table ºÍ serialcolumn ·Ö±ðÊÇÄãµÄ±íµÄÃû³ÆºÍÄãµÄ SERIAL ×ֶεÄÃû³Æ¡£
+</p>
+<p>
+ ÀàËƵģ¬ÔÚ SERIAL ¶ÔÏóȱʡ²åÈëºóÄã¿ÉÒÔÓú¯Êý currval() ¼ìË÷¸Õ¸³ÖµµÄ SERIAL Öµ£¬ÀýÈ磺
+</p>
+<pre>
+ execute("INSERT INTO person (name) VALUES ('Blaise Pascal')");
+ new_id = execute("SELECT currval('person_id_seq')");
+</pre>
+
+<h4><a name="4.11.3"></a>4.11.3)ʹÓà <i>currval()</i> »áµ¼ÖºÍÆäËûÓû§µÄ³åÍ»Çé¿ö£¨race condition£©Âð£¿</h4>
+<p>
+ ²»»á¡£<i>currval()</i> ·µ»ØµÄÊÇÄã±¾´Î»á»°½ø³ÌËù¸³µÄÖµ¶ø²»ÊÇËùÓÐÓû§µÄµ±Ç°Öµ¡£<br/>
+</p>
+
+<h4><a name="4.11.4"></a>4.11.4)Ϊʲô²»ÔÚÊÂÎñÒì³£ÖÐÖ¹ºóÖØÓÃÐòÁкÅÄØ£¿ÎªÊ²Ã´ÔÚÐòÁкÅ×ֶεÄÈ¡ÖµÖдæÔÚ¼ä¶ÏÄØ£¿</h4>
+<p>
+ ΪÁËÌá¸ß²¢·¢ÐÔ£¬ÐòÁкÅÔÚÐèÒªµÄʱºò¸³ÓèÕýÔÚÔËÐеÄÊÂÎñ£¬²¢ÇÒÔÚÊÂÎñ½áÊø֮ǰ²»½øÐÐËø¶¨£¬
+ Õâ¾Í»áµ¼ÖÂÒì³£ÖÐÖ¹µÄÊÂÎñºó£¬ÐòÁкŻá³öÏÖ¼ä¸ô¡£
+</p>
+
+<h4><br/><a name="4.12"></a>4.12)ʲôÊÇ <small>OID</small> £¿Ê²Ã´ÊÇ <small>CTID</small> £¿</h4>
+<p>
+ PostgreSQL Àï´´½¨µÄÿһÐмǼ¶¼»á»ñµÃÒ»¸öΨһµÄ<small>OID</small>£¬³ý·ÇÔÚ´´½¨±íʱʹÓÃ<small>WITHOUT OIDS</small>Ñ¡Ïî¡£
+ <small>OID</small>´´½¨Ê±»á×Ô¶¯Éú³ÉÒ»¸ö4×Ö½ÚµÄÕûÊý£¬ËùÓÐ OID ÔÚÕû¸ö PostgreSQL ÖоùÊÇΨһµÄ¡£ È»¶ø£¬ËüÔÚ³¬¹ý40ÒÚʱ½«Òç³ö£¬
+ <small>OID</small>´Ëºó»á³öÏÖÖظ´¡£PostgreSQL ÔÚËüµÄÄÚ²¿ÏµÍ³±íÀïʹÓà OID ÔÚ±íÖ®¼ä½¨Á¢ÁªÏµ¡£
+</p>
+<p>
+ ÔÚÓû§µÄÊý¾Ý±íÖУ¬×îºÃÊÇʹÓÃ<small>SERIAl</small>À´´úÌæ<small>OID</small>
+ ÒòΪ<small>SERIAL</small>Ö»ÊDZ£Ö¤ÔÚµ¥¸ö±íÖÐÊý¾ÝÊÇΨһµÄ£¬ÕâÑùËüÒç³öµÄ¿ÉÄÜÐԾͷdz£Ð¡ÁË£¬
+ <small>SERIAL8</small>¿ÉÓÃÀ´±£´æ8×Ö½ÚµÄÐòÁкÅ×ֶΡ£
+</p>
+
+<p>
+ <small>CTID</small> ÓÃÓÚ±êʶ´ø×ÅÊý¾Ý¿é£¨µØÖ·£©ºÍ£¨¿éÄÚ£©Æ«ÒƵÄÌض¨µÄÎïÀíÐС£
+ <small>CTID</small> ÔڼǼ±»¸ü¸Ä»òÖØÔغó·¢Éú¸Ä±ä¡£Ë÷ÒýÈë¿ÚʹÓÃËüÃÇÖ¸ÏòÎïÀíÐС£
+</p>
+
+
+<h4><a name="4.13"></a>4.13)ΪʲôÎÒÊÕµ½´íÎóÐÅÏ¢¡°<i>ERROR: Memory exhausted in AllocSetAlloc()</i>¡±£¿</h4>
+<p>
+ ÕâºÜ¿ÉÄÜÊÇϵͳµÄÐéÄâÄÚ´æÓùâÁË£¬»òÕßÄں˶ÔijЩ×ÊÔ´Óнϵ͵ÄÏÞÖÆÖµ¡£ÔÚÆô¶¯ postmaster ֮ǰÊÔÊÔÏÂÃæµÄÃüÁ
+</p>
+<pre>
+ ulimit -d 262144
+ limit datasize 256m
+</pre>
+<p>
+ È¡¾öÓÚÄãÓÃµÄ shell£¬ÉÏÃæÃüÁîÖ»ÓÐÒ»ÌõÄܳɹ¦£¬µ«ÊÇËü½«°ÑÄãµÄ½ø³ÌÊý¾Ý¶ÎÏÞÖÆÉèµÃ±È½Ï¸ß£¬
+ Òò¶øÒ²ÐíÄÜÈòéѯÍê³É¡£ÕâÌõÃüÁîÓ¦ÓÃÓÚµ±Ç°½ø³Ì£¬ÒÔ¼°ËùÓÐÔÚÕâÌõÃüÁîÔËÐк󴴽¨µÄ×Ó½ø³Ì¡£
+ Èç¹ûÄãÊÇÔÚÔËÐÐSQL¿Í»§¶ËʱÒòΪºǫ́·µ»ØÁËÌ«¶àµÄÊý¾Ý¶ø³öÏÖÎÊÌ⣬ÇëÔÚÔËÐпͻ§¶Ë֮ǰִÐÐÉÏÊöÃüÁî¡£
+</p>
+
+<h4><a name="4.14"></a>4.14)ÎÒÈçºÎ²ÅÄÜÖªµÀËùÔËÐÐµÄ PostgreSQL µÄ°æ±¾£¿</h4>
+<p>
+ ´Ó psql ÀÊäÈë <code>SELECT version();</code>Ö¸Áî¡£
+</p>
+
+<h4><a name="4.15"></a>4.15)ÎÒÈçºÎ´´½¨Ò»¸öȱʡֵÊǵ±Ç°Ê±¼äµÄ×ֶΣ¿</h4>
+<p>
+ ʹÓà CURRENT_TIMESTAMP£º
+</p>
+<pre>
+ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
+</pre>
+
+
+<h4><a name="4.16"></a>4.16)ÎÒÔõÑù½øÐÐ outer join £¨ÍâÁ¬½Ó£©£¿</h4>
+<p>
+ PostgreSQL ²ÉÓñê×¼µÄ SQL Óï·¨Ö§³ÖÍâÁ¬½Ó¡£ÕâÀïÊÇÁ½¸öÀý×Ó£º
+</p>
+<pre>
+ SELECT *
+ FROM t1 LEFT OUTER JOIN t2 ON (t1.col = t2.col);
+</pre>
+<p>»òÊÇ</p>
+<pre>
+ SELECT *
+ FROM t1 LEFT OUTER JOIN t2 USING (col);
+</pre>
+<p>
+ ÕâÁ½¸öµÈ¼ÛµÄ²éѯÔÚ t1.col ºÍ t2.col ÉÏ×öÁ¬½Ó£¬²¢ÇÒ·µ»Ø t1 ÖÐËùÓÐδÁ¬½ÓµÄÐУ¨ÄÇЩÔÚ t2 ÖÐûÓÐÆ¥ÅäµÄÐУ©¡£
+ ÓÒ[Íâ]Á¬½Ó(RIGHT OUTER JOIN)½«·µ»Ø t2 ÖÐδÁ¬½ÓµÄÐС£
+ ÍêÈ«ÍâÁ¬½Ó£¨FULL OUTER JOIN£©½«·µ»Ø t1 ºÍ t2 ÖÐδÁ¬½ÓµÄÐС£
+ ¹Ø¼ü×Ö OUTER ÔÚ×ó[Íâ]Á¬½Ó¡¢ÓÒ[Íâ]Á¬½ÓºÍÍêÈ«[Íâ]Á¬½ÓÖÐÊÇ¿ÉÑ¡µÄ£¬ÆÕͨÁ¬½Ó±»³ÆΪÄÚÁ¬½Ó£¨INNER JOIN£©¡£
+</p>
+
+
+<h4><a name="4.17"></a>4.17)ÈçºÎʹÓÃÉæ¼°¶à¸öÊý¾Ý¿âµÄ²éѯ£¿</h4>
+<p>
+ ûÓа취²éѯµ±Ç°Êý¾Ý¿âÖ®ÍâµÄÊý¾Ý¿â¡£
+ ÒòΪ PostgreSQL Òª¼ÓÔØÓëÊý¾Ý¿âÏà¹ØµÄϵͳĿ¼£¨ÏµÍ³±í£©£¬Òò´Ë¿çÊý¾Ý¿âµÄ²éѯÈçºÎÖ´ÐÐÊDz»¶¨µÄ¡£
+</p>
+<p>
+ ¸½¼ÓÔöֵģ¿écontrib/dblinkÔÊÐí²ÉÓú¯Êýµ÷ÓÃʵÏÖ¿ç¿â²éѯ¡£µ±È»Óû§Ò²¿ÉÒÔͬʱÁ¬½Óµ½²»Í¬µÄÊý¾Ý¿âÖ´ÐвéѯȻºóÔÚ¿Í»§¶ËºÏ²¢½á¹û¡£
+</p>
+
+<h4><a name="4.18"></a>4.18)ÈçºÎÈú¯Êý·µ»Ø¶àÐлò¶àÁУ¿</h4>
+<p>
+ ÔÚº¯ÊýÖзµ»ØÊý¾Ý¼Ç¼¼¯µÄ¹¦ÄÜÊǺÜÈÝÒ×ʹÓõģ¬ÏêÇé²Î¼û£º
+ <a href="http://techdocs.postgresql.org/guides/SetReturningFunctions">http://techdocs.postgresql.org/guides/SetReturningFunctions</a>
+</p>
+
+<h4><a name="4.19"></a>4.19)ΪʲôÎÒÔÚʹÓÃPL/PgSQLº¯Êý´æÈ¡ÁÙʱ±íʱ»áÊÕµ½´íÎóÐÅÏ¢¡°relation with OID ##### does not exist¡±£¿</h4>
+<p>
+ PL/PgSQL»á»º´æº¯ÊýµÄÄÚÈÝ£¬ÓÉ´Ë´øÀ´µÄÒ»¸ö²»ºÃµÄ¸±×÷ÓÃÊÇÈôÒ»¸ö PL/PgSQL
+ º¯Êý·ÃÎÊÁËÒ»¸öÁÙʱ±í£¬È»ºó¸Ã±í±»É¾³ý²¢Öؽ¨ÁË£¬ÔòÔٴε÷Óøú¯Êý½«Ê§°Ü£¬
+ ÒòΪ»º´æµÄº¯ÊýÄÚÈÝÈÔȻָÏò¾ÉµÄÁÙʱ±í¡£½â¾öµÄ·½·¨ÊÇÔÚ PL/PgSQL ÖÐÓÃ<small>EXECUTE</small>
+ ¶ÔÁÙʱ±í½øÐзÃÎÊ¡£ÕâÑù»á±£Ö¤²éѯÔÚÖ´ÐÐÇ°×ܻᱻÖØнâÎö¡£
+</p>
+
+<h4><a name="4.27"></a>4.27)Ä¿Ç°ÓÐÄÄЩÊý¾Ý¸´ÖÆ·½°¸¿ÉÓã¿</h4>
+<p>
+ ¡°¸´ÖÆ¡±Ö»ÊÇÒ»¸öÊõÓÓкü¸ÖÖ¸´ÖƼ¼Êõ¿ÉʹÓã¬Ã¿ÖÖ¶¼ÓÐÓŵãºÍȱµã£º
+</p>
+<p>
+ Ö÷/´Ó¸´ÖÆ·½Ê½ÊÇÔÊÐíÒ»¸öÖ÷·þÎñÆ÷½ÓÊܶÁ/дµÄÉêÇ룬¶ø¶à¸ö´Ó·þÎñÆ÷Ö»ÄܽÓÊܶÁ/<small>SELECT</small>²éѯµÄÉêÇ룬
+ Ä¿Ç°×îÁ÷ÐÐÇÒÊÇÃâ·ÑµÄÖ÷/´Ó PostgreSQL¸´ÖÆ·½°¸ÊÇ
+ <a href="http://gborg.postgresql.org/project/slony1/projdisplay.php">Slony-I </a>¡£
+</p>
+<p>
+ ¶à¸öÖ÷·þÎñÆ÷µÄ¸´ÖÆ·½Ê½ÔÊÐí½«¶Á/дµÄÉêÇë·¢Ë͸ø¶ą̀µÄ¼ÆËã»ú£¬ÕâÖÖ·½Ê½ÓÉÓÚÐèÒªÔÚ¶ą̀·þÎñÆ÷Ö®¼äͬ²½Êý¾Ý±ä¶¯
+ ¿ÉÄÜ»á´øÀ´½ÏÑÏÖصÄÐÔÄÜËðʧ£¬<a href="http://pgfoundry.org/projects/pgcluster/">Pgcluster</a>ÊÇÄ¿Ç°ÕâÖÖ·½°¸
+ ÖÐ×îºÃµÄ£¬¶øÇÒ»¹¿ÉÒÔÃâ·ÑÏÂÔØ¡£
+</p>
+<p>
+ Ò²ÓÐһЩÉÌÒµÐ踶·ÑºÍ»ùÓÚÓ²¼þµÄÊý¾Ý¸´ÖÆ·½°¸£¬Ö§³ÖÉÏÊö¸÷ÖÖ¸´ÖÆÄ£ÐÍ¡£
+</p>
+
+
+
+</body>
+</html>
+