\documentclass[letterpaper,english]{article}
\nonstopmode
\akai
\usepackage{linuxdoc-sgml}
\usepackage{qwertz}
\usepackage{url}
\usepackage[latin1]{inputenc}
\usepackage{t1enc}
\usepackage[english]{babel}
\usepackage{epsfig}
\usepackage{null}
\def\addbibtoc{
\addcontentsline{toc}{section}{\numberline{\mbox{}}\relax\bibname}
}%end-preamble
\setcounter{page}{1}
\title{ Linux ªº Database-SQL-RDBMS HOWTO ¤å¥ó (PostgreSQL ª«¥óÃöÁp¸ê®Æ®w¨t²Î)}
\author{§@ªÌ¡JAl Dev (Alavoor Vasudevan)        \onlynameurl{alavoor@yahoo.com} \\ 
Ä¶ªÌ¡J´¿¹F±d \onlynameurl{a9504480@graduate.hku.hk}}
\date{¤G¹s¹s¤@¦~¤@¤ë¤G¤é¡A41.0 ª©}
\abstract{¥»¤å¥ó¬O¤@¥÷¤¶²Ð¦p¦ó¦b Unix ¨t²Î§Ö±¶¦a«Ø¥ß¤@­Ó SQL ¸ê®Æ®w¤ÞÀº (Database Engine)
¤Î«eºÝ¤u¨ãªº¡u¹ê¥Î«ü«n¡v¡C¥¦¤]°Q½×°ê»Ú¼Ð·Çªº ANSI/ISO SQL »y¨¥¤Î±´°Q¦b¤¬Ápºô¤¤¡u¶}©ñ¦¡¶}µo¡vÀô¹Ò ("open development" environment) ¶}µo SQL ¸ê®Æ®w¤ÞÀºªºÀuÂI¡C¥¦¬OÃö©ó¦p¦ó¦b Unix ¨t²Î¤¤«Ø¥ß PostgreSQL ³o­Ó¬J¥i¥Î§@À³¥Îµ{¦¡¸ê®Æ®w¦øªA¾¹ (Application Database Server)¡A¤S¥i¥Î§@¸Uºûºô¸ê®Æ®w¦øªA¾¹ (Web Database Server) ªº·s¤@¥Nª«¥óÃöÁp¦¡¸ê®Æ®w¡CPostgreSQL ¹Á¸Õ¹ê½î¤µ«áªº°ê»Ú ISO / ANSI SQL ¼Ð·Ç¡C¥»¤å¥ó¤]´£¨ÑÃö©ó¸ê®Æ®wªº¤¶­±µ{¦¡¡A¦p«eºÝ¹Ï¹³¤¶­±¡BÀ³¥Îµ{¦¡°ª³t¶}µo (Rapid Application Development) ¤u¨ã¡BODBC¡BJDBC ÅX°Êµ{¦¡¡BC¡BC++¡BJava¡BPerl µ{¦¡»y¨¥¤¶­±©Mºô¤W¸ê®Æ®w¤u¨ã¡C³o¸Ì´£¨Ñªº¸ê®Æ¾A¥Î©ó©Ò¦³ Unix / Windows NT ¥­¥x¤Î¨ä¥L¸ê®Æ®w¡A¹ï¸ê®Æ®w¡BSQL »y¨¥¤Î PostgreSQL ªº·s¤â«D±`¦³¥Î¡C³o¤å¥ó¤]¦³¤@­Ó SQL ªº¾É¤Þ¡A¸ÑÄÀ SQL ªº»yªk¡A¹ïªì¾ÇªÌ«D±`¦³¥Î¡C¦³¸gÅçªº¥Î®a·|Ä±±o³o¬O¤@¥÷¦³¥Îªº°Ñ¦Ò¸ê®Æ¡C¹ï¾Ç¥Í¨Ó»¡¡A³o³B´£¨Ñªº¸ê®Æ·|Åý¥L­Ì±o¨ì PostgresSQL ÃöÁp¦¡¸ê®Æ®wªº·½µ{¦¡½X¡A±q¦Ó¾Ç²ß¦p¦ó½s¼g¤@­Óª«¥óÃöÁp¦¡ SQL ¸ê®Æ®w¡C}


\begin{document}
\maketitle
\tableofcontents

\section{¤Þ¨¥}

¥»¤å¥óªº¥D­n¥Ø¼Ð¬O´£¨Ñ¤@­ÓÃö©ó§Ö±¶¦a³]©w PostgreSQL ªº URL 
ªº¸ÔºÉ¦W³æ¡A©M´£­Ò¶}©ñ­ì©l½X¨t²Î¡A¦p PostgreSQL¡BLinux ªº¦n³B¡C

¥@¬É¤Wªº¨C¤@³¡¹q¸£³£»Ý­n¤@­Ó¸ê®Æ®w¨Ó¦s¨ú¸ê®Æ¡C§A¨Ï¥Î¹q¸£¥D­n²z¥Ñ¬O¥Î¨ÓÀx¦s¡B
Åª¨ú©M³B²z¸ê®Æ¡A¦Ó¥B¥¦­Ì­n«Ü§Ö§¹¦¨¤u§@¡A±q¦Ó¸`¬Ù§Aªº®É¶¡¡C¦P®É¡A¨t²Î¥²¶·Â²³æ¡B
§¹¾ã¡B§Ö³t¡B¥i¾a¡B¸gÀÙ©M©ö¥Î¡C¸ê®Æ®w¬O³Ì{\bfseries ­«­nªº¨t²Î}¡A
¦]¬°¥¦Àx¦s¤F¥@¬É¤W¨C¤@¶¡¤½¥qªºÃöÁä¸ê®Æ¡C¥@¤Wªº¨C¤@¶µ¤u·~³£»Ý­n¤@­Ó¸ê®Æ®w¨t²Î¡C
¨S¦³ªº¸Ü¡A¹q°T¡B¨T¨®¡B»È¦æ¡B¯èªÅ¤½¥qµ¥¤u·~³£¤£¯à¦³®Ä¹B§@¡C
³Ì¬y¦æªº¸ê®Æ®w¨t²Î³£¸ò±q°ê»Ú¼Ð·Ç²ÕÂ´ (International Standard Organisation, 
ISO) ªº³W®æ©M ANSI SQL¡]¬ü°ê¡^¼Ð·Ç¡C·~¬É±`¥Îªº³Ì·s³W®æ¬O ISO/ANSI SQL 
1992¡C¤U¤@­Ó¼Ð·Ç¬O SQL 1998/99¡A¤S¦W SQL-3¡A³o¤´¦b¶}µo¤¤¡C¬y¦æªº¸ê®Æ®w¡A¦p 
Oracle¡ASybase ©M Informix ³£¬O®Ú¾Ú³o¨Ç¼Ð·Ç¡A©Î¹Á¸Õ¹ê¬I³o¨Ç¼Ð·Ç¡C

¨S¦³¦p ANSI/ISO SQL 
ªº¼Ð·Ç¡A¥Î¤á­n¤@¦¸«Ø¥ß¤@®M¾A¥Î©ó©Ò¦³¸ê®Æ®w¨t²ÎªºÀ³¥Î³n¥ó·|«D±`§xÃø¡C
«È¤á§Æ±æ¤@¦¸¹L¨Ï¥Î ISO SQL¡AODBC¡AJDBC 
µo®i¤@­ÓÀ³¥Î³n¥ó¦Ó¦b¥@¤W©Ò¦³ªº¸ê®Æ®w¨t²ÎÀ³¥Î¡C

¥@¤W¦Û¥Ñ¦Ó¤ä´© ISO SQL¡BANSI SQL/98¡BSQL/92 ©M ANSI SQL/89 ªºÃöÁp¦¡¸ê®Æ®w 
(RDBMS) ¤¤¡A³Ì¬y¦æªº¬O PostgreSQL¡CPostgreSQL ¬O·s¤@¥Nªºª«¥óÃöÁp¦¡¸ê®Æ®w¡A
¥H¥þ­±²Å¦X ISO/ANSI µ¥ SQL ¼Ð·Ç¬°¥Ø¼Ð¡C§K¶Oªº RDBMS ¤¤¡APostgreSQL 
¬O°ß¤@¦P®É¤ä´©ª«¥ó¸ê®Æ®w©M SQL ªº¡C¥»¤å¥ó·|§i¶D§A¦p¦ó¦w¸Ë³o¸ê®Æ®w¡B
¦p¦ó«Ø¥ßºô¤W¸ê®Æ®w¡BÀ³¥Î³n¥ó¸ê®Æ®w¡B«eºÝ¹Ï¹³¤¶­±©M¤¶­±µ{¦¡¡C
§Ú±j¯P«ØÄ³§A©Ò¼gªº¸ê®Æ®w³n¥ó¥²¶·¦Ê¤À¦Ê²Å¦X ISO/ANSI SQL¡BODBC¡BJDBC 
µ¥¼Ð·Ç¡A³o¼Ë¡A¨Ï±o§Aªºµ{¦¡¯à²¾´Ó¨ì¤£¦Pªº¸ê®Æ®w¡A¦p PostgreSQL¡BOracle¡B
Sybase¡BInformix µ¥¡C

§A¥i±q PostgreSQL ±o¨ì³Ì°ª½è¯À¤Î«D±`Â×´Iªº¥\¯à¡A¦]¬°¥¦¨Ì±q¡u¶}©ñ­ì©l½X¶}µo¼Ò¦¡¡v
(Open Source Code development model)¡C¶}©ñ­ì©l½X¼Ò¦¡·|µ¹§A§¹¾ãªº·½µ{¦¡½X¡A
¶}µo¹Lµ{¦b¤¬Ápºô¤W¥Ñ¦³·¥¤j¶qªº¤H¤â¶i¦æ¡C
¥Ø«eªºÁÍ¶ÕÅã¥Ü¥¼¨Ó¤j³¡¤Àªº³n¥ó¶}µo¤u§@·|¦b¥@¬É³q¦æªº©Ò¿×¡u¸ê°T°ª³t¤½¸ô¡v 
(Information Super-Highway) ¤W¶i¦æ¡C¥¼¨Ó¼Æ¦~¡A¤¬Ápºô·|Ãz¬µ©Ê¦a¦¨ªø¡A
³o¼Ë·|«P¦¨·~¬É§ó¦h¨Ï¥Î PostgreSQL¡C

ÂÇ§â²Î­p¾Ç¡B¼Æ¾Ç©M¬ì¾Çªº­ì²zÀ³¥Î©ó³n¥ó½è¯À¡A§Ú­Ì¥u·|¦b¤@­Ó¦p PostgreSQL 
¯ë¡A§â­ìµ{¦¡½X¶}©ñµ¹¸g¸ê°T°ª³t¤½¸ô³sÃ´¦b¤@°_ªº¤j¶qÀY¸£ªº¨t²Î¤U¡A
¤~¯à±o¨ì³Ì°ª½è¯Àªº³n¥ó¡C¥¿©Ò¿×¶°«ä¼s¯q¡C
¶}©ñ­ì©l½Xªº¼Ò¦¡¤]¥i¨¾¤î{\bfseries ­«ÂÐ¤u§@}¡A«D±`¸gÀÙ¡A
¸`¬Ùµo§G®É¶¡¤Î¦X²Å¦³ÃöÀu¤Æ°ê®a©M¦a²y¸ê·½ªº²{¥N¸gÀÙ©w«ß¡C¥u­n¦³¤H¼g¦n¤F¤@­Ó³n¥ó¡A
§A«K{\bfseries ¤£}»Ý­n¦A¨Ó¤@¦¸¡C§A¤£·|§âÄ_¶Qªº®É¶¡®ö¶O©ó{\bfseries ¦­¤w°µ¦n}ªº¤u§@¡C
¤@¤o¥ú³±¤@¤oª÷¡A§A­n¦n¦n§Q¥Î¡A¦]¬°¤H¤@¤Ñ¥u¦³¤K¤p®É¤u§@¡I¦b§Ú­Ì½ñ¤J¤Ü¤@¥@¬ö®É¡A
§Ú­Ì¨ú±o©Ò»Ý³n¥óªº¤èªk±N·|§ïÅÜ¡C¨C¤Hªº²Ä¤@¿ï¾Ü³£±N·|¬O¦p PostgreSQL¡BLinux 
µ¥¶}©ñ­ì©l½X¨t²Î¡C

ÁÊ¶R¥i°õ¦æªº³n¥ó¤£¥Nªí§A¾Ö¦³³n¥ó¡C­ìµ{¦¡½X¬O¬Ã¶Qªº¸ê²£¡A¤G¤¸ÀÉ¨ÃµL»ù­È¡C
ÁÊ¶R³n¥ó{\itshape ¥i¯à\/}·|¦¨¬°¾ú¥v¡C§A¥u»Ý­n¶R¦nªºµw¥ó¡A
ªá¿ú¦bµw¥ó¤W¦Ó±q¤¬Ápºô¤W¨ú±o³n¥ó¬O­È±oªº¡C­«ÂI¬O{\bfseries ¤u§@¶q¤j}ªº¹q¸£µw¥ó¡C
µw¥ó¤~¬O¯u¥¿¶]°Êªº°¨¤Ç¡A³n¥ó¥u¬OÃ@µ¦¨e¡C¹q¸£µw¥óªº½ÆÂøµ{«×¨Ï±o¥þ²y¥u¦³ 6 
­Ó°ê®aªí²{¥X³]­p¤Î¥Í²£¹q¸£´¹¤ù©Mµw¥óªº¯à¤O¡C³o¬O¤@ºØ¥ý¶iªº¬ì§Þ¡A¹Lµ{«D±`½ÆÂø¡A
¸êª÷±K¶°¡A³]¼t¤Î¥Í²£ 0.18¡]¬Æ¦Ü¤p©ó 0.18¡^·L¦Ì¬ì§Þªº¾÷¾¹§ë¸êÃe¤j¡C
¦b¤@¤p¤ù´¹¤ù¤W«K¦³¼Æ¥H¦Ê¸U­pªº¥b¾ÉÅé©M¹q¸ôÀ½¦b¤@°_¡CApplied 
Material¡BAMD¡B­^¯Sº¸¡BCyrix¡B¤é¥ß¡BIBM ¤Î¨ä¥L¤u¥qªá¶O¤j¶q¤H-¦~ (man-years) 
¦b°ª¬ì§Þ¡A¦p´¹¤ù³]­p¡B·L¹q¤l (Micro-electronics) ¤Î¯Ç¹q¤l (Nano-electronics) 
ªº¬ã¨s¤W¡C·L¦Ì¥Nªí¦Ê¸U¤À¤§¤@¦Ì (10\^{}-6)¡A¯Ç¦Ì¥Nªí¤Q»õ¤À¤§¤@¦Ì 
(10\^{}-9)¡C²{¤µ·L¹q¤l§Þ³N¤¤¡A0.35 ·L¦Ìªº¨Ï¥Î¾T§@¾ÉÅé¡A0.25 ·L¦Ìªº¨Ï¥Î»É¡C
¦b¤£¤[ªº±N¨Ó¡A¥Î»Éªº 0.10 ·L¦Ì§Þ³N¡A¬Æ­P¯Ç¹q¤l§Þ³N±N·|À³¥Î©ó¹q¸£´¹¤ù¡C
¦]¬°»É¾É¹q¯à¤O¸û±j¡A¾T¾ÉÅé±N·|³Q²^¨O¡C¦b¨è»k´¹¤ù (photolithography) ªº¹Lµ{¤¤¡A
·¥°ªÀWªºµµ¥~½u¡BX-®g½u©Î¹q¤l§ô·|³Q¥Î©ó¨è»k (etch) ¯S¼x¤j¤p (feature size) ¤p©ó 
0.15 ·L¦Ìªº¹q¸ô¡C¤µ«á¤G¤Q¦~¡Aª¿¤ù±N·|³Q¤À¤l¹q¸£ (molecular computers) 
©M¥Íª«´¹¤ù (bio chips) ¨ú¥N¡C¥¦­Ìªº³t«×±N·|¤ñª¿¤ù§Ö¼Æ¤Q»õ­¿¡I¤À¤l¬O¤@²Õ­ì¤l¡C
¦Ó·L¤pªº­ì¤l²Õ¦¨§A¦b¥@¤W©Ò¨£ªº©Ò¦³ª«¥ó¡C
¤À¤l¹q¸£·|¥Îª«½èªº¤À¤l¨Ó·í¶W§Öªº¹q¤l¶}Ãö¨î¡C¶}¨î (ON) ¥Nªí 1¡BÃö³¬ (OFF)
¥Nªí 0¡C¥@¤W©Ò¦³¹q¸£µ{¦¡³£¬O®Ú¾Ú¤G¤¸¼Æ¡]¼Æ¦r 1 ©M 0¡^¹B§@¡C



¤Uªí¦C¥X´¹¤ù§Þ³Nªº¶i¨B¤Î¥¼¨Óµo®iÁÍ¶Õ¡C
\begin{tscreen}
\begin{verbatim}
                                 ¥¼¨Ó´¹¤ù¯à¤Oªº¶i®i
                                 ******************
+--------------------------+---------+---------+---------+---------+--------+---------+---------+
| ¶µ¥Ø/¦~¥÷                | 1997    | 1999    | 2001    | 2003    | 2012   | 2020    | 2030    |
+--------------------------+---------+---------+---------+---------+--------+---------+---------+
| ¯S¼x¤j¤p¡]·L¦Ì¡^         | 0.25    | 0.18    | 0.15    | 0.13    | 0.05   |< 0.00001|  ­ì¤l   |
+--------------------------+---------+---------+---------+---------+--------+---------+---------+
| ´¹¤ù¤j¤p¡]­½¦Ì¡^         | 200     | 300     | 300     | 300     | 450    |¥Íª«/¤À¤l|  ¶q¤l   |
+--------------------------+---------+---------+---------+---------+--------+---------+---------+
| ³Ì§C¹B¦æ¹qÀ£             | 1.8-2.5 | 1.5-1.8 | 1.2-1.5 | 1.2-1.5 | 0.5-0.6| < 0.001 |  ·¥¤p   |
+--------------------------+---------+---------+---------+---------+--------+---------+---------+
| ³Ì¤j¥\²v®ø¯Ó             | 70      | 90      | 110     | 130     | 175    | 600     |  ·¥¤p   |
+--------------------------+---------+---------+---------+---------+--------+---------+---------+
| ¹B¦æÀW²v (MHz)           | 750     | 1,250   | 1,500   | 2,100   | 10,000 | > 50,000|  -----  +
+--------------------------+---------+---------+---------+---------+--------+---------+---------+
| DRAM ®e¶q                | 256 MB  | 1 GB    | 2 GB    | 4 GB    | 256 GB | > 1000GB|  -----  |
+--------------------------+---------+---------+---------+---------+--------+---------+---------+
\end{verbatim}
\end{tscreen}

¦p§A©Ò¨£¡Aµw¥ó¤~­«­n©M»Ý­n°ª¬ì§Þ¡A³n¥ó«h»Ý­n¤H¤â¡A¦ý©Ò¥Îªº¬ì§Þ´N¤ñ¸ûÂ²³æ¡C

¥t¤@¤è­±¡A¥@¤W¨C°ê®a³£·|µo®i³n¥ó¡C¨Æ¹ê¤W¡A
¥@¤W¥ô¦ó¤@­Ó¾Ö¦³¤@³¡§C»ù¹q¸£ªº¤H³£¥i½s¼g³n¥ó¡C

¹³ Oracle¡AInformix¡ASybase¡AIBM DB2 (Unix) µ¥¸ê®Æ®w¡A³£¬O¥Î "C" »y¨¥¼g¦¨¡A
¤G¤¸ÀÉ«h¬O¥Î½sÄ¶¾¹²£¥Í¡A³o¼Ë«K¥i°âµ¹¥Î¤á¤F¡COracle¡BSybase¡BInformix 
¸ê®Æ®w¬O¦Ê¤À¦Êªº C µ{¦¡¡I¡I



¤Q¥|¦~¨Ó¡A¤H­Ì¤w¦b PostgreSQL ¤W°µ¤F«Ü¦h¤u§@¡A±qÀY³Ð³y¥t¤@­Ó²Å¦X ANSI/ISO SQL 
ªº¸ê®Æ®w¨t²Î¨Ã¤£¦X²Å±`²z¡C¦b PostgreSQL ªº·½µ{¦¡¤W¥[¤W¤í¯Êªº¥\¯à©Î±N¤§¥[±j¡A
¤§«á¥ß¨è¨Ï¥Î¡A¦³«Ü¤j¦n³B¡C

¾Ú¦ô­p¡A¹ï¡u¤¬Ápºô²£«~¡vªº»Ý¨D±N·|¥H«ü¼Æ¯Å¼Æ (exponentially) 
¼Wªø¡A¦]¬°¥¦¥iºûÃ´¤@¸s°ª½è¯À¡B§C»ù¦ÓÃe¤j¼Æ¶qªº¨Ï¥ÎªÌ¤Î¶}µo¤H­û¡C
¤£¨Ï¥Î¡u¤¬Ápºô²£«~¡vªº°ê®a·|¿ù¹L³o³õ¡u¥þ²y¤¬Ápºô­²©R¡v¦Ó³Q¨ä¥L°ê®a¤j¤j©ßÂ÷¡C
³o¬O¦]¬°¤¬Ápºô¥»¨­´N¬O¥@¤W{\bfseries ³Ì¤j}ªº¡u³n¥ó¤½¥q¡v¡A¤]¬O¤j«¬ªº³n¥ó¡uµo¹q¾÷¡v¡I




\subsection{¶q¤l (Quantum) ¹q¸£¡X¡X¶q¤lª«²z¾Ç«Ü¦³¥Î}

¦p§A¦b«eªí¡u¥¼¨Ó´¹¤ù¯à¤Oªº¶i®i¡v©Ò¨£¡A¦b¤j¬ù 2030 ¦~¡APostgreSQL
¤@Ãþ¸ê®Æ®w¨t²Î·|¦b{\bfseries ¶q¤l¹q¸£}¹B¦æ¡C¶q¤l¹q¸£®Ú¾Ú­ì¤l²É¤lªº¯S©Ê¡A¦p±ÛÂà 
(spin) ¤è¦V¨Ó²£¥Íª¬ºA¡C¨Ò¦p¡A¦b¦V¤W±ÛÂà (spin is up) ®É¡A¤@¹Ù²É¤l¥i³Q¬Ý§@{\bfseries ¡§¤@¡¨}¡A¦V¤U±ÛÂà®É¥i³Q¬Ý§@{\bfseries ¡§¹s¡¨}¡C­ì¤l©M¨ä®Ö¤ß¥i¥X²{­«Å| 
(superposition) ªºª¬ºA¡A¨Ï±o¤@¡B¹s©M¨ä¶¡ªº¼Æ­È¥i¦P®Éªí¹F¡CÄyµÛ¤zÂZ­ì¤lªº±ÛÂà¡A
{\bfseries ¶q¤l¦ì} (qubit) ¥i©ñ¦b¤@°_¡A¥O¥¦­Ì¥i·í¤@­Ó¾ãÅé¨Ó¹B§@¡A
¨Ï±o«D½u©Ê­pºâ (nonlinear computational) ¯à¤O{\bfseries »»»»»â¥ý}²{¥N¶W¯Å¹q¸£¡I¡I
¦b­ì¤l¼h­±¡A¶q¤lª«²z¾Ç¦³§U²z¸Ñ­ì¤l²É¤lªºªí²{¡C


\section{ª«²z©w«ß¾A¥Î©ó¹q¸£³n¥ó¡I}

³o³¹·|»¡©ú¬ì¾Ç¦b¤£¦P¨Æª«¡A¦p³n¥ó¡B¦t©z¡B­ì¤l¡B¯à¶q¬Æ¦Ü§A¦Û¤vªº³Ð³y¹Lµ{¤¤§êºt¦p¦ó­«­nªº¨¤¦â¡C¤]·|»¡©ú¬°¦ó¬ì¾Çª¾ÃÑ¦b¨Ï¥Î¬ì¾Çªº²£«~«e«D±`­«­n¡C

¶Àª÷©w«ß¬O¡X{\itshape ¡u§A¤£¥i¥Î¤@¥ó¨Ó¾ú¤£©úªº²£«~¡I¡I¡v\/}³o©w«ß¾A¥Î©ó©Ò¦³ªF¦è¡X
¸ê®Æ®w¨t²Î¡B¹q¸£¨t²Î¡B§@·~¨t²Î¡B¦t©z¬Æ¦Ü§Aªº¨­Åé¡I§Y¬O»¡¡A
§A­n±o¨ì¨t²Î§¹¾ãªº·½µ{¦¡½X©M¸ê®Æ¡C¤F¸Ñ¤HÅé©M¤HÅé¤ºªº­ì¤lªº¹B§@«D±`­«­n¡A¦]¬° 
PostgreSQL¡B·L³nµøµ¡ 95 µ¥³£¬O¤H³yªº¡C

³Ð³y¬O«Ü­«­nªº¤@¨B¡C¨Ï¥Î¬ì¾Çª«¥óªº¤H¥²¶·ª¾¹D¥¦¦p¦ó²£¥Í¡C³o¬Æ¦Ü¾A¥Î©ó¹q¸£¨t²Î©M 
PostgreSQL¡C¤j¦h¼Æ¤H³£¨S¦³¬ì¾Çª¾ÃÑ¡A¦]¦¹¤£ª¾¹D¦p·L³nµøµ¡ NT/95¡BOracle¡B
¤HÅé©M¦t©zµ¥¨t²Î¦p¦ó²£¥Í¡C«Ü¦h¤H¤£ª¾¹D¤°»ò³Ð³y¦t©z©M·L³nµøµ¡ NT/95 
©M¥¦­Ì¤º³¡¬O¤°»ò¡C½ÆÂøªº¨t²Î¥HÂ²³æªº²Õ¦¨³¡¤À«Ø¦¨¡X¡X¦³¤d¤d¸U¸U­Ó¦t©z²£¥Í¤F¡A
¨C­Ó¦t©z³£¬O¤d¤d¸U¸U­Ó¶W¬P¹Î (super-cluster) ²Õ¦¨¡A¨C­Ó¶W¬P¹Î³£¬O¤d¤d¸U¸U­Ó¬P¨t
(galaxy) ²Õ¦¨¡A¨C­Ó¬P¨t³£¬O¤d¤d¸U¸U¹ÙùÚ¬P (star) ²Õ¦¨¡A¦³¨ÇùÚ¬P¨t²Î¤¤¦³¦æ¬P 
(planet)¡A¦Ó¦æ¬P¬O¼Æ¥H¤Q»õ­pªº­ì¤l²Õ¦¨¡C{\itshape ¡]¥@¬É¾ú¥v¤¤¡A
¥u¦b¥j¦L«×{\bfseries ¦³¤@­Ó¤H³Ð³y¤F¤@­Ó¦t©z}¡A¦ý¦b²{¥NªÀ·|¦A¨S¦³µo¥Í¡C
¥@¤W¤£¤Ö°ê®a³£¥¿¹Á¸Õ³Ð³y¦t©z¡C¡^\/}³Ð³y¦t©z¬O¤@¥ó·¥¬°¥ý¶iªº¬ì§Þ¡A
¤ñ¬µ¤¤¼s®q©Mªø±T¡A³y¦¨{\bfseries ®£©Æªº¯}Ãa}ªº­ì¤l¼u¥ý¶i±o¦h¡C
²{¥N®ÖªZ¬J²Ó¤p¤S±j«l¡A¥u»Ý¤@­Ó³o¨Ç®Ö¼u§ë¤J¤Ó¥­¬v§Y¥i¨Ï¦a²y®ø¥¢¡I
ªZ¾¹ªºÅÜ¤ÆµL½a¡I¡I¦b¥j¦L«×ªº¾Ô³õ¤¤´N¥Î¹L®ÖªZ©M¨ä¥L§ó{\bfseries ±j¤O«D¤ZªºªZ¾¹}¡I
·í¦ã§B¯S¡D·R¦]´µ©Z (Albert Eienstein)¡]¤@­Ó¤G¤Q¥@¬ö 00 
¦~¥Nªº¬ì¾Ç®a¡^»¡®ÖªZ¥i¨Ï¤j«°¥«¤H¶¡»]µo®É¡A¨S¦³¤H¬Û«H¥L¡C
¤µ®É¤µ¤é¤]¨S¦³¤H¬Û«H¤H¤O¥i³Ð³y¦t©z¡C

·L³nµøµ¡¤E¤­¤§Ãþ³n¥ó¬O¥H C ©M²Õ¦X»y¨¥¼g¦¨¡A¥u¥Î¨ì 1 ©M
0¡C{\itshape {\bfseries §Ú­Ì©Ò¦íªº³oÃþ¦t©z¬O¥Ñ¨ä¥LªÅ¶¡¤¤¨â²É¤£¬Û¦ü¦Ó¾A¦Xªº­ì¤l²Õ¦X¼²À»¦Ó¦¨¡C}\/}¡]¦³½ìªº¨Æ¦b²É¤l¼²À»{\bfseries ¤§«e­è¦n}µo¥Í¤F¡^
¤HÅé¬O¥Ñ¨â²É¤£¬Û¦ü¦Ó¦X¾Aªº²Ó­M²Õ¦X¼²À»¦Ó¦¨¡I¡I
{\itshape ¡]¦³½ìªº¨Æ¦b²Ó­M¼²À»{\bfseries ¤§«e­è¦n}µo¥Í¤F¡^\/}¤HÃþ¿ò¶Ç¤F¦t©zªº¯S©Ê¡C
§A©Ò¦bªº¦t©z¥H«e¨Ã¤£¦s¦b¡X¡X¦t©z¤¤ªº­ì¤l¨Ã¤£¦s¦b¡A¬Æ¦Ü®É¶¡³£¤£¦s¦b¡I
¦t©z¦b¤jÃz¬µ®É¥X¥Í¡A¶}©lÂX±i¨Ã«ùÄò¦¨ªø¡Cª½¦Ü²{¦b¦t©z¤´¦bÂX±i¡I¡I
¦³¤H¦b¤@­Ó¦W¬°{\bfseries ¡¥Brahma¡¦}ªº¦t©z³Ð³y¤F§A©Ò¦bªº¦t©z¡C
{\itshape {\bfseries ª¾ÃÑ¬O³o­Ó¦t©z¤§¥À¡I¡I}\/}
¡¥Brahma¡¦¦b§A¥Í¬¡ªºÀ¦¨à¦t©z½Ï¥Í¤§«e¤w¸g·R¤W¤F¡¥ª¾ÃÑ¤§¥À¡¦¡I¡I
¨º¹Lµ{©M§A¥X¥Íªº¸g¹L®t¤£¦h¡I¨S¦³¨Ó¦Ûª¾ÃÑ¤§¥Àªºªº¡¥°ò¦]¡¦¡A­n¼g¤@­Ó¤p«¬ªº 'C' 
µ{¦¡¤]¨S¥i¯à¡I¡]Ä¶«ö¡J§¹¥þ¤£©ú¥Õ³o¤@¬q·Q»¡¤°»ò¡A§ó¤£ª¾«ç¼ËÄ¶¤~²Å¦X­ì·N¡A
¤j®a¦pªGª¾¹D¡A½Ð¨Ó¨ç³qª¾¡C¡^

¦³´Â¤@¤é§Ú­Ìªº¦t©z·|Ãö¤W¡]¤@Án¥¨ÅT¤§«á¡^¡A¨ä¤¤ªº©Ò¦³­ì¤l·|§¹¥þ·´·À©M®ø¥¢¡I

¤HÃþ¹ê¦b¬O¦³¥i¯à³Ð³y¦t©zªº¡C¥i¥H³Ð³yªº¦t©zÁ`¼Æ¬O{\bfseries µL­­¤j}¡A
¥i¥H³Ð³yªº§@·~¨t²ÎªºÁ`¼Æ¤]¬O{\bfseries µL­­¤j}¡I¡I¦³¼Æ¥H¦Ê¸U­pªº¦t©z¡A
¥i¤À¬°¤T¤jÃþ¡CµL­­¼Æ¶qªº¦t©z©MµL­­ÅÜ¤Æªº¦hºû­ì¤l (multi-dimensional atoms) 
±Y¶ò¦¨¬°¼Æ­Ó{\itshape °ò¥»ºû¦t©z (primary-dimensional-universe)\/}¡C
«D±`¥ý¶iªº¼Æ¾Ç¤]¤ä«ù³o²z½×¡C

¬ì¾Ç©M²Î­p¾Ç©w«ß¤ä«ù¶}©ñ­ì©l½X¡A¦p PostgreSQL ©M 
Linux¡C¤¬Ápºôªº³t«×»P¤é­Ñ¼W¡A¤]¶V¨Ó¶V¥i¾a¡A¶}©ñ­ì©l½Xªº°Ê¶q (momentum) 
·|¨³³t¼W¥[¡C¥t¥~¡A¦pªG²Î­p¾Ç¤Î¬ì¾Ç©w«ß¥¿½Tªº¸Ü¡A
¤H­Ì§óª`·N¬ì¾Ç©M·í{\bfseries µLª¾}ªº¤H¶}©l¾Ç²ß¬ì¾Ç¡A«Ê³¬¦¡µ{¦¡¿ð¦­·|¦b¥@¤W®ø¥¢¡C

µo®i PostgreSQL ³oÃþ­p¹º»Ý­n¯à¶q©M®É¶¡µ¥¸ê·½¡A¦]¦¹¡APostgreSQL 
¬O¯à¶q©M®É¶¡ªº²£«~¡C¯à¶q©M®É¶¡¥u¯à¦b¬ì¾Ç¤W¸ÑÄÀ¡A©Ò¥Hª«²z¾Ç©M PostgreSQL¡BLinux
¤§Ãþ³n¥ó±M®×¬O¦³ª½±µÃöÁpªº¡C¬ì¾Ç¡]ª«²z¡^©w«ß¾A¥Î©ó¥ô¦ó®É¶¡ªÅ¶¡¡A¥ô¦ó¦æ¬°¡A
¬Æ¦Ü³n¥ó¶}µo¡C

ª«²z¾Ç§Y¨Ï¦b§A»¡¸Ü¡]Ánªi¡^¡B¨B¦æ¡]¦a­±©M¸}¤§¶¡ªº¼¯À¿¤O¡^¡B
¬Ý®Ñ©M½s¼g³n¥ó®É³£µo¥Í§@¥Î¡C¥@¤W©Ò¦³¬ì¾Ç³£´Ó®Ú©ó¼Æ¾Ç¡A¥]¬A 
PostgreSQL¡CPostgreSQL ¨Ï¥Î¤F¼Æ¾Çªº¤@­Ó¤p¤ÀªK¡¥²{¥N¥N¼Æ¡¦(Modern 
Algebra)¡C²{¥N¥N¼Æ³B²z¡¥¶°¦X½×¡¦(Set Theory)¡B¡¥Ãö«Y¥N¼Æ¡¦(Relational 
Algebra)¡B¸s²Õ (Groups)¡BÀô (Rings)¡B¦¬¶° (Collections)¡B¶° (Sets)¡BÁp¦X 
(Unions)¡B¥æ¿ù (Intersections)¡B±Æ¥¸ (Exclusions)¡B°ì (Domains)¡B¦C (Lists) 
µ¥µ¥¡C

PostgreSQL ³oÃþ²£«~¤§©Ò¥H¦s¦b¡A«K¬O¦]¬°¯à¶q©M®É¶¡¡C
¦Ó½è¶q©M¯à¶q¬O{\bfseries ¦P¤@}¨Æª«¡I½è¯à¬Û¦Pªº¨Æ¹ê¦b¤@¦Ê¦~«e¤´¥¼¬°¤H©Òª¾¡I
§Y¨Ï¦b{\bfseries ¤µ®É¤µ¤é}¥@¤H¤]¤£ª¾¹D¤¬Ápºô¬O³Ì¤jªº³n¥ó¡uµo¹q¾÷¡v
©M¥@¤W³Ì¤jªº¡u³n¥ó¤½¥q¡v¡C

¸£²Ó­M¦b¤u§@¡]½s¼gµ{¦¡¡^®É·|®ø¯Ó¯à¶q¡A§â¨Ó¦Û­¹ª«ªº¤Æ¾Ç¯àÂà¤Æ¬°¹q¯à¤Î¼ö¯à¡C
§Y¨Ï¦b§A¾\Åª³o¬q¤å¦r®É¡A§Aªº¸£²Ó­M«K·|®ø¯Ó¿U®Æ¤Î¨Ï¥Î¤p¶q¯à¶q¡C¤]´N¬O»¡¡A
¤H¸£¬O¤@¥x¼ö¤O¾Ç¤Wªº¾÷¾¹ (thermodynamic heat engine)¡C¥¿¦]¬°³o¼Ë¡A
¼ö¤O¾Çªº©w«ß¤]¾A¥Î©ó¤H¸£¡A¤]´N¶¡±µ¦a¼vÅT¨ì PostgreSQL ¤@Ãþ³n¥ó¡C

¥@¤W¥i¦³µL­­ºØÃC¦â¡B¹q¸£»y¨¥¡B´¹¤ù³]­p©M²z½×¡A¦ý¤£¥i¯à¦³¤@ºØ§¹¬üªºÃC¦â¡B
¹q¸£»y¨¥¡B³]­p©M¨t²Î¡I§A©Ò¯à±o¨ìªº¥u¬Oªñ¥G§¹¬üªºÃC¦â¡]ªiªø¡^¡B¨t²Î¡B
¸ê®Æ®w©Î²z½×¡I{\bfseries ¤j¦ÛµM´N¹³¤@­Ó{\itshape ¸Uªáµ©\/}}¡X¦³µL­­ºû¼ÆªºªÅ¶¡¡A
¨ä¥LªÅ¶¡²É¤lªºÅÜ­­ÅÜ¤Æ¡A¦ý¥¦­Ì¥þ³¡µ²¦X¬°¤p¼ÆªºªÅ¶¡¡A¤Ï¤§¥çµM¡C

§â¥@¤W¼Æ¦Ê¸Uºô¥Áªº¯à¶qµ²¦X°_¨Ó¡A¨Ï±o«Ø¥ß¤@­Ó{\bfseries ªñ¥G§¹¬ü}ªº¨t²Î
¡]¥]¬A¸ê®Æ®w³n¥ó¡^ÅÜ±o¦³¥i¯à¡C©t´xÃø»ï¡A¦ýÄyµÛºôµ¸§â¤j¶q¤H¤â¶°¦X°_¨Ó¡A
¥L­ÌªºÁ`¯à¶q·|«D±`Ãe¤j¡A¦Ó¥B¥i¶°¤¤©ó«Ø¥ß¤@­Óªñ¥G§¹¬üªº¨t²Î¡C

¯à¶qªº³æ¦ì¬OµJ¦Õ (Joules)¡A¤dµJ¦Õ©Î¤½¤ç¡A®É¶¡¥H¬í©Î¤p®É¶q«×¡C¥\²v (power) ¬O¯à¶q°£¥H®É¶¡¡A³æ¦ì¬O¥Ë©Î¤d¥Ë¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
        ¨C¤Hªº¯à¶q = y µJ¦Õ
©Î¥H½è¶q¨Ó»¡
        ¨C¤Hªº¯à¶q = y ¤½§J
½è¶q©M¯à¶q¤§¶¡ªºÂà´«¦]¼Æ¬O E = m * c * c¡A'c' ¬O¥ú³t¦Ó 'm' ¬O½è¶q¡C
        ®É¶¡ = 8 ¤p®É¡]³o¬O¤@­Ó±`¼Æ¡A¦]¬°¤@¤H¤@¤Ñ¥u¦³ 8 ¤p®É¡^
        ¥\²v = ¯à¶q / ®É¶¡
             = (y / (8 * 60 * 60)) ¥Ë
        ¥@¬ÉªºÁ`¥\²v = n * (y / (8 * 60 * 60)) ¥Ë
n = °Ñ»P­p¹ºªºÁ`¤H¼Æ¡C
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

±q¥H¤W¤èµ{¦¡¡A«Ü©úÅã¼W¥[ 'n' ·|¤j´T§ïµ½²£«~½è¯À¡Cn
¶V¤j¥\²v¤]¶V¤j¡]¥Î¤d¥Ëªí¥Ü¡^¡C §A¥i¥H·Q¹³¥þ¤¬Ápºô¦³¦h¤Ö¯à¶q¡]¥H¤dµJ¦Õ­pºâ¡^
©M¥\²v¡]¥H¤d¥Ë­pºâ¡^±Mª`©ó Linux ©M PostgreSQL ¤@Ãþ¨t²Î¡I

«Ü©úÅV¡A¤¬Ápºô¥i³sÃ´«Ü¦h¤H¡A¤]´N¬O»¡¤¬Ápºô¦³¤j¶q¯à¶q©M®É¶¡¡A
¥i¥Î¤ñ³n¥ó¤½¥q§óµuªº®É¶¡²£¥Í§ó°ª½è¯Àªº³n¥ó¡C§Y¨Ï¬O·L³n¡BIBM 
µ¥¤j¤½¥q¤]¤£¥i¹H§Üª«²z©w«ß¡A¦Ó¥²·|¦Vª«²z©w«ß{\bfseries §ë­°}¡C

µ²½×¬O¡J¦]¬°¬ì¾Çªº©w«ß¡A¡¥¶}©ó­ì©l½X¡¦¨t²Î¡A¹³ PostgreSQL¡BLinux 
·|¾Ô³Ó¡¥«Ê³¬­ì©l½X¡¦¨t²Î¡A©M¥²·|¤ñ¥¦­ÌÀu²§¡C³o¬O¦³¬ì¾Ç®Ú¾Úªº¡C
¤HÃþ¤£À³®ö¶O®É¶¡³Ð³y¤Ó¦h­«ÂÐªº³n¥ó²£«~¡C


\section{PostgreSQL ¬O¤°»ò¡H}

PostgreSQL ¬O¤@­Ó¦Û¥Ñªº¸ê®Æ®w¡Aµ¹¤©§A§¹¾ãªºµ{¦¡½X¡A¬O¤@­Ó¥H ANSI SQL 1998, 92, 
89 ³W®æ¬°¥Ø¼Ðªºª«¥óÃöÁp¦¡¸ê®Æ®w¨t²Î¡A¥i¦b¤£¦Pªºµw¥ó¥­¥x©M¾Þ§@¨t²Î¤¤¹B¦æ¡C
PostgreSQL ªº³Ì²×¥Øªº¬O¦Ê¤À¦Ê²Å¦X ANSI/ISO SQL ¤Î¦¨¬°¥@¬É²Ä¤@ªº¶}©ñ³q¥Î¸ê®Æ®w¡C

¤µ¤Ñ¡APostgreSQL
¬O¥@¤W{\bfseries ³Ì¥ý¶i}ªº¨t²Î¡C¥O¤H¸Ò²§ªº¬O¡A«Ü¦h°Ó·~ªº¸ê®Æ®w¦b½è¯À¡B
¯S©Ê©M¯à¤O¦U¤è­±³£°l¤£¤W¥¦¡I¡IPostgreSQL 
¬O¦a²y¤W«Ü¦h°ê®aªº¦X§@¦¨ªG¡A¬O¤@­Ó©M{\bfseries °ê»Ú¤ÓªÅ¯¸} (International 
Space Station) ¬Û¦üªº±M®×¡C¦b¥¼¨Óªº¼Æ¤Q¦~¡APostgreSQL 
¤´·|¬O{\bfseries ³Ì¨Îªº¸ê®Æ®w¨t²Î}¡A¦]¬°¥¦¬O¤@­Ó¶}©ñ­ì©l½X¨t²Î¡C

PostgreSQL ­I«áªº°ò¥»·Qªk¬O¡X¥u­n¤@­Ó¼Ò²Õªºµ{¦¡¼g¦n¤F¡A
§A´N¤£À³®ö¶O®É¶¡­«·s¼g¤@¦¸¡A­þºÞ¥uªá¤d¤À¤§¤@¬í¡I¡I

Informix Universal server¡]1997 ¦~±À¥X¡^ªº°òÂ¦¬O PostgreSQL ªº¸ûÂÂª©¥»¡A¦]¬° 
Informix ¦¬ÁÊ¤F Illustra Inc. ¤Î¾ã¦X¨ì Informix¡CIllustra ¸ê®Æ®w¬O®Ú¾Ú 
Postgres¡]PostgreSQL ªº«e¨­¡^¼g¦¨ªº¡C

PostgreSQL ¬O POSTGRES ¸ê®Æ®wºÞ²z¨t²Îªº§ï¨}ª©¡A¤@­Ó·s¤@¥N DBMS ªº¬ã¨s­ì«¬ 
(prototype)¡C¦b«O¯d POSTGRES ±j¤jªº¸ê®Æ¼Ò«¬¤ÎÂ×´Iªº¸ê®Æ«¬ºAªº¦P®É¡A
¥¦¥H¤@­ÓÂX¥R¤Fªº SQL ¤l¶°¨Ó¨ú¥N PostQuel ¬d¸ß»y¨¥¡C

PostgreSQL ¬O¥Ñ¤@¸s°Ñ¥[ PostgreSQL ¶}µo³q«H½×¾Âªº¤¬Ápºô¶}µo¤H­û¶i¦æªº¡C
¥Ø«eªº¨ó½ÕªÌ¬° Marc G. Fournier¡C
\begin{itemize}
\item        \onlynameurl{scrappy@postgreSQL.org}
\end{itemize}

³o¶¤¥î·|­t³d¤µ«á©Ò¦³ PostgreSQL µo®i¤u§@¡C·íµM¡A¸ê®Æ®wªº¥Î¤á¦Û¤v¤]¬O 
PostgreSQL ªº¶}µo¤H­û¡I³o¶}µo¹Lµ{¬O¤À´²¦b¤¬Ápºô¤W¤j¶q¸ê®Æ®w¥Î®aªº¡C

PostgreSQL 1.01 ªº§@ªÌ¬O Andrew Yu ©M Jolly Chen¡CPostgreSQL ªº«e¨­ Postgres 
ªºµ{¦¡½X¡A¬O«Ü¦h¤j¾Ç²¦·~¥Í¡B¥»¬ì¥Í¤Îµ{¦¡³]­p­û¦b University of 
California¡ABerkeley ªº Michael Stonebraker ±Ð±Âªº«ü¾É¤Uªº²£«~¡C

¤w¦³¼Æ¥H¦Ê¸U®M PostgreSQL ³Q¦w¸Ë§@¸ê®Æ®w¦øªA¾¹¡A
ºô¤W¸ê®Æ®w¦øªA¾¹©MÀ³¥Îµ{¦¡¸ê®Æ®w¦øªA¾¹¡C¥¦¬O¤@­Ó«Ü¥ý¶iªºª«¥óÃöÁp¦¡¸ê®Æ®w
¡]ORDBMS¡^¡C

PostgreSQL ¥i¦b Soloris¡BSunOS¡BHPUX¡BAIX¡BLinux¡BIrix¡BDigital Unix¡BBSDi¡B
NetBSD¡BFreeBSD¡BSCO Unix¡BNEXTSTEP¡BUnixware ¤Î©Ò¦³¨ä¥Lªº Unix 
°õ¦æ¡C²¾´Ó¨ìµøµ¡ 95/NT ªº¤u§@¤w¥H Cygnus cygwin32 ®M¥ó§¹¦¨¡C

¥»¤å©Ò­zªº PostgreSQL ©M¦³Ãöª«¥ó¨ü University of California, Berkeley
ªºª©Åv«OÅ@¡C


\subsection{¥Õ¥Ö®Ñ}

PostgreSQL ¸ê®ÆÂ²¤¶¡J

\begin{itemize}
\item   ÃD¥Ø¡J   PostgreSQL SQL RDBMS ¸ê®Æ®w¡]ª«¥óÃöÁp¸ê®Æ®wºÞ²z¨t²Î¡^
\item   ¥Ø«eª©¥»¡J7.0.1        
\item   ¦~ÄÖ¡J   PostgreSQL ¤Q¤­·³¡C¦Û 1985 ¦~¶}©l¶}µo
\item   §@ªÌ¡J   ¤Q¤­¦~¨Ó¤¬Ápºô¤W¼Æ¥H¦Ê¸U­pªº¤j¾Ç©M¤½¥q
\end{itemize}

PostgreSQL ªº¥Õ¥Ö®Ñ¦b \nameurl{http://www.greatbridge.com}{} §ä¨ì¡C




\section{­þ­Ó¸û¦n¡HPostgreSQL ÁÙ¬O MySQL¡H}




\subsection{PostgreSQL ¥´±Ñ Oracle¡BIBM DB2¡BMS SQL server ©M¨ä¥L¡I¡I}

PostgreSQL ¦bªí²{¡B³t«×¡BÂX®i©Ê (scalability) ©M ¥i«H©Ê (reliability) 
¦U¤è­±ªº¼Ð·Ç´ú¸Õ¤¤¥´±Ñ Oracle 8¡]©M 8i¡^¡BIBM DB2¡BMS SQL server¡BSybase¡B
Interbase ©M MySQL¡I

¨ì \nameurl{http://www.aldev.8m.com}{} ©Î \nameurl{http://aldev.webjump.com}{}  
¾\Åª°ò·Ç´ú¸Õµ²ªG¡C

¡]Ä¶«ö¡J¦³Ãö¸Ó´ú¸Õµ²ªG¡A¦³¤£¤Ö¤H´£¥X½èºÃ¡A½Ð°Ñ¾\ \nameurl{http://www.devshed.com/BrainDump/MySQL_Benchmarks/}{}¡^




\subsection{MySQL ©M¨ä¥L­«ÂÐªº RDBMSes}

MySQL ¬O¥t¤@­Ó¶}©ñ­ì©l½Xªº SQL ¦øªA¾¹¡A¦ý¥¦¤£¤ä´©¥æ©ö
(Transaction)¡C¥¦¾A¥Î©ó«D±`¤pªº¸ê®Æ®w¡A¦Ó¤£¤ä´©¥ý¶iªº SQL ¥\¯à¡CPostgreSQL
«h¬O¤@­Ó¥ø·~¯Åªº¸ê®Æ®w¡A¤ä´©¥æ©ö©M´X¥G©Ò¦³ SQL µ²ºc¡CPostgreSQL
¤ñ°Ó·~ªº¸ê®Æ®w¡A¦p Oracle¡BSybase ©M Informix µ¥¥ý¶i±o¦h¡CPostgreSQL
¤ä´©«D±`¥ý¶iªºÂê©w¾÷¨î (locking mechanism) 
©M«Ü¦h¦b°Ó·~¸ê®Æ®w¤¤§ä¤£¨ìªº¥ý¶i¥\¯à¡I¡I

¦b¤£¤[±N¨Ó¡AMySQL ªº¶}µo±N·|°±¤î¡A¦]¬° MySQL ¤]¥H ANSI SQL 
¬°¥Ø¼Ð¡A¬O¤@­Ó­«ÂÐªº²£«~¡C§Ú­Ì­n³Ì¥ý¶i©M¦¨¼ôªº¶}©ñ­ì©l½X SQL 
¦øªA¾¹¡A¦Ó©ß±¼©Ò¦³¨ä¥Lªº¡A¦]¬°§Ú­Ì¨S¦³«Ü¦h®É¶¡¡]¨Ó¹ï¥I¦h­Ó
RDBMS¡^¡I¨Æ¹ê¤W¡A§A³s¥u¹ï¥I¤@­Ó¦p PostgreSQL ¯ë±j«lªº SQL 
¦øªA¾¹ªº®É¶¡¤]¨S¦³¡C©Ò¦³ MySQL ¥ÎªÌ³£·|Âà²¾¨ì PostgreSQL¡C¦Ó¥B¡AMySQL
¬O¤@­Ó¡¥Ãþ°Ó·~¡¦(quasi-commercial) ªº²£«~¡A©M PostgreSQL
¤£¦P¡A«áªÌ¶}©ñ­ì©l½X¡AµL»Ý±ÂÅv¶O¡C¬J¥Í·ì¡A¦ó¥Í«G¡C¦³¤F 
PostgreSQL¡A´N¤£»Ý¦A¦³¥t¤@­Ó SQL ¸ê®Æ®w¨t²Î¤F¡C

¦p MySQL ¤@Ãþªº­«ÂÐ²£«~¨Ï±o¥Î®aµL©Ò¾A±q¡A¤À´²¸ê·½¡C
¤@­Ó{\bfseries ¡§ªñ¥G§¹¬ü¡¨}ªº¨t²ÎÀ³¸Ó¬O{\bfseries ¿W¤@µL¤G}ªº¨t²Î¡A
¥@¤W¨C¤@­Ó¤H³£À³¬°¥¦¤u§@¡I¡I­«ÂÐªº²£«~¹ú¦h©ó§Q¡A¦]¦¹¡Aµ´¤£­È±o¤À´²¸ê·½¡C
³o¤w¦b°Ó·~ªº¸ê®Æ®wµo¥Í¡A¦p Oracle¡BSybase¡BInformix ©M·L³n SQL 
server¡C³o¼Ë·|¨Ï±o¥ÎªÌ¤Àµõ¡A¦Ó¥B²£«~¤¬¤£­Ý®e¡C{\bfseries {\itshape §Ú«o·Q§â SQL 
¦øªA¾¹ªº­ì©l½Xµ¹§A±±¨î¡I¡I¡I\/}}

§A¤£»Ý­n¤W¦Ê­Ó¸ê®Æ®w¨t²Î¡A§A¥u»Ý­n¤@­Ó³Ì¦nªº¸ê®Æ®w¦øªA¾¹¡A¥¦´N¬O¡¥PostgreSQL¡¦¡C

{\bfseries Äµ§i¡J}®Ú¾Ú¤@¥÷¦p ANSI SQL ªº³W®æ¡A¤H­Ì¥i³y¥XµL­­­Ó¸ê®Æ®w¨t²Î¡I¡I

MySQL ¨S¦³¦Ó PostgreSQL ¤ä´©ªº¥\¯à¦p¤U¡X
\begin{itemize}
\item  ¥æ©ö (Transactions)
\item  ¤ºÀxµ{§Ç (Stored Procedures)
\item  ¿Eµo (Triggers)¡]update¡Ainsert ©M delete¡^
\item  ª«¥ó¾É¦V¸ê®Æ®w (Object oriented databases)
\item  ¥ý¶iªº«ÊÂê¨t²Î (Locking systems)¡A¦b¦h¥Î¤á¡B¦h¥æ©öÀô¹Ò¤Uªº¨Ã¦æºÞ²z 
(concurrency management)¡C
\item  ¤l¬d¸ß (Sub-queries)
\item  ¦øªA¾¹ºÝ´å¼Ð (Server-side cursors)
\item  ¬d¸ß§Ö¨ú (Query caching)
\item  ¸ê®Æ®w«ÊÂê (Locking of databases)
\item  ¸û¦nªº³sµ²¤ä´©¡]JOIN¡BUNION¡BMINUS¡BINTERSECT¡Bouter join¡^
\item  «Ü¦h¨ä¥L¥\¯à¡X¡X¦h¤£³Ó¼Æ¡C
\end{itemize}


MySQL ¥i¦b \nameurl{http://www.tcx.se}{} §ä¨ì¡C

¡]Ä¶«ö¡JMySQL ¤w§ï¥H GPL µo¦æ¡C¡^


\section{¦ó³B¨ú±o ?}

§A¥i±q¥H¤U¦a¤èÁÊ¶R Redhat Linux ¥úºÐ¡BDebian Linux ¥úºÐ©Î Slackware Linux 
¥úºÐ¡A±q¤¤§ä¨ì PostgreSQL ®M¥ó¡]­ì©l½X©M¤G¤¸½X¡^¡J
\begin{itemize}
\item Linux System Labs ºô§}¡J\nameurl{http://www.lsl.com/}{}  ¡]7 ¬ü¤¸¡^
\item CheapBytes Inc ºô§}¡J\nameurl{http://www.cheapbytes.com/}{} ¡]7 ¬ü¤¸¡^
\item Debian ¥Dºô§}¡J\nameurl{http://www.debian.org/vendors.html}{}
\end{itemize}


PostgreSQL ²ÕÂ´¤]°â½æ¡¥PostgreSQL CDROM¡¦¡A¤º§t§¹¾ãªº­ì©l½X¡A³\¦h Unix 
¾Þ§@¨t²Îªº¥i°õ¦æÀÉ¤Î§¹¾ãªº¤å¥ó¡C
\begin{itemize}
\item ±q¥Dºô­¶¨ú±o PostgreSQL ¥úºÐ¡J\nameurl{http://www.postgresql.org}{} 
30¡]¬ü¤¸¡^
\end{itemize}


PostgreSQL ¥u§t¤G¤¸ÀÉªºµo¦æª©¥» (distribution)¡J
\begin{itemize}
\item  PostgreSQL RPMs ªººûÅ@¤H¬O Lamer Owen¡A¦b  
\onlynameurl{lamar.owen@wgcr.org} §ä¨ì¡C
\item PostgreSQL ·½ RPM ©M¤G¤¸ RPM \nameurl{http://www.ramifordistat.net/postgres}{}¡C
\item PostgreSQL ·½ RPM ©M¤G¤¸ RPM \nameurl{http://www.postgresql.org}{} ¡CÂI¿ï¡§Latest News¡¨©M Redhat RPMs¡C
\item PostgreSQL ·½ RPM ©M¤G¤¸ RPM \nameurl{http://www.redhat.com/pub/contrib/i386/}{} ¡Cftp ¯¸¥x¦b \nameurl{ftp://ftp.redhat.com/pub/contrib/i386/}{}
\item Solaris, HPUX, AIX, IRIX, Linux ªº¤G¤¸ÀÉ¯¸¥x¡J \nameurl{ftp://ftp.postgresql.org/pub/bindist}{}
\end{itemize}




¸Uºûºôºô¯¸¡J
\begin{itemize}
\item ¥Dºô¯¸¡J\nameurl{http://www.postgresql.org/}{}
\item ¦¸ºô¯¸¡J     \nameurl{http://logical.thought.net/postgres95/}{}
\item                \nameurl{http://www.itm.tu-clausthal.de/mirrors/postgres95/}{}
\item                \nameurl{http://s2k-ftp.cs.berkeley.edu:8000/postgres95/}{}
\item   \nameurl{http://xenium.pdi.net/PostgreSQL/}{}
\item   \nameurl{http://s2k-ftp.cs.berkeley.edu:8000/postgres95/}{}
\end{itemize}




¥H¤U¬° ftp ¯¸¡J
\begin{itemize}
\item ¥D FTP:       \nameurl{ftp://ftp.postgresql.org/pub}{}
\item ¦¸ FTP:     \nameurl{ftp://ftp.chicks.net/pub/postgresql}{}
\item                \nameurl{ftp://ftp.emsi.priv.at/pub/postgres/}{}
\item           \nameurl{ftp://ftp.itm.tu-clausthal.de/pub/mirrors/postgres95}{}
\item                \nameurl{ftp://rocker.sch.bme.hu/pub/mirrors/postgreSQL}{}
\item                \nameurl{ftp://ftp.jaist.ac.jp/pub/dbms/postgres95}{}
\item                \nameurl{ftp://ftp.luga.or.at/pub/postgres95}{}
\item                \nameurl{ftp://postgres95.vnet.net:/pub/postgres95}{}
\item   \nameurl{ftp://ftpza.co.za/mirrors/postgres}{}
\item   \nameurl{ftp://sunsite.auc.dk/pub/databases/postgresql}{}
\item   \nameurl{ftp://ftp.task.gda.pl/pub/software/postgresql}{}
\item   \nameurl{ftp://xenium.pdi.net/pub/PostgreSQL}{}
\end{itemize}




PostgreSQL ªº·½µ{¦¡½X¤]¥i±q sunsite unc 
ªº¬M®g¯¸±o¨ì¡]¥þ²y¦³¤j¬ù¤@¤d­Ó¡^¡C¥¦¬O¦b Redhat Linux µo¦æª©¥» (distribution) 
ªº /pub/contrib/i386/postgresql.rpm ÀÉ¤¤¡C
\begin{itemize}
\item   ­nª¾¹D¦³¤°»ò¬M®g¯¸¡A½Ð¨ì \nameurl{ftp://sunsite.unc.edu}{} 
\end{itemize}



\section{PostgreSQL §Ö³t¦w¸Ë«ü¤Þ \label{Quick-Installation}}

³o¸`·|À°§A¦b¤p©ó¤­¤ÀÄÁ¤º§Ö³t¦w¸Ë©M±Ò°Ê³o¸ê®Æ®w¡C




\subsection{¦w¸Ë©M´ú¸Õ}

¦w¸Ë¡B´ú¸Õ¡B½T»{©M°õ¦æ PostgreSQL ªº¨BÆJ
¥H root ¨­¥÷Ã±¤J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# cd /mnt/cdrom/RedHat/RPMS
# man rpm
# ls postgre*.rpm
# rpm -qpl postgre*.rpm | less ¡]Æ[¬ÝÀÉ®×¦W³æ¡^
# rpm -qpi postgre*.rpm ¡]Æ[¬Ý®M¥ó¸ê®Æ¡^
# cat /etc/passwd | grep postgres
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

ª`·N¡J¦pªG§A¬Ý¨ì¤@­Ó¡¥postgres¡¦¨Ï¥ÎªÌ¡A§A¥i¯à­n³Æ¥÷©M²M°£ postgres ªº®a¥Ø¿ý 
~postgres ©M§R°£³o¦W¥ÎªÌ¡A©Î§â¥L§ï¦W¬°¡¥postgres2¡¦¤§Ãþ¡C¦w¸Ë®É»Ý­n°®°®²b²b¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
:
# rpm -i postgre*.rpm ¡]¥²¶·¦w¸Ë©Ò¦³®M¥ó¡A§Y«È¤áºÝ¡B¶}µo¡B¸ê®Æ©M¥D®M¥ó¨Ó¨Ï 
pgaccess ¥¿±`¤u§@¡^
# man chkconfig
# chkconfig --add postgresql  ¡]¥Î¨Ó¦b¶}¾÷®É¶}©l pg¡C¡^
# /etc/rc.d/init.d/postgresql start ¡]±Ò°Ê postgresql¡^
# man xhost
# xhost +  ¡]Åý pgaccess ¨Ï¥ÎÅã¥Ü¸Ë¸m¡^
# su - postgres
bash$ man createdb
bash$ createdb mydatabase
bash$ man psql
bash$ psql mydatabase
¡K¡K¦b psql ¤¤¥i«ö¤W / ¤U½b©C¨Ó½s¿è¾ú¥v°O¿ý©Î \s

bash$ export DISPLAY=<¥D¾÷¦W>:0.0
bash$ man pgaccess
bash$ pgaccess mydatabase
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

²{¦b§A¥i¥H¦b pgaccess ©Î psql {\bfseries °ª³t¤U¹F}¦UºØ SQL «ü¥O¤F¡I¡I
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ cd /usr/doc/postgresql*
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¦b¦¹¾\Åª©Ò¦³ FAQ¡A¨Ï¥ÎªÌ¡Bµ{¦¡³]­p­û¡BºÞ²z¤â¥U©M«ü¤Þ¡C


\subsection{PostgreSQL RPMs}

¦¹¥~¡A½Ð¬Ý \nameurl{http://www.ramifordistat.net/postgres}{} ªº 
{\itshape "Installation Steps"\/}¡C

PostgreSQL RPM ¥Ñ Lamar Owen ºûÅ@¡A¦ì©ó
\onlynameurl{lamar.owen@wgcr.org}
¦b \nameurl{http://www.postgresql.org}{} ¥i§ä¨ì§ó¦h PostgreSQL ªº¸ê®Æ¡C


\subsection{Maximum RPM}

¼ô²ß RedHat RPM ®M¥óºÞ²z­û¥HºÞ²z PostgreSQL ¦w¸Ë¡C¦b 
\nameurl{http://www.RPM.org}{} ¤U¸ü¡¥Maximum RPM¡¦¤@®Ñ¡A§ä´MÀÉ¦W
maximum-rpm.ps.gz¡C
¦b Linux ¨Ï¥Î gv «ü¥O¾\Åª¥¦¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# gv maximum-rpm.ps.gz
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¦³¤@­Ó rpm2deb ¥i§â RPM ®M¥óÂà´«¬° Debian Linux ®M¥ó


\subsection{¨Ò¤l RPM \label{Examples RPM}}

´ú¸Õ PostgreSQL ªº¦UºØ¤¶­±»Ý­n¨Ò¤l¡C±q¥H¤U¦a¤è¦w¸Ë PostgreSQL ¨Ò¤l¥Ø¿ý¡X
\begin{itemize}
\item  Linux ¥úºÐ - postgresql-*examples.rpm
\item  postgresql-*examples.rpm  \nameurl{http://www.aldev.8m.com}{} 
©Î \nameurl{http://aldev.webjump.com}{}
\item  PostgreSQL ­ìµ{¦¡½X postgresql*.src.rpm¡A¦b examples¡Btesting ©Î 
tutorial ¥Ø¿ý´M§ä¡C
\end{itemize}



\subsection{´ú¸Õ PyGreSQL¡XPython ¤¶­± \label{Testing PyGreSQL}}

¦w¸Ë examples ®M¥ó¡A½Ð°Ñ¾\ \ref{Examples RPM} {(¨Ò¤l RPM)}¡A¤§«á¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ cd /usr/lib/pgsql/python
bash$ createdb thilo
bash$ psql thilo
thilo=> create table test (aa char(30), bb char(30) );
thilo=> \q
bash$ /usr/bin/python
>>> import _pg
>>> db = _pg.connect('thilo', 'localhost')
>>> db.query("INSERT INTO test VALUES ('ping', 'pong')")
>>> db.query("SELECT * FROM test")
eins|zwei
----+----
ping|pong
(1 row)
>>>CTRL+D
bash$
¡K¡K¦n¹³¦æ¤F¡X²{¦b¥¿¦¡¦w¸Ë¥¦
bash$ su - root
# cp /usr/lib/pgsql/python/_pg.so /usr/lib/python1.5/lib-dynload
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{´ú¸Õ Perl¡XPerl ¤¶­± \label{Testing Perl}}

¦w¸Ë examples ®M¥ó¡A½Ð°Ñ¾\ \ref{Examples RPM} {(¨Ò¤l RPM)}¡A¤§«á¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
root# chown -R postgres.postgres /var/lib/pgsql/examples
bash$ cd /var/lib/pgsql/examples/perl5
bash$ perl ./example.pl
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

ª`·N¡J¦pªG¥H¤W«ü¥O¥¢±Ñ¤F½Ð°µ¦p¦¹°µ¡J¥þ°ìÅÜ¼Æ @INC ­n¦b¥]¬A site\_perl ¥Ø¿ý¤¤ªº 
Pg.pm ¼Ò²Õ¡A©Ò¥H­n¦p¤U¨Ï¥Î
-I ¿ï¶µ¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ perl -I/usr/lib/perl5/site_perl/5.004/i386-linux-thread ./example.pl
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¡K¡K§Aªº perl ¤w¦b¦s¨ú PostgreSQL ¸ê®Æ®w¡I¡I

­n¨Ï¥Î perl ¤¶­±¡A½Ð°Ñ¾\ example.pl ÀÉ¡C


\subsection{´ú¸Õ libpq, libpq++ ¤¶­± \label{Testing libpq}}

¦w¸Ë examples ®M¥ó¡A½Ð°Ñ¾\ \ref{Examples RPM} {(¨Ò¤l RPM)}¡A¤§«á¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
root# chown -R postgres.postgres /var/lib/pgsql/examples
bash$ cd /var/lib/pgsql/examples/libpq
bash$ gcc testlibpq.c -I/usr/include/pgsql -lpq
bash$ export PATH=$PATH:.
bash$ a.out

bash$ cd /var/lib/pgsql/examples/libpq++
bash$ g++ testlibpq0.cc -I/usr/include/pgsql -I/usr/include/pgsql/libpq++
-lpq++ -lpq -lcrypt
bash$ ./a.out ¡]ª`·N¡J¤£¶·²z·|¿ù»~°T®§¡X¦p¤U¡^
> create table foo (aa int, bb char(4));
No tuples returned...
status = 1
Error returned: fe_setauthsvc: invalid name: , ignoring...
> insert into foo values ('4535', 'vasu');
No tuples returned...
status = 1
Error returned: fe_setauthsvc: invalid name: , ignoring...
> select * from foo;
aa   |bb   |
-----|-----|
4535 |vasu |
Query returned 1 row.
>
>CTRL+D
bash$
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¡K¡K§Aª½±µ¥Î C/C++ ¤¶­±¨Ó¦s¨ú PostgreSQL ¸ê®Æ®w¡I¡I


\subsection{´ú¸Õ Java ¤¶­± \label{Testing Java}}

¦w¸Ë examples ®M¥ó¡A½Ð°Ñ¾\ \ref{Examples RPM} {(¨Ò¤l RPM)} 
©M¦w¸Ë¥H¤UªF¦è¡C
\begin{itemize}
\item  ±q \nameurl{ftp://ftp.redhat.com/pub/contrib/i386}{} ©Î 
\nameurl{http://www.blackdown.org}{} ¨ú±o JDK jdk-*glibc*.rpm 
\item  ±q \nameurl{ftp://ftp.redhat.com/pub/contrib/i386}{} ¨ú±o 
postgresql-jdbc-*.rpm
\end{itemize}

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
root# chown -R postgres.postgres /var/lib/pgsql/examples
bash$ cd /var/lib/pgsql/examples/jdbc
bash$ echo $CLASSPATH
 --> À³Åã¥Ü CLASSPATH=/usr/lib/pgsql/jdbc7.0-1.2.jar:.:/home/java/jdk1.2.2/lib:/usr/lib/pgsql:/usr/lib/pgsql/classes.zip:/usr/lib/pgsql/pg.jar

¦Ó jdbc*.jar ªºª©¥»¸¹½X­n¥¿½T¡C
*.jar ÀÉ­n©ñ¦b /usr/lib/pgsql ©M  /usr/libjdk*/lib ¥Ø¿ý¤¤¡C

bash$ export CLASSPATH=/usr/lib/pgsql/jdbc7.0-1.2.jar:.:/home/java/jdk1.2.2/lib:/usr/lib/pgsql:/usr/lib/pgsql/classes.zip:/usr/lib/pgsql/pg.jar

½s¿è©Ò¦³ psql.java ÀÉ¡A§â¡¥package¡¦ªº¦æÅÜ¬°µû½×¡C
bash$ javac psql.java
bash$ java psql jdbc:postgresql:template1 postgres < password >[1] select * from pg_tables;
tablename       tableowner      hasindexes      hasrules
pg_type postgres        true    false   false
pg_attribute    postgres        true    false   false
[2]
CTRL+C
bash$
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¡K¡K§Aª½±µ¥Î Java ¤¶­±¨Ó¦s¨ú PostgreSQL ¸ê®Æ®w¡I


\subsection{´ú¸Õ ecpg ¤¶­± \label{Testing ecpg}}

¦w¸Ë examples ®M¥ó¡A½Ð°Ñ¾\ \ref{Examples RPM} {(¨Ò¤l RPM)}¡A¤§«á¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
root# chown -R postgres.postgres /var/lib/pgsql/examples
bash$ cd /var/lib/pgsql/examples/ecpg
bash$ ecpg test1.pgc -I/usr/include/pgsql
bash$ cc test1.c -I/usr/include/pgsql -lecpg -lpq -lcrypt
bash$ createdb mm
bash$ ./a.out
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¡K¡K§Aª½±µ¥Î´O¤J¦¡ SQL ¨Ó¦s¨ú PostgreSQL ¸ê®Æ®w¡I


\subsection{´ú¸Õ SQL ªº¨Ò¤l¡X¦Û­q¸ê®Æ«¬ºA©M¨ç¼Æ \label{Testing SQL}}

¦w¸Ë examples ®M¥ó¡A½Ð°Ñ¾\ \ref{Examples RPM} {(¨Ò¤l RPM)}¡A¤§«á¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
root# chown -R postgres.postgres /var/lib/pgsql/examples
bash$ cd /var/lib/pgsql/examples/sql
¥¼¼g¦n¡K
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{´ú¸Õ Tcl/TK ¤¶­±}

Tck/Tk ªº¨Ò¤l¬O pgaccess µ{¦¡¡C
¨Ï¥Î¤@­Ó¤å¦r½s¿è¾¹¾\Åª /usr/bin/pgaccess ÀÉ®×¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ view /usr/bin/pgaccess
bash$ export DISPLAY=<§A¹q¸£ªº¥D¾÷¦W>:0.0
bash$ createdb mydb
bash$ pgaccess mydb
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{´ú¸Õ ODBC ¤¶­±}

\begin{enumerate}
\item  ¦b \nameurl{http://www.insightdist.com/psqlodbc/}{} ¨ú±o win32 pgsql 
odbc ÅX°Êµ{¦¡
\item  ¥t¥~½Ð°Ñ¾\ /usr/lib/libpsqlodbc.a
\end{enumerate}



\subsection{´ú¸Õ MPSQL Motif-worksheet ¤¶­±}

¦b \nameurl{http://www.mutinybaysoftware.com}{} ¨ú±o RPM¡C


\subsection{½T»{}

­n½T»{ PostgreSQL ªº°ª«~½è¡A°õ¦æ Regression ´ú¸Õ®M¥ó¡J
¥H root ¨­¥÷Ã±¤J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# rpm -i postgresql*test.rpm
¾\Åª README ÀÉ©Î¦w¸Ë·½µ{¦¡¡A¥¦¤w¦³ regress ¥Ø¿ý
# rpm -i postgresql*.src.rpm
# cd /usr/src/redhat/SPECS
# more postgresql*.spec ¡]¥H¹î¬Ý»Ý­n¦w¸Ë­þ¨Ç RPM ®M¥ó¡^
# rpm -bp postgresql*.spec ¡]¡K³o¼Ë·|·Ç³Æ¸Ó®M¥ó¡^

Regression ´ú¸Õ»Ý­n Makefiles ©MÃþ¦ü *fmgr*.h ªº¼ÐÀYÀÉ¡A¥i¥Î¥H¤U«ü¥O
²£¥Í¡X
# rpm --short-circuit -bc postgresql*.spec ¡]¨«±¶®|¡I¡^
¬Ý¨ì¡¥make -C common  SUBSYS.o¡¦«á«ö CTRL-C ²×¤î¤u§@¡C³o®É­Ô configure 
¤w¸g¦¨¥\¡A©Ò¦³ Makefiles ©M¼ÐÀYÀÉ¤]¤w²£¥Í¡C§A¤£¦A»Ý­nÅý¥¦Ä~Äò¤U¥h¡C
# cd /usr/src/redhat/BUILD
# chown -R postgres postgresql*
# su - postgres
bash$ cd /usr/src/redhat/BUILD/postgresql-6.5.3/src/test/regress
bash$ more README
bash$ make clean; make all runtest
bash$ more regress.out
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{ºò«æ°£¿ù}

¦³®É°£¿ù´O¸É·|¦b¥D­nªº±À¥X PostgreSQL 
ªº¥D­nª©¥»¤§«á¥X²{¡C§A¥i¨Ì¾Ú¦Û¤v»Ý­n¡A¦Û¦æ¶i¦æ­×¸É¡C½Ð¸ò±q¥H¤U¨BÆJ¡J
¨ì postgresql µ{¦¡½Xªº¥Ø¿ý
\begin{tscreen}
\begin{verbatim}
                # rpm -i postgresql*.src.rpm
                # cd /usr/src/postgresql6.5.3
                # man patch
                # patch -p0 < patchfile
                # make clean
                # make
\end{verbatim}
\end{tscreen}

´O¸ÉÀÉ¬O¦b
\begin{itemize}
\item PostgreSQL ´O¸É¡J\nameurl{ftp://ftp.postgresql.org/pub/patches}{}
\end{itemize}



\section{§Ö³t¶}©l«ü¤Þ}

½Ð°Ñ¦Ò\ref{Quick-Installation} {(§Ö³t¦w¸Ë«ü¤Þ)}¤@³¹¡C


\subsection{¸ê®Æ®w«Ø¥ß¡B¥á±ó¡B§ï¦W}

§A¥i¨Ï¥Î¨Ï¥ÎªÌ¤Íµ½ªº
GUI¡A¦W¬°¡¥pgaccess¡¦¨Ó«Ø¥ß©M¥á±ó¸ê®Æ®w¡A¤]¥i¥Î«ü¥O¦C¡¥psql¡¦¤u¨ã¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
¦p§A¥H root ¨­¥÷µn¤J¡AÅÜ¨­¬°¥ÎªÌ¡¥postgres¡¦¡J
# xhost + ¡]Åý pgaccess ¨Ï¥ÎÅã¥Ü¸Ë¸m¡^
# su - postgres
bash$ man createdb
bash$ createdb mydatabase
bash$ man psql
bash$ psql mydatabase
¡K¦b psql «ö¤W / ¤U½b©C¨Ó½s¿è¾ú¥v¬ö¿ý©Î¥Î \s

bash$ export DISPLAY=<¥D¾÷¦W>:0.0
bash$ man pgaccess
bash$ pgaccess mydatabase
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

§A²{¦b¥i¥H¦b psql ©Î pgaccess {\bfseries °ª³t¤U¹F} SQL «ü¥O¡C



­n¥á±ó¸ê®Æ®wªº¸Ü¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man dropdb
bash$ man destroydb  ¡]¦b¸ûÂÂª©¥»ªº pgsql ¤¤¨Ï¥Î¡^ 
bash$ dropdb <¸ê®Æ®w¦WºÙ>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¤]¥i¥H¦b¤@­Ó SQL ³s±µ´Á¶¡¥Î¥H¤U«ü¥O®ø·À¤@­Ó¸ê®Æ®w¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
> drop database <¸ê®Æ®w¦WºÙ>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

­n§ó§ï¸ê®Æ®w¦WºÙ¡A½Ð°Ñ¾\\ref{backup_restore} {(³Æ¥÷©MÁÙ­ì)}¤@¸`


\subsection{«Ø¥ß©M¥á±ó¥Î¤á}

­n«Ø¥ß·s¥Î¤á¡A¥H unix ¥Î¤á¡¥postres¡¦Ã±¤J¡A§A¥i¥ÎÂ²³æ©ö¥Îªº GUI
¤u¨ã¡¥pgaccess¡¦¨Ó¼W´î¥Î¤á¡C 
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man pgaccess
bash$ pgaccess <¸ê®Æ®w¦WºÙ>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

À»¿ï¡§Users¡¨tab¡A¦AÀ»¿ï Object$|$New ©Î Object$|$Delete

§A¤]¥i¥Î«ü¥O¦æ©R¥O½Z (script)¡C¦W¬°¡¥createuser¡¦ªº©R¥O½Z±Ò°Ê psql¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man createuser
bash$ createuser <¥Î¤á¦WºÙ>
bash$ createuser -h host -p port -i userid <¥Î¤á¦WºÙ>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


­n¥á±ó¤@­Ó postgres ¥Î¤á¡A¨Ï¥Î©R¥O½Z¡¥destroyuser¡¦¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man dropuser
bash$ man destroyuser ¡]¦b¸ûÂÂª©¥»ªº pgsql ¤¤¨Ï¥Î¡^ 
bash$ destroyuser
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{«Ø¥ß©M¥á±ó¸s²Õ}

¥Ø«e¨S¦³Â²³æªº¤¶­±¥i¥Î¨Ó³]©w¥Î¤á¸s²Õ¡C§A­n¦Û¦æ¦b {\bfseries pg\_group}
ªí®æ¤¤´¡¤J©Î§ó·s¬ö¿ý¡C¦p¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ su - postgres
bash$ psql <¸ê®Æ®w¦WºÙ>
¡K¦b psql «ö¤W / ¤U½b©C¨Ó½s¿è¾ú¥v¬ö¿ý©Î¥Î \s

psql=> insert into pg_group (groname, grosysid, grolist)
psql=> values ('posthackers', '1234', '{5443, 8261}' );
INSERT 58224
psql=> grant insert on foo to group posthackers;
CHANGE
psql=>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

{\bfseries pg\_group} ¤¤ªºÄæ¦ì¬°¡J
{\bfseries groname} ¸s²Õ¦WºÙ¡C³o¦WºÙ¥²¶·¥þ¬°¦r¥À©Î¼Æ¦r¡A¤£¥i¦³©³½u©Î¼ÐÂI²Å¸¹¡C

{\bfseries grosysid} ¸s²Õ¥N½X¡C³o¬O¤@­Ó int4¡A¨C­Ó¸s²Õ³£­n¿W¤@µL¤G¡C

{\bfseries grolist} ÄÝ©ó¦¹¸s²Õªº {\bfseries pg\_user} ¥N½X¦W³æ¡C¬O¤@­Ó int4{[}]¡C

­n§R°£¸s²Õ¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ su - postgres
bash$ psql <¸ê®Æ®w¦WºÙ>
¡K¦b psql «ö¤W / ¤U½b©C¨Ó½s¿è¾ú¥v¬ö¿ý©Î¥Î \s


psql=> delete from pg_group where groname = 'posthackers';
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{«Ø¥ß¡B½s¿è©M¥á±óªí®æ}

§A¥i¨Ï¥Î¨Ï¥ÎªÌ¤Íµ½ªº
GUI¡A¦W¬°¡¥pgaccess¡¦¡A©Î«ü¥O¦C¡¥psql¡¦¤u¨ã¨Ó«Ø¥ß¡B½s¿è©M¥á±ó¸ê®Æ®wªí®æ¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man pgaccess
bash$ pgaccess <¸ê®Æ®w¦WºÙ>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

À»¿ï Table $|$ New $|$ Design «ö¶s¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man psql
bash$ psql <¸ê®Æ®w¦WºÙ>
¡K¦b psql «ö¤W / ¤U½b©C¨Ó½s¿è¾ú¥v¬ö¿ý©Î¥Î \s
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¦b psql ´£¥Ü¤U¡AÁä¤J¼Ð·Çªº SQL «ü¥O¡A¦p¡¥create table¡¦¡B¡¥alter
table¡¦©Î¡¥drop table¡¦¨Ó³B²zªí®æ¡C


\subsection{«Ø¥ß¡B½s¿è©M¥á±óªí®æ¤¤ªº¬ö¿ý}



§A¥i¨Ï¥Î¨Ï¥ÎªÌ¤Íµ½ªº
GUI¡A¦W¬°¡¥pgaccess¡¦¡A©Î«ü¥O¦C¡¥psql¡¦¤u¨ã¨Ó«Ø¥ß¡B
½s¿è©M¥á±ó¸ê®Æ®wªí®æ¤¤ªº¬ö¿ý¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man pgaccess
bash$ pgaccess <¸ê®Æ®w¦WºÙ>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

À»¿ï Table $|$ $<$ ¿ï¤@­Óªí®æ $>$ $|$ Open «ö¶s¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man psql
bash$ psql <¸ê®Æ®w¦WºÙ>
¡K¦b psql «ö¤W / ¤U½b©C¨Ó½s¿è¾ú¥v¬ö¿ý©Î¥Î \s
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¦b psql ´£¥Ü¤U¡AÁä¤J¼Ð·Çªº SQL «ü¥O¡A¦p¡¥insert into table\_name¡¦¡B¡¥update
table\_name¡¦©Î¡¥delete from table\_name¡¦¨Ó³B²zªí®æ¡C


\subsection{§ïÅÜ¥Ø«eªº¸ê®Æ®w}

§A¥i¨Ï¥Î¨Ï¥ÎªÌ¤Íµ½ªº
GUI¡A¦W¬°¡¥pgaccess¡¦¡A©Î«ü¥O¦C¡¥psql¡¦¤u¨ã¨Ó§ïÅÜ¥Ø«eªº¸ê®Æ®w¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man pgaccess
bash$ pgaccess <¸ê®Æ®w¦WºÙ>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

À»¿ï Database $|$ Open «ö¶s¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man psql
bash$ psql <¸ê®Æ®w¦WºÙ>
¡K¦b psql «ö¤W / ¤U½b©C¨Ó½s¿è¾ú¥v¬ö¿ý©Î¥Î \s

psql=> connect <¸ê®Æ®w¦WºÙ> <user>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{³Æ¥÷»PÁÙ­ì¸ê®Æ®w \label{backup_restore}}

PostgreSQL ´£¨Ñ¤F¨â­Ó¤u¨ã¨Ó³Æ¥÷§Aªº¨t²Î¡J{\bfseries pg\_dump} 
³Æ¥÷¤@­Ó¸ê®Æ®w¡A{\bfseries pg\_dumpall} ¤@¦¸¹L³Æ¥÷©Ò¦³¸ê®Æ®w¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ su - postgres
bash$ man pd_dump
bash$ pd_dump <¸ê®Æ®w¦WºÙ> > database_name.pgdump
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

ÁÙ­ì«h¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ cat database_name.pgdump | psql <¸ê®Æ®w¦WºÙ>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

³o§Þ¦Ò¥i¥Î©ó·h²¾¸ê®Æ®w©Î¬°¸ê®Æ®w§ï¦W¡C

{\bfseries Äµ§i¡J}¨C­Ó¸ê®Æ®w³£­n©w®É³Æ¥÷¡C¦]¬° PostgreSQL
¦Û¦æºÞ²z¥¦¦bÀÉ®×¨t²Î¤¤ªºÀÉ®×¡A©Ò¥H¤£­n­Ê¿à¨t²Î³Æ¥÷¨Ó§@¸ê®Æ®w³Æ¥÷¡C
¨S¦³¤H¯à«OÃÒ¨º¨ÇÀÉ®×¦bÁÙ­ì«á·|³B©ó¤@­Ó¥i¥Î¦Ó¤@­Pªºª¬ºA¡C

{\bfseries ³Æ¥÷¤j«¬¸ê®Æ®w¡J}¦]¬° PostreSQL
®e³\ªí®æ¤j¹L¨t²Îªº³Ì¤jÀÉ®×®e¶q¡A§â¤@­Óªí®æ¿é¥X¬°¤@­ÓÀÉ®×·|¦³°ÝÃD¡A
¦]¬°©Ò²£¥ÍªºÀÉ®×¥i¯à·|¶W¥X¨t²Îªº­­¨î¡C¦]¬° {\bfseries pg\_dump} ·|¼g¨ì 
{\bfseries stdout}¡A§A¥i¨Ï¥Î¼Ð·Çªº unix ¤u¨ã¨Ó¸Ñ¨M³o¥i¯àªº°ÝÃD¡J

¨Ï¥ÎÀ£ÁY¤Fªº¿é¥X¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ pg_dump <¸ê®Æ®w¦WºÙ> | gzip > filename.dump.gz
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¥Î¥H¤U¤èªk­«·s¸ü¤J¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ createdb <¸ê®Æ®w¦WºÙ>
bash$ gunzip -c filename.dump.gz | psql <¸ê®Æ®w¦WºÙ>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

©Î
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ cat filename.dump.gz | gunzip | psql <¸ê®Æ®w¦WºÙ>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


¨Ï¥Î split¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ pg_dump <¸ê®Æ®w¦WºÙ> | split -b 1m - filename.dump.
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

ª`·N¡J¥H¤W«ü¥O¤¤¡A¦b filename.dump «á¦³¤@ÂI (.)¡I¡I§A¥i¥Î¥H¤U¤èªk­«·s¸ü¤J¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man createdb
bash$ createdb <¸ê®Æ®w¦WºÙ>
bash$ cat filename.dump.* | pgsql <¸ê®Æ®w¦WºÙ>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

·íµM¡AÀÉ®×¦WºÙ¡]filename¡^©M {\bfseries pg\_dump}
¿é¥Xªº¤º®eµL»Ý©M¸ê®Æ®w¦WºÙ°t¦X¡C¦¹¥~¡AÁÙ­ì¤Fªº¸ê®Æ®w¥i¦³¥ô¦ó·s¦W¡C
¦]¦¹³o¤èªk¾A¥Î©ó¬°¸ê®Æ®w§ï¦W¡C

­n§â©Ò¦³ PostgreSQL ¿é¥X¡A¨Ï¥Î {\bfseries pg\_dumpall}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man pg_dumpall
bash$ pg_dumpall -o > db.out
­n­«·s¸ü¤J¡J
bash$ psql -e template1 < db.out
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{¸ê®Æ®w«O¦w}

½Ð°Ñ¾\\ref{security} {(PostgreSQL «O¦w)}¤@¸`¡C




\subsection{½u¤W¨D§U}

§A¥²¶·ª¾¹D PostgreSQL
ªº½u¤W¨D§U³]¬I¡A¦]¬°¥¦·|¬°§A¸`¬Ù«Ü¦h®É¶¡¡AÅý§A§Ö³t¨ú±o¸ê®Æ¡C

½Ð°Ñ¾\¤£¦P«ü¥O¡A¦p createdb¡Bcreateuser µ¥µ¥ªº½u¤W  man pages¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man createdb
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


¤]½Ð°Ñ¾\ psql ªº½u¤W¨D§U°T®§¡A¦b psql ´£¥ÜÁä¤J $\backslash$h
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ psql mydatabase
psql> \h
´£¥Ü¡J¦b psql «ö¤W / ¤U½b©C¨Ó½s¿è¾ú¥v¬ö¿ý©Î¥Î \s
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{«Ø¥ß¿Eµo (Triggers) ©M¤ºÀxµ{§Ç (Stored Procedures)}

­n«Ø¥ß¿Eµo©Î¤ºÀxµ{§Ç¡A¥ý¦b§A¨Ï¥Îªº¸ê®Æ®w°õ¦æ¡¥createlang¡¦©R¥O½Z¨Ó¦w¸Ë
¡¥plpgsql¡¦¡C¦pªG§A·Q¹w³]¨Ï¥Î¥¦¡A§â¥¦¦w¸Ë¦b¡¥template1¡¦¡A
¦]¬°¥H«á«Ø¥ßªº¸ê®Æ®w³£¬O template1 ªº¥é¸Ë«~¡C°Ñ¾\¡¥createlang¡¦ºô­¶©Î¦ì©ó 
/usr/doc/postgresql-7.0.2/user/index.html ªº User Guide¡C

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man createlang
bash$ createdb mydb
bash$ export PGLIB=/usr/lib/pgsql
bash$ createlang plpgsql mydb
bash$ createlang plpgsql template1
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¤]½Ð°Ñ¦Ò \ref{Examples RPM} {(¨Ò¤l RPM)} 
¤¤¿Eµo©M¤ºÀxµ{§Çªº¨Ò¤l¡CExamples RPM ¤¤ªº¨ä¤¤¤@­Ó¨Ò¤l¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
create function tg_pfield_au() returns opaque as '
begin
    if new.name != old.name then
        update PSlot set pfname = new.name where pfname = old.name;
    end if;
    return new;
end;
' language 'plpgsql';

create trigger tg_pfield_au after update
    on PField for each row execute procedure tg_pfield_au();
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¥t¤@­Ó¿Eµoµ{¦¡½X¨Ò¤l¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
create trigger check_fkeys_pkey_exist
        before insert or update on fkeys
        for each row
        execute procedure
        check_primary_key ('fkey1', 'fkey2', 'pkeys', 'pkey1', 'pkey2');
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

§A¥²¶·¦w¸Ë TEST ®M¥ó¡X postgresql-test-7.0.2-2.rpm ©M¾\Åª¦b 
/usr/lib/pgsql/test/regress/sql ¤¤ªº SQL ©R¥O½Z¨Ò¤l¡C

­nÅã¥Ü¸ê®Æ®w¤¤¿Eµoªº¦W³æ¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ psql mydb
psql=> \?
psql=> \dS
psql=> \d pg_trigger
psql=> select tgname from pg_trigger order by tgname;
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


­nÅã¥Ü¸ê®Æ®w¤¤¨ç¼Æ©M¤ºÀxµ{§Çªº¦W³æ¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ psql mydb
psql=> \?
psql=> \dS
psql=> \d pg_proc
psql=> select proname, prosrc from pg_proc order by proname;
psql=> \df
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{PostgreSQL ¤å¥ó}

¦³Ãö¨ä¥L°ÝÃD¡A½Ð°Ñ¾\ PostgreSQL ªº»¡©ú®Ñ¡A¥¦­Ìªº¸ê®Æ¤Q¤À¥þ­±¡CPostgreSQL
¤å¥ó¤w¦b®M¥ó¤¤¡C½Ð¾\Åª¡¥User's Guide¡¦¡B¡¥Programmer's
Guide¡¦¡B¡¥Administrator's Guide¡¦©M¨ä¥L»¡©ú®Ñ¡C


\section{PostgreSQL ¤ä´©¶W¹L 200 Gig ªº¶W¯Å¸ê®Æ®w}

¦­¤w¦³«Ü¦h¤j¤½¥q±N PostgreSQL ¥Î©ó¤j«¬ªº¸ê®Æ®w¡C¦b¦¹´£¨Ñ¥H¤U§Þ¦Ò¡J


\subsection{¤¤¥¡³B²z¾¹ºØÃþ¡X32 ¦ì¤¸©Î 64 ¦ì¤¸}

32 ¦ì¤¸³B²z¾¹ªº¹q¸£¦b¸ê®Æ®w¶W¹L 5 GigaByte ®Éªí²{·|¨³³t¤U­°¡C§A¥i¥Î 32 
¦ì¤¸³B²z¾¹°õ¦æ 30 gig ªº¸ê®Æ®w¡A¦ýªí²{·|¤U­°¡C32 ¦ì¤¸¾÷¾¹¨ü¨ì³Ì¦h 2 GB 
°O¾ÐÅé¡B2 GB ÀÉ®×¨t²Î¤Î¾Þ§@¨t²Î¨ä¥L¤è­±ªº­­¨î¡C¨Ï¥Î SGI¡BIBM¡B©Î HP ¬° Linux 
¯S»sªºÀÉ®×¨t²Î©Î ext3-fs ¨Ó¦b 32 ¦ì¤¸¾÷¾¹¤W¤ä´©¤j¹L 2 GB ªºÀÉ®×¤j¤p¡C

¹ï·¥¤j«¬ªº¸ê®Æ®w¨Ó»¡¡A§Ú±j¯P«ØÄ³§A¨Ï¥Î 64 ¦ì¤¸³B²z¾¹¡A¦p Digital Alpha¡BSun 
Ultra-sparc 64 ¦ì¤¸³B²z¾¹¡BSGI 64 ¦ì¤¸³B²z¾¹¡BIntel Mercel IA-64 ³B²z¾¹¡BHPUX 
64 ¦ì¤¸¹q¸£¡BIBM 64 ¦ì¤¸¹q¸£¡C¨Ï¥Î 64 ¦ì¤¸ªº³B²z¾¹¨Ó½sÄ¶ 
PostgreSQL¡A¥¦´N¥i¥H³B²z¤j«¬ªº¸ê®Æ®w¤Î¬d¸ß¡C¬d¸ß¤j«¬ªí®æ©M¸ê®Æ®wªº³t«×·|¤ñ 32 
¦ì¤¸ªº¹q¸£§Ö¼Æ­¿¡C64 ¦ì¤¸¹q¸£ªºÀuÂI¬O§A¦³«Ü¤jªº°O¾Ð¦ì§} (memory addressing 
space) ©M¾Þ§@¨t²Î¥i³B²z«Ü¤jªºÀÉ®×¨t²Î¡B¬°¤j«¬¸ê®Æ®w´£¨Ñ¸û¨Îªí²{¡B
¤ä´©§ó¦h°O¾ÐÅé¡B¯à¤O§ó±j¡K¡K

¡]Ä¶«ö¡J2.4 ªº Linux ®Ö¤ß¤w¬ð¯} 2 GB ÀÉ®×¤j¤pªº­­¨î¡A¨Ã¤ä´©³Ì¦h 64 GB
°O¾ÐÅé¡C¡^


\subsection{¦h³B²z¾¹}

­n¨Ï¥Î¤j«¬ªº¸ê®Æ®Æ¡A§A³Ì¦n¨Ï¥Î¤º¦³ 4¡B16 ©Î 32 ¹Ù³B²z¾¹ªº SMP
¹q¸£¡C¥t¤@¤è­±¡A§A¤]¥i¨Ï¥Î 4 ¦Ü 5 ³¡³æ³B²z¾¹¹q¸£¡A¦Ó§â§Aªº¸ê®Æ®w¤À³Î
(partition) ¬° 4 ¦Ü 5 ­Ó¤À¶}ªº¸ê®Æ®w¡A¨C­Ó¦b¤@³¡¹q¸£¹B¦æ¡C¨C­Ó³B²z¾¹³£¥H°ª³t
¡]100MBits¡^ªº¤A¥H¤Óºôµ¸¥d³s±µ¡C¨Ò¦p¡A§Aªº¸ê®Æ®w¤¤¦³¤G¦Ê­Óªí®æ¡A
§A¥i§â¥¦­Ì¤À¬°¥|­Ó¸ê®Æ®w¡A¨C­Ó¦³¤­¤Q­Óªí®æ¡C³o¼Ë¡A§A§â¤u§@¥­§¡¤À°tµ¹
4 ³¡¤À¶}ªº¹q¸£¡C³o¬O¤@­Ó¤ñ¥|³B²z¾¹¹q¸£«K©yªº¤è®×¡C
§A¥i¨Ï¥Î{\bfseries ¡¥¸ó¸ê®Æ®wªº¬d¸ß¡¦}¡B¦b°Ï°ìºôµ¸¨Ï¥Î NFS¡B¬°°ßÅªªí®æ¡¥CREATE 
VIEW¡¦¨Ó§¹¦¨³o¤u§@¡C¨C­Ó³B²z¾¹³£¥i¡u¨£¨ì¡v©Ò¦³¸ê®Æ®w¡A§Y¥þ³¡ 200 
­Óªí®æ¡C¦b¥¼¨Ó¡APostgreSQL ·|¤ä´©{\bfseries ¡¥¸ó¸ê®Æ®wªº¬d¸ß¡¦}¡]¤w¸g¦b TODO 
¦W³æ¡^¡A¦b±N±À¥Xªº 7.1 ª©¥X²{¡C¨Ò¦p¡A¨Ï¥Î¥N¸¹ a¡Bb 
§@ªí®æ¦WºÙ§@ªº¸ó¸ê®Æ®w¬d¸ß·|Ãþ¦ü¡X¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
select a.col1, a.col2, b.col4, b.col7
from
    database1.my_tablea a, database2.my_tableb b
where
    a.col1 = b.col3 and
    a.col4 = b.col9;

update my_tablea
set
    col1 =  b.col2
from
    database1.my_tablea a, database2.my_tableb b
where
    a.col4 = b.col9;
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{½Æ»s (Replication) ¦øªA¾¹}

¬°¤j«¬¥ø·~/°Ó·~¤½¥q¦Ó³]ªº½Æ»s¦øªA¾¹¥Ñ PostgreSQL Inc
§@°Ó·~³c½æ¡C§A¥i¨Ï¥Î½Æ»s¦øªA¾¹¨Ó´£¨Ñ­«ÂÐªº¸ê®Æ¤Î°ª«×¥i±o©Ê
(availability)¡C½Æ»s¦øªA¾¹¬O¤@¥ó½ÆÂø¡B¥ý¶iªº²£«~¡A¦]¦¹»Ý­nª÷¿ú¡C


\section{¾Ì¤°»ò¬Û«H PostgreSQL¡HRegression ´ú¸Õ®M¥ó¬°¥Î¤á«Ø¥ß«H¤ß}

¦³¿à{\itshape ¡uª«²z¾Ç©w«ß¡v\/}¡A§Ú­Ì¥i¥H{\bfseries ¬ì¾Ç¦a}ÀËÃÒ PostgreSQL 
¬O§_¯uªº¨Ì±q ISO/ANSI SQL ³W®æ¤u§@¡C¬°¤è«K´ú¸Õ PostgreSQL¡ARegression 
´ú¸Õ®M¥ó¡]src/test/regress¡^¤w¥]§t¦bµo¦æª©¥» (distribution) ¤¤¡A
¥¦®e³\§Aªº¹q¸£ÀËÃÒ¼Ð·Çªº SQL ¾Þ§@¤Î PostgreSQL ªº©µ¦ù¯à¤O¡C
´ú¸Õ®M¥ó¤¤¤w¥]§t¤F¼Æ¦Ê­Ó SQL ´ú¸Õµ{¦¡¡C

§AÀ³¥Î¹q¸£ªº°ª³t¨ÓÅçÃÒ PostgreSQL¡A¦Ó¤£¬O¥Î¤H¸£¡C
¹q¸£¥i¥H¤H¸£¤d¸U­¿¬Æ¦Ü¼Æ¥H»õ­¿ªº³t«×¨Ó¶i¦æ Regression 
´ú¸Õ¡C²{¥N¹q¸£¥i¦b«Üµu®É¶¡¤º°õ¦æ¼Æ¤Q»õ­Ó SQL 
´ú¸Õ¡C¦b¤£¤[±N¨Ó¡A¹q¸£·|¤ñ¤H¸£§Ö¼Æ¥H¥ü­¿¡C¦]¦¹¡A
¨Ï¥Î¹q¸£¨Ó´ú¸Õ¹q¸£ªºªí²{¬O¦X²zªº¡C

¦p¦³»Ý­n¡A§A¤]¥i¦Û¦æ¼W¥[´ú¸Õ¡C¦pªG§A»{¬°¥¦·|¹ï¨ä§A¤¬Ápºô¥Î®a¦³À°§U¡A
§A¤]¥i§â¥¦¤W¸ü¨ì PostgreSQL ªº¥Dºô¯¸¡CRegression ´ú¸Õ®M¥óÀ°§U¥Î¤á«Ø¥ß¹ï 
PostgreSQL ªº«H¤ß¤Î«H¥ô¡A¥¦¤]À°§U¥Í²£¨t²Î¨³³t³]¥ß PostgreSQL¡C

Regression ´ú¸Õ®M¥ó¥i³Qµø¬°¶}µo¤H­û»P³Ì²×¥Î¤á¶¡¬Û¤¬¦P·Nªº¤@¥÷{\bfseries ¡§«D±`¦³¤O¡¨}ªº§Þ³N¤å¥ó¡CPostgreSQL ¦b¶}µo¹Lµ{¤Î±À¥X³n¥ó¤§«e¼sªx¨Ï¥Î Regression 
´ú¸Õ®M¥ó¨Ó«OÃÒ½è¯À¡C

PostgreSQL ªº¯à¤O¥iÄy Regression ´ú¸Õ®M¥óª½±µ¤Ï¬M¥X¨Ó¡C¦pªG¤@ºØ¥\¯à¡B
»yªk©Î¯S©Ê¦b Regression ´ú¸Õ¤¤¦s¦b¡A¥¦´N³Q¤ä´©¡A©Ò¦³¨ä¥L¨S¦³¦C¥Xªº PostgreSQL 
´N¥i¯à¤£¤ä´©¡I¡I§A¥i¥H¦Û¦æÅçÃÒ¤Î¥[¤J Regression ´ú¸Õ®M¥ó¤¤¡C




\section{¸ê®Æ®w«O¦w \label{security}}

¸ê®Æ®w«O¦w°ÝÃD»Ý¦b¦h­Ó¤£¦P¼h­±±´°Q¡J
\begin{itemize}
\item  ¸ê®Æ®wÀÉ®×«OÅ@¡C¸ê®Æ®wªº©Ò¦³ÀÉ®×³£¤£²a {\itshape postgres\/}
¶W¯Å¥Î¤á¥H¥~ªº¥Î¤áÅª¨ú¡C
\item  ¾Ú¹w³]­È¡A±q¥Î¤á³s±µ¨ì¸ê®Æ®w¦øªA¾¹¥u¯à³z¹L¥»¾÷ªº UNIX ´¡®y
(socket)¡A¤£¬O TCP/IP ´¡®y¡C¦øªA¾¹»Ý¥H -i ¿ï¶µ±Ò°Ê¤~¯à®e³\«D¥»¾÷«È¤á³s±µ¡C
\item  «È¤á³s±µ¥i¥H IP ¦a§}©M / ©Î¥ÎªÌ¦WºÙ¥[¥H­­¨î¡A¥u»Ý­×§ï {\bfseries \$PG\_DATA}
¤¤ªº {\bfseries pg\_hba.conf} ÀÉ¡C
\item  ¥iÄy¥~³¡®M¥ó»{ÃÒ«È¤á³s±µ¡C
\item  ¨C¦ì Postgres ¥Î¤á³£¦³¤@­Ó¨Ï¥ÎªÌ¦WºÙ©M¿ï¾Ü©Ê¦a¾Ö¦³¤@­Ó±K½X¡C
¹w³]­È¬O¥Î¤á¨S¦³Åv­­¼g¤J¤£¬O¦Û¤v«Ø¥ßªº¸ê®Æ®w¡C
\item  ¥Î¤á¥i³Q½s°t¨ì¸s²Õ¤¤¡A¯à§_¦s¨ú¤@­Óªí®æ¥i¥H¸s²Õ¯SÅv¨Ó­­¨î¡C 
\end{itemize}



\subsection{¥Î¤á»{ÃÒ}

»{ÃÒ¬O«áºÝ¦øªA¾¹©M postmaster ½T«O­n¨D¦s¨ú¸ê®Æªº¥Î¤á¬O§_½T¬°¨ä¤Hªº¹Lµ{¡C©Ò¦³±Ò°Ê
Postgres ªº¥ÎªÌ³£»P»{ÃÒ¬O«áºÝ¦øªA¾¹©M postmaster {\bfseries pg\_user}
Ãþ§O¤ñ¸û¡A¥H½T©w¥L­Ì¦³Åv°µ·Q°µªº¤u§@¡C
¦Ó¥ÎªÌ¯u¹ê¨­¤Àªº¿ë§O¤u§@¥H¦h­Ó¤£¦P¤èªk§¹¦¨¡J
\begin{itemize}
\item  {\bfseries ¦b¨Ï¥ÎªÌ shell ¤¤¡J} ¦b¨Ï¥ÎªÌ shell
ª½±µ±Ò°Êªº«áºÝ¦øªA¾¹°O¤U¥ÎªÌªº¡]¦³®Ä¡^¨Ï¥ÎªÌ¥N¸¹ (effective 
user-id)¡A¤§«á§@¤@¦¸ {\bfseries setuid} ¨Ó¤Æ¨­¬° {\bfseries postgres}¡C
¦³®Ä¨Ï¥ÎªÌÃÑ§O¸¹·|³Q¥Î§@¦s¨ú±±¨îªº°òÂ¦¡C¦A¨S¦³¨ä¥L»{ÃÒ¤u§@¡C
\item  {\bfseries ¨Ó¦Ûºôµ¸¡J} ¦pªG Postgres ¨t²Î¥H¤À´²¦¡¹B¦æ¡A¥ô¦ó¤H³£¥i¦s¨ú
postmaster ¦æµ{ (process) ªº¤¬Ápºô TCP °ð¡C¸ê®Æ®wºÞ²z­û»Ý³]©w {\bfseries \$PGDATA}
¥Ø¿ý¤¤ªº {\bfseries pg\_hda.conf} ÀÉ¡A¨Ó«ü©w¤£¦P¥D¾÷³s±µ¤£¦P¸ê®Æ®w®É©Ò¥Îªº»{ÃÒ¨t²Î¡C

½Ð°Ñ¾\ {\bfseries pg\_hba.conf(5)} ¡]man 5 pg\_hba.conf¡^
¥H¤F¸Ñ¤£¦P»{ÃÒ¨t²Î¡C·íµM¡A®Ú¾Ú¥D¾÷¨Ó¶i¦æ»{ÃÒ¦b Unix
¤]¤£¬O²@µL¯}Þä¡C¦³¨M¤ßªº¤J«IªÌ¤]¥i¥H°°¸Ë¦Û¤v©Ò¥Îªº¥D¾÷¡C³o¨Ç«O¦w°ÝÃD¤£¦b
Postgres ªº±±¨î½d³ò¡C
\end{itemize}



\subsection{¨Ì¾Ú¥D¾÷±±¨î¦s¨ú}

¨Ì¾Ú¥D¾÷±±¨î¦s¨ú§Y PostgreSQL
¥Î©ó¨M©w¤°»ò«È¤á¥i¦s¨ú¸ê®Æ®w©M¥L­Ì¦p¦ó½T»{¨­¥÷ªº¹Lµ{¡C¨C­Ó¸ê®Æ®w³£¦³¤@­Ó¦W¬°
{\bfseries pg\_hba.conf} ªºÀÉ®×¡A¦b¥¦ªº {\bfseries \$PGDATA}
¥Ø¿ý¤¤¡A¥¦±±¨î½Ö¯à¦s¨ú¸ê®Æ®w¡C¨C­Ó¦s¨ú¸ê®Æ®wªº¥Î¤á³£­n¦b {\bfseries pg\_hba.conf}
¤¤¦³¬ÛÀ³ªº¬ö¿ý¡C§_«h©Ò¦³¨Ó¦Û¸Ó«È¤áªº³s±µ³£·|¥H{\bfseries "User authemtication
failed"} ¿ù»~°T®§³Q©Ú¡C

½Ð°Ñ¾\ {\bfseries pg\_hba.conf(5)} ªº man page¡]man 5 pg\_hba.conf¡^¡C

{\bfseries pg\_hba.conf} ÀÉªº°ò¥»®æ¦¡¬O¤@²Õ¬ö¿ý¡A¤@¦æ¤@­Ó¡CªÅ¦æ©Î¥H hash
¦r¥À¡]\#¡^¶}©lªº¦æ«h¤£²z·|¡C¤@­Ó¬ö¿ý¥Ñ¤@¨Ç¥ÎªÅ®æ©M / ©Î Tab ¤À¶}ªºÄæ¦ì²Õ¦¨¡C

±q«È¤á¨Óªº³s±µ¥i¸g Unix ´¡®y©Î¤¬Ápºô´¡®y¡]§Y TCP/IP¡^¡C¨Ó¦Û Unix
´¡®yªº³s±µ¥Î¥H¤U®æ¦¡ªº°O¿ý±±¨î¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
local database authentication method
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¦Ó

{\bfseries database} «ü©w¥»¬ö¿ý¥Î©ó­þ­Ó¸ê®Æ®w¡C{\bfseries all}
¥Nªí¥¦¾A¥Î©ó©Ò¦³¸ê®Æ®w¡C

{\bfseries authentication method} «ü©w¥Î¤á¦b¨Ï¥Î Unix 
´¡®y®É¥Î¨Ó»{ÃÒªº¤èªk¡C¤£¦Pªº¤èªk®e«á¸Ô­z¡C



¨Ó¦Û¤¬Ápºô´¡®yªº³s±µ¥Î¥H¤U®æ¦¡ªº°O¿ý±±¨î¡J

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
host database TCP/IP-address TCP/IP-mask authentication method
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


{\bfseries TCP/IP} ¦a§}·| {\itshape ÅÞ¿è¤W and'ed\/} ¨ì«ü©wªº TCP/IP ¸n©M«È¤áªº 
TCP/IP ¦a§}¡C¦p¨âªÌ¬Ûµ¥¡A³o¬ö¿ý·|¥Î©ó³o­Ó³s±µ¡C¦pªG¤@­Ó³s±µ²Å¦X¶W¹L¤@­Ó¬ö¿ý¡A
ÀÉ®×¤¤ªº²Ä¤@­Ó¬ö¿ý·|³Q¨Ï¥Î¡C¤£½× TCP/IP ¦a§}ÁÙ¬O TCP/IP 
¸n³£¬O¥H¤ÀÂIªº¤Q¶i¼Æ®æ¦¡ (dotted decimal notation) 
ªí¹F¡C¦pªG¤@­Ó³s±µ©M©Ò¦³¬ö¿ý³£¤£²Å¡Areject »{ÃÒ¤èªk±N·|³Q¨Ï¥Î¡C¡]°Ñ¾\\ref{auth_method} {(»{ÃÒ¤èªk)}¡^


\subsection{»{ÃÒ¤èªk \label{auth_method}}

Unix ©M TCP/IP ´¡®y³£¤ä´©¥H¤U»{ÃÒ¤èªk¡J
\begin{itemize}
\item  {\bfseries trust}
µL±ø¥ó¦a®e³\³s±µ¡C
\item  {\bfseries reject}
µL±ø¥ó¦a©Úµ´³s±µ¡C
\item  {\bfseries crypt}
°Ý«È¤áºÝ¥ÎªÌªº±K½X¡C¥¦·|¸g¥[±K¡]¨Ï¥Î crypt(3)¡^©M»P pg\_shadow
ªí®æªº±K½X¤ñ¸û¡C¦pªG±K½X¬Û²Å¡A«K®e³\³s±µ¡C
\item  {\bfseries password}
°Ý«È¤áºÝ¥ÎªÌªº±K½X¡C¥¦·|­ì¸Ë¶Ç°e©M»P pg\_shadow
ªí®æªº±K½X¤ñ¸û¡C¦pªG±K½X¬Û²Å¡A«K®e³\³s±µ¡C¤@­Ó¿ï¾Ü©Êªº±K½XÀÉ¥i¦b password
ÃöÁä¦r«á¥X²{¡C³o¼Ë±K½Xªº°t¹ï·|¥Î³oÀÉ®×¡A¦Ó¤£¬O {\bfseries pg\_shadow} ÀÉ®×¡C½Ð°Ñ¾\
{\bfseries pg\_passwd}¡C
\end{itemize}


¥H¤U»{ÃÒ¤èªk¥u¨ü TCP/IP ´¡®y¤ä´©¡J
\begin{itemize}
\item  {\bfseries krb4}
¥Î Kerberos V4 ¨Ó»{ÃÒ¥Î¤á¡C
\item  {\bfseries krb5}
¥Î Kerberos V4 ¨Ó»{ÃÒ¥Î¤á¡C
\item  {\bfseries ident}
¥Î«È¤áºÝªº ident ¦øªA¾¹¨Ó»{ÃÒ¥Î¤á¡]RFC 1413¡^¡C¦b {\bfseries ident}
ÃöÁä¦r«áÁÙ¥i¿ï¾Ü©Ê¦a«ü©ú¤@­Ó¬M®g¡AÅý ident ¥Î¤á¦WºÙ¹ïÀ³¨ì Postgres
¥Î¤á¦WºÙ¡C¹ïÀ³ªºÃö«YÀx¦s¦b {\bfseries \$PGDATA/pg\_ident.conf} ÀÉ¤¤¡C
\end{itemize}


³o¸Ì¦³¤@¨Ç¨Ò¤l¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# «H¥ô©Ò¦³¨Ó¦Û Unix ´¡®yªº³s±µ¡C
local   trust
# «H¥ô©Ò¦³³o³¡¹q¸£¸g TCP/IP ¨Óªº³s±µ¡C
host    all 127.0.0.1   255.255.255.255     trust
# §Ú­Ì°Q¹½³o³¡¹q¸£¡C
host    all 192.168.0.10    255.255.255.0       reject
# ³o³¡¹q¸£¤£À´¥[±K¡A©Ò¥H§Ú­Ì­n¯Â¤å¦rªº±K½X¡C
host    all 192.168.0.3 255.255.255.0       password
# ³o¸s¹q¸£ªº¨ä¥L¦¨­û³£­n´£¨Ñ¥[±K¤Fªº±K½X¡C
host    all 192.168.0.0 255.255.255.0       crypt
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{¦s¨ú±±¨î}

Postgres ´£¨Ñ¤F­­¨î¨ä¥L¥Î®a¦s¨ú¦Û¤v¸ê®Æªº¾÷¨î¡C
\begin{itemize}
\item  {\bfseries ¸ê®Æ®w¶W¯Å¥Î®a (Database superusers)}
¸ê®Æ®w¶W¯Å¥Î®a¡]§Y {\bfseries pg\_user.usesuper}
³]©w¬°¹ïªº¥Î®a¡^¦Û°Ê³q¹L¥H¤U¨â¶µ¤§¥~ªº©Ò¦³¦s¨ú±±¨î¡J{\bfseries pg\_user.usecatupd}
¨S¦³³]©w¬°¹ïªº¸Ü¤£­ã¤â°Ê§ó·s¨t²Î¥Ø¿ý¡AºR·´¨t²Î¥Ø¿ý¡]©Î­×§ï¥¦ªººõ¥Ø 
(schema)¡^«h¥Ã¤£­ã³\¡C
\item  {\bfseries ¦s¨ú¯SÅv (Access Privilege)}
¦s¨ú¯SÅv¬O¥Î¨Ó­­¨îÅª¡B¼g©M³]©wÃþ§O (class) ³W«hªºÅv¤O¡A¥Î SQL 
{\bfseries grant/revoke(1)} ¨Ó¨M©w¡C
\item  {\bfseries ²¾°£Ãþ§O©M­×§ïºõ¥Ø}
·´·À©Î­×§ï²{¦sÃþ§Oªºµ²ºc¡A¦p­×§ï¡B¥á±óªí®æ¡A©M¥á±ó¯Á¤Þ¡A¥u¯à¥ÑÃþ§Oªº¥D¤H°õ¦æ¡C
¦p¤W©Ò­z¡A³oÃþ°Ê§@¤£³\¥Î©ó¨t²Î¥Ø¿ý¡C
\end{itemize}



\subsection{¸g SSH ªº«O¦w TCP/IP ³s±µ}

§A¥i¥Î {\bfseries ssh} ¨Ó¥[±K«È¤á©M Postgres
¦øªA¾¹¶¡ªººôµ¸³s±µ¡C°µ±o¥¿½Tªº¸Ü¡A³o¼Ë¥i§Î¦¨¤@­Ó«O¦wªººôµ¸³s±µ¡C

{\bfseries ssh} ªº¤å¥ó´£¨Ñ¤F¤j³¡¥÷¶}©l®É»Ý­nªº¸ê®Æ¡C½Ð°Ñ¾\ \nameurl{http://www.heimhardt.de/htdocs/ssh.html}{} ¥H¥[²`¤F¸Ñ¡C³v¨B¸ÑÄÀ¥u»Ý¨â¨B¡C

{\bfseries ¸g ssh §Î¦¨¤@±ø«O¦w³q¹D¡J}
³v¨B¸ÑÄÀ¥u»Ý¨â¨B¡C
\begin{itemize}
\item  ²£¥Í¤@±ø¨ì«áºÝ¹q¸£ªº³q¹D¡A¦p¤U¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ssh -L 3333:wit.mcs.anl.gov:5432 postgres@wit.mcs.anl.gov
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\item  {\bfseries -L}
°Ñ¼Æ«áªº²Ä¤@­Ó¼Æ¦r¡A{\bfseries 33333}¡A¬O§A³o¤è³q¹Dªº°ð¸¹¡C²Ä¤G­Ó¼Æ¦r¡A
{\bfseries 5432}¡A¬O¥t¤@¤èªº²×ÂI¡X«áºÝªº°ð¸¹¡C¨â­Ó°ð¼Æ¤§¶¡ªº¦WºÙ©Î¦a§}ÄÝ©ó¦øªA¾¹¡C
{\bfseries ssh} ³Ì«á¤@­Ó°Ñ¼Æ¤¤¥Î®a¦Û¦æ¿ï¾Ü¬O§_¥[¤Wªº¥Î¤á¦WºÙ¤]¬O¡C
¨S¦³¥Î¤á¦WºÙªº¸Ü¡A{\bfseries ssh} ·|¹Á¸Õ¨Ï¥Îµn¤J«È¤áºÝ¹q¸£ªº¥Î¤á¦WºÙ¡C
§A¥i¥Î¥ô¦ó¦øªA¾¹¹q¸£±µ¨üªº¥Î¤á¦WºÙ¡A¤£¤@©w­n¥Î©M PostgreSQL ¦³Ãöªº¡C
\item  §A²{¦b¤w¶}©l¤F¤@­Ó {\bfseries ssh} ®É¬q¡A§A§â¥i§A©Ò¥Îªº¹q¸£ªº Postgres 
«È¤á³s±µ¨ì§A«e¤@¨B©Ò©wªº°ð¸¹¡C¦p§A¨Ï¥Î 
{\bfseries psql}¡A§A­n¥t¤@­Ó¤¶­±¡A¦]¬°¤§«e©Ò¥Îªº¤@­Ó¤w³Q {\bfseries ssh} ¦û¾Ú¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
psql -h localhost -p 3333 -d mpw
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\item  ª`·N§A­n¥Î {\bfseries -h} °Ñ¼Æ¨Ï±o§Aªº«È¤á¥Î TCP ´¡®y¦Ó¤£¬O Unix
´¡®y¡C¦pªG§A¥Î {\bfseries 5432} §@³q¹Dªº²×ÂI§A¥i²¤¥h°ðªº°Ñ¼Æ¡C
\end{itemize}



\subsection{Kerberos »{ÃÒ}

Kerberos ¬O¤@­Ó·~¬É¼Ð·Çªº«O¦w»{ÃÒ¨t²Î¡A¾A¥Î©ó¸g¹L¤½¥Îºôµ¸ªº¤À´²¦¡¨t²Î¡C

{\bfseries ¦p¦ó¨ú±o}
Kerberos »{ÃÒ¨t²Î¨Ã¤£ÀH¦P Postgres ´²§G¡C¤£¦Pª©¥»ªº Kerberos
¦h¥H¥i¨Ñ¿ï¾Üªº³n¥óªº§Î¦¡¦Û§@·~¨t²Î¼t°Ó±o¨ì¡C¦¹¥~¡A­ìµ{¦¡½Xªºµo¦æª©¥» 
(distribution) ¥i¦Û MIT Project Athena ±o¨ì¡C

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
ª`·N¡J§Y¨Ï§A¨Ï¼t°Ó´£¨Ñ¤F Kerberos¡A§A¤´¥i¯à·Q¥Î MIT 
ª©¡A¦]¬°¤@¨Ç¼t°Óªºª©¥»³Q¬G·N§ËÃa¥H­P¤£¯à©M MIT ª©¥»¦X§@¡C
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


¦³Ãö Kerberos ªº¬d¸ß¥i´£¥æ§Aªº¼t°Ó©Î MIT Project Athena¡Cª`·N
FAQLs¡]±`°Ý°ÝÃD¦W³æ¡AFrequently-Asked Questions Lists) ·|³Q©w®É±H¦Ü Kerberos
³q«H½×¾Â¡]±H«H¥h­q¾\¡^¡A©M USENET ·s»D²Õ¡C

{\bfseries ¦w¸Ë¡J}
¦w¸Ë Kerberos ¦b Kerberos Installation Notes ¤¤¤w¸Ô²Ó»¡©ú¡C­n½T©w¦øªA¾¹Áä½XÀÉ
(key file)¡]{\bfseries srvtab} ©Î {\bfseries keytab}¡^¥i³Q postgres
¥Î¤áÅª¨ì¡CÄy³]©w {\bfseries src/Makefile.global} ÀÉªº KRBVERS ÅÜ¼Æ¡APostgres 
©Î¨ä«È¤áµ{¦¡¥i½sÄ¶¬°¨Ï¥Î MIT Kerberos ³q°T¨ó©wªº²Ä¥|©Î¤­ª©¡C§A¤]¥i§ïÅÜ 
Postgres ´Á±æ§ä¨ì¬ÛÃö¨ç¦¡®w¡B¼ÐÀYÀÉ©M¦Û¤vªº¦øªA¾¹Áä½XÀÉªº¦ì¸m¡C½sÄ¶§¹«á¡A
Postgres ­nµn°O¬°¤@­Ó Kerberos ªA°È¡C½Ð°Ñ¾\ Kerberos  Operations Notes ©M¬ÛÃö 
manual pages ¥H¨ú±o¦³Ãöµn°OªA°Èªº¸Ô±¡¡C

{\bfseries ¾Þ§@¡J}
¦w¸Ë¤§«á¡APostgres ¦b¦U¤è­±À³¦p¤@¯ë Kerberos
ªA°È¹B§@¡C­nª¾¹D»{ÃÒªº¨Ï¥Î¤èªk¡A½Ð°Ñ¾\ {\itshape PostgreSQL User's Guide\/} ¦³Ãö
{\bfseries postmaster} ©M {\bfseries psql} ªº³¹¸`¡C

¦b Kerberos ²Ä¤­ª©±¾³¨
(hooks)¡A¹ï¥Î¤á©MªA°È©R¦W§@¤F¥H¤U°²³]¡]¤]½Ð°Ñ¾\¥H¤Uªí®æ¡^¡C
\begin{itemize}
\item  ¥Î¤áªº¥D­n¦WºÙ (principal names¡Aanames) ²Ä¤@­Ó³¡¥÷¤¤°²³]§t¦³ Unix /
Postgres ¥Î¤á¦WºÙ¡C
\item  Postgres
ªA°È°²³]¦³¨â­Ó³¡¥÷¡AªA°È¦WºÙ©M¥D¾÷¦WºÙ¡C«áªÌ¦p¦P²Ä¥|ª©ªº®æ¦¡
¡]§Y°£¥h©Ò¦³°ì¦Wªº³¡¤À¡^¡C
\end{itemize}


\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
                ªí®æ¡JKerberos °Ñ¼Æ¨Ò¤l
 ------------------------------------------------------
 °Ñ¼Æ       ¨Ò¤l 
 ------------------------------------------------------
 user       frew@S2K.ORG
 user       aoki/HOST=miyu.S2K.Berkeley.EDU@S2K.ORG
 host       postgres_dbms/ucbvax@S2K.ORG
 ------------------------------------------------------
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\section{PostgreSQL ªº«eºÝ GUI ¤u¨ã¡]¹Ï¹³¨Ï¥ÎªÌ¬É­±¡^}

ºô­¶ÂsÄý¾¹¦b¥¼¨Ó±N·|¦¨¬°³Ì¬y¦æªº«eºÝ GUI¡C«ØÄ³§A§â©Ò¦³¡u¯ª¶Ç¡vªºµøµ¡ 95/NT
µ{¦¡§ï¼g¬°¦bºô¤W°õ¦æªºµ{¦¡¡C

§A­n¨Ï¥Îºô¤WÀ³¥Îµ{¦¡¦øªA¾¹¦p \ref{Enhydra} {()}¡]¨Ï¥Î Java¡^©Î \ref{Zope} {()}¡]¨Ï¥Î Python¡^©Î \ref{OpenACS} {()}¡C

³Ì¨Îºô¤W©R¥O½Z (script) ½s¼g¡]©Î½sÄ¶¡^»y¨¥¬O \ref{PHP} {(PHP+Zend  ½sÄ¶¾¹)}¡C{\bfseries PHP} ¥\¯à¤Q¤À±j«l¡A¦]¬°¥¦§â Perl¡BJava¡BC++ ©M Javascript 
ªº¥\¯àµ²¦X¨ì¤@ºØ»y¨¥¤¤¡A¦Ó¥B¥i©ó©Ò¦³§@·~¨t²Î¡XUnixes ©Mµøµ¡ NT/95 °õ¦æ¡C

±Æ¦W¥H³ßÅwªºµ{«×¬°¥ý«á¡A³Ì¨Î¤u¨ã¬°
\begin{itemize}
\item  Enhydra ¦b \ref{Enhydra} {()} ¥[¤W Borland Java JBuilder Linux ª© \nameurl{http://www.inprise.com}{}
\item  Zope ¦b \ref{Zope} {()}
\item  OpenACS ¦b \ref{OpenACS} {()}
\item  PHP ©R¥O½Z©M Zend ½sÄ¶¾¹ \ref{PHP} {(PHP+Zend ½sÄ¶¾¹)}
\item  X-Designer ¤ä´© C++, Java ©M MFC \nameurl{http://www.ist.co.uk/xd}{}
\item  Windows95 ©M Unix ª©ªº QT ¦b \nameurl{http://www.troll.no}{} ©M \nameurl{ftp://ftp.troll.no}{}
\item  Code Crusader ¦b Linux cdrom ¤¤¡A®Ú¾Ú MetroWorks Code Warrior 
¼g¦¨ªº§K¶O³n¥ó \nameurl{http://www.kaze.stetson.edu/cdevel/code_crusader/about.html}{}
\item  MetroWorks ªº Code Warrior \nameurl{http://www.metrowerks.com}{}
\item  GNU Prof C++ IDE¡A¨Ó¦Û \nameurl{http://www.redhat.com}{(Redhat)}
Cygnus \nameurl{http://www.cygnus.com}{} 
\item  Borland C++ Builder Linux ª©\nameurl{http://www.inprise.com}{}
\item  Borland Java JBuilder Linux ª©\nameurl{http://www.inprise.com}{}
\end{itemize}


¥H³Ì¨Î¬°¥ýªº»y¨¥¿ï¾Ü¡X
\begin{enumerate}
\item  Java¡A¦ý¥¦ªºµ{¦¡°õ¦æ±o«ÜºC¡A¦Ó¥B­n±ÂÅv¶O¡CC++ ¤ñ Java {\bfseries §Ö¤­­¿}¡I¡I
\item  Python¡]±j¤jªºª«¥ó¾É¦V©R¥O½Z»y¨¥¡^¡C
\item  PHP ¸Uºûºô¦øªA¾¹©R¥O½Z¥[¤W HTML¡BDHTML¡BJavascript «È¤áºÝ©R¥O½Z¤Î 
Java-Applet¡C
\item  Perl ©R¥O½Z»y¨¥¨Ï¥Î Perl-Qt ©Î Perl-Tk \ref{Perl Database Interface} {(Perl ¸ê®Æ®w¤¶­±)}
\item  Omnipresent ©M Omnipotent »y¨¥ C++ (GNU g++)¡J
\begin{itemize}
\item  Fast CGI¡]¥H C++ ¼g¦¨¡^¥[¤W Javascript/Java-Applet §@¬°ºô­¶«eºÝ¤¶­±
\item  GNU C++ ¥[ QtEZ ©Î QT
\item  GNU C++ ¥[ Lesstif ©Î Motif¡C
\end{itemize}
\end{enumerate}


ÁÙ¦³¨ä¥L¤u¨ã¡XPostgreSQL µo¦æª©¥» (distribution) ¤¤¦³¤@­Ó¦W¬°¡¥pgTcl¡¦ªº 
Tcl/Tk ¤¶­±µ{¦¡®w¡CTcl/Tk ¦³¤@­Ó¦W¬° SpecTcl ªººî¦X¶}µoÀô¹Ò¡C

\begin{itemize}
\item  Lesstif Motif ¤u¨ã \nameurl{ftp://ftp.redhat.com/pub/contrib/i386/lesstif*.rpm}{}
\item  Vibe Java/C++ ¦b \nameurl{http://www.LinuxMall.com/products/00487.html}{}
\item  JccWarrior \nameurl{ftp://ftp.redhat.com/pub/contrib/i386/jcc*.rpm}{}
\item  Tcl/Tk \nameurl{http://www.scriptics.com}{}
\item  ¦W¬° INCR ªº Tcl ª«¥ó¾É¦V©µ¦ù \nameurl{http://www.tcltk.com}{}
\item  Visual TCL ºô¯¸ \nameurl{http://www.neuron.com}{}
\item  Visual TCL Redhat rpm ¦b \nameurl{ftp://ftp.redhat.com/pub/contrib/i386/visualtcl*.rpm}{}
\item  \nameurl{http://sunscript.sun.com/}{}
\item  \nameurl{http://sunscript.sun.com/TclTkCore/}{}
\item  \nameurl{ftp://ftp.sunlabs.com/pub/tcl/tcl8.0a2.tar.Z}{}
\item  Java FreeBuilder \nameurl{ftp://ftp.redhat.com/pub/contrib/i386/free*.rpm}{}
\item  SpecTCL \nameurl{ftp://ftp.redhat.com/pub/contrib/i386/spec*.rpm}{}
\item  PostgreSQL ªº Java RAD ¤u¨ã Kanchenjunga  \nameurl{http://www.man.ac.uk/~whaley/kj/kanch.html}{}
\item  Applixware ¤u¨ã \nameurl{http://www.redhat.com}{}
¡]Ä¶«ö¡JRedhat ¦­¤w°±°â Applix ²£«~¡C¡^
\item  XWPE X Window Programming Environment \nameurl{http://www.identicalsoftware.com/xwpe/}{} ©Î \nameurl{ftp://ftp.rpi.edu/~payned/xwpe}{}
\nameurl{ftp://ftp.redhat.com/pub/contrib/i386/xwpe*.rpm}{}
\item  XWB X Window Work Bench \nameurl{ftp://ftp.redhat.com/pub/contrib/i386/xwb*.rpm}{}
\item  NEdit \nameurl{ftp://ftp.redhat.com/pub/contrib/i386/nedit*.rpm}{}
\end{itemize}


§A¤]¥i¦bµøµ¡ 95 ¤¤¨Ï¥Î Borland C++ Builder¡BDelphi¡BBorland JBuilder¡B
PowerBuilder ¸g ODBC/JDBC ÅX°Êµ{¦¡³s±µ¨ì unix ¹q¸£ªº PostgreSQL¡C


\section{PostgreSQL ªº¤¶­±ÅX°Êµ{¦¡}




\subsection{PostgreSQL ªº ODBC ÅX°Êµ{¦¡}

ODBC ¥Nªí¥Ñ·L³n¨î©wªº¡¥Open DataBase Connectivity¡¦¡C
¥¦¬O±q¤£¦P¼t°Óªº¤£¦P¸ê®Æ®w¦s¨ú¸ê®Æªº¬y¦æ¤¶­±¡C¨Ï¥Î ODBC 
ÅX°Êµ{¦¡¼g¦¨ªº³n¥ó«OÃÒ¥i¥Î©ó¤£¦P¸ê®Æ®w¡A¦p PostgreSQL¡BOracle¡BSybase ©M 
Informix µ¥¡C

\begin{itemize}
\item  \nameurl{http://www.insightdist.com/psqlodbc}{PostODBC} 
¤w¸g¥]¬A¦bµo¦æª©¥»¤¤¡C½Ð°Ñ¾\¥Dºô­¶ \nameurl{http://www.postgresql.org}{}¡C
¥¦¤w¥]¬A¦b PostgreSQL ¥úºÐ¤¤¡C
\item  ¦b \nameurl{http://www.iodbc.org}{} ªº¶}©ñ­ì©l½X ODBC ±M®×¡C
\item  \nameurl{http://www.openlinksw.com}{} Open Link Software Corporation 
°â½æ PostgreSQL ©M¨ä¥L¸ê®Æ®wªº ODBC ÅX°Êµ{¦¡¡C¦o¤]°e¥X§K¶Oªº ODBC (¦WÃB¦³­­¡^¡C
\item  Insight ªº PostgreSQL ODBC \nameurl{http://www.insightdist.com/psqlodbc}{} ³o¬O PostODBC ªº©x¤èºô¯¸¡C
\item  FreeODBC ®M¥ó \nameurl{http://www.ids.net/~bjepson/freeODBC/}{}¡C³o¬O¤@­Ó§K¶Oªº ODBC¡C
\item  PostgreSQL ªº ODBC 32 Explorer \nameurl{http://members.nbci.com/anhr}{} 
\end{itemize}



\subsection{PostgreSQL ªº UDBC ÅX°Êµ{¦¡}

UDBC ¬O¤@ºØ¿W¥ß©óÅX°Êµ{¦¡ºÞ²z­û (driver managers) ©M DLL ¤ä´©ªºÀRºA ODBC 
ª©¥»¡A¥Î¨Óª½±µ§â¸ê®Æ®w³s±µ¯à¤O´O¤J¨ìÀ³¥Î³n¥ó¤¤¡C
\begin{itemize}
\item  \nameurl{http://www.openlinksw.com}{} Open Link Software Corporation 
¥X°â PostgreSQL ©M¨ä¥L¸ê®Æ®wªº UDBC ÅX°Êµ{¦¡¡COpen Link ¤]°e¥X§K¶Oªº UDBC 
(¦WÃB¦³­­¡^¡C
\end{itemize}



\subsection{PostgreSQL ªº JDBC ÅX°Êµ{¦¡}

JDBC ¥Nªí¡¥Java DataBase Connectivity¡¦¡CJava ¬O¤@ºØª@¶§ (Sun Microsystems) 
©Ò¶}µoªº¿W¥ß©ó¥­¥xªºµ{¦¡»y¨¥¡CJava µ{¦¡³]­p®v³Q¹ªÀy¨Ï¥Î JDBC 
¨Ó¼¶¼g¸ê®Æ®wµ{¦¡¡A¥H¼W±jµ{¦¡¦b¤£¦P¸ê®Æ®w¡A¦p PostgreSQL¡BOracle¡BInformix 
µ¥¤§¶¡ªº²¾´Ó¯à¤O¡C¦pªG§A¼g Java µ{¦¡¡A§A¥i¦b¥H¤Uºô¯¸¨ú±o PostgreSQL ªº JDBC 
ÅX°Êµ{¦¡¡C

JDBC ÅX°Êµ{¦¡¤w¥]¬A¦b PostgreSQL µo¦æª©¥»ªº postgresql-jdbc*.rpm ®M¥ó¤¤¡C

\begin{itemize}
\item  \nameurl{http://www.demon.co.uk/finder/postgres/index.html}{} ª@¶§ 
Java ªº PostgreSQL ³s±µ
\item  \nameurl{ftp://ftp.ai.mit.edu/people/rst/rst-jdbc.tar.gz}{}
\item  \nameurl{http://www.openlinksw.com}{} Open Link Software Corporation 
¥X°â PostgreSQL ©M¨ä¥L¸ê®Æ®wªº JDBC ÅX°Êµ{¦¡¡COpen Link ¤]°e¥X§K¶Oªº JDBC 
(¦WÃB¦³­­¡^¡C
\item  JDBC ­^°êºô¯¸ \nameurl{http://www.retep.org.uk/postgres}{}
\item  JDBC FAQ ºô¯¸ \nameurl{http://eagle.eku.edu/tools/jdbc/faq.html}{}
\end{itemize}


JDBC ªººô­¶¡B¾É¤Þ©M FAQ ¦b¡J
\begin{itemize}
\item  JDBC HOME \nameurl{http://splash.javasoft.com/jdbc}{}
\item  JDBC ¾É¤Þ \nameurl{http://www.javasoft.com/products/jdk/1.1/docs/guide/jdbc}{}
\item  JDBC FAQ \nameurl{http://javanese.yoyoweb.com/JDBC/FAQ.txt}{}
\end{itemize}

½Ð°Ñ¦Ò \ref{Testing Java} {(´ú¸Õ Java ¤¶­±)} ¤@¸`¡C


\subsection{PostgreSQL ªº Java}

Java µ{¦¡³]­p®v·|Ä±±o³o¨Ç¹ï¥L­Ì«Ü¦³¥Î¡C
\begin{itemize}
\item  \nameurl{ftp://ftp.redhat.com/pub/contrib/i386}{} ¬Ý 
postgresql-jdbc-*.rpm
\item  \nameurl{http://www.blackdown.org}{}
\end{itemize}

½Ð°Ñ¦Ò \ref{Testing Java} {(´ú¸Õ Java ¤¶­±)} ¤@¸`¡C


\section{PostgreSQL ªº Perl ¸ê®Æ®w¤¶­± (Database Interface, DBI) \label{Perl Database Interface}}




\subsection{PostgreSQL ªº PERL ¤¶­±}

PERL ¬O¡¥Practical Exptraction and Report Language¡¦ªºÂ²¼g¡C
¥@¤W©Ò¦³³nµw¥ó¥­¥x³£¥i¨Ï¥Î Perl¡C§A©Ò¦bµøµ¡ 95/NT¡BÄ«ªG³Áª÷¶ð iMac¡B©Ò¦³ 
Unix ¡]Solaris¡BHPUX¡BAIX¡BLinux¡BIrix¡BSCO µ¥µ¥¡^¡B¤j«¬¹q¸£ MVS¡B®à­±ªº 
OS/2¡BOS/400¡BAmdahl UTS ©M¨ä¥L«Ü¦h¹q¸£¡CPerl 
{\bfseries ¬Æ¦Ü}¥i¦b«Ü¦h¤£¬y¦æ©M¤£¬°¤Hª¾ªº¾Þ§@¨t²Î©Mµw¥ó°õ¦æ¡I¡I©Ò¥H¡A¦b¬Ý¨ì 
Perl ¦b¤@­Ó¨u¨£ªº¾Þ§@¨t²Î¤W°õ¦æ®É¡A¤£¥²¤jÅå¤p©Ç¡C§A¥i¥H·Q¹³¨ì Perl 
ªº¨Ï¥ÎªÌ©M¶}µo¤H­ûªº¼Æ¶q¡C©M¡§C¡¨»y¨¥¬Û¦ü¡APerl 
¤w¦³«Üªø¹Ø©R¡A¦Ó¦b{\bfseries ¥¼¨Ó¼Æ¤d¦~}¤´¤j¦æ¨ä¹D¡IPerl ªº°õ¦æ³t«×¤ñ Java 
§Ö{\bfseries ¤Q­¿}¡A¦³®É¬Æ¦Ü¤ñ¡§C¡¨§Ö¡CJava 
¬O¤@­Ó«D±`½ÆÂøªº¨t²Î¡A¬J¦³µêÀÀ¾÷¾¹¡A¤S¦³ª½Ä¶¾¹¡A¨Ï±o¥¦«D±`½wºC¡B¤£Ã­©w©M¤£¥i¾a¡C
Perl «hÂ²¼ä¡B§Ö³t¡A§ó¬Oª«¥ó¾É¦V¡C

PostgreSQL ªº Perl ¤¶­±¤w¥]¬A¦b PostgreSQL ªº¦w¸Ë®M¥ó¤¤¡C½Ð°Ñ¬Ý 
src/pgsql\_perl5 ¥Ø¿ý¡C
\begin{itemize}
\item  Pgsql\_perl5 ¹q¶lÁpµ¸¦a§}¡J
\onlynameurl{E.Mergl@bawue.de}
\item  Perl ºô­¶ \nameurl{http://www.perl.com/perl/index.html}{}
\item  Perl ¾É¤Þ¡A½Ð¦b \nameurl{http://reference.perl.com/}{} °Ñ¬Ý¾É¤Þ¥Ø¿ý
\item  Perl FAQ ¦b \nameurl{http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/}{}
\item  ±q \nameurl{http://www.perl.com/CPAN/modules/by-module/CPAN}{} ¨ú±o©Ò¦³ 
Perl ¼Ò²Õ¤§¥À¡A¥´¤U¡¥/usr/bin/cpan¡¦¡B¡¥man CPAN¡¦©M¼Æ¥H¤d­pªº¼Ò²Õ \nameurl{http://www.perl.com/CPAN-local/modules/by-module}{}¡C
\item  Perl GUI ¨Ï¥ÎªÌ¤¶­± Perl-Qt rpm¡J\nameurl{ftp://ftp.redhat.com/pub/contrib/i386}{} 
¤]½Ð¬Ý PerlQt-1.06-1.i386.rpm
\item  Perl GUI ¨Ï¥ÎªÌ¤¶­± Perl-Qt¡J\nameurl{http://www.accessone.com/~jql/perlqt.html}{}
\item  Perl GUI ¨Ï¥ÎªÌ¤¶­± Perl-XForms¡J\nameurl{ftp://ftp.redhat.com/pub/contrib/i386}{}¡A´M§ä Xforms4Perl-0.8.4-1.i386.rpm
\item  Perl GUI ¨Ï¥ÎªÌ¤¶­± Perl-Tk¡J\nameurl{ftp://ftp.redhat.com/pub/contrib/i386}{}
\item  Perl GUI kits¡J\nameurl{http://reference.perl.com/query.cgi?ui}{}
\item  Perl ¸ê®Æ®w¤¶­±¡J\nameurl{http://reference.perl.com/query.cgi?database}{}
\item  Perl ¨ì "C" ªºÂ½Ä¶¤u¨ã¡J\nameurl{http://www.perl.com/CPAN-local/modules/by-module/B/}{}
´M§ä Compiler-a3.tar.gz
\item  §â Perl ½sÄ¶¬°¥i°õ¦æÀÉ¡CPerl2Exe ¬O¤@­Ó¥i§â perl
©R¥O½ZÂà¬°¥i°õ¦æÀÉªºªº«ü¥O¦C¤u¨ã¡C\nameurl{http://www.indigostar.com/perl2exe.htm}{}
\item  Bourne shell ¨ì Perl ªºÂ½Ä¶¤u¨ã¡J\nameurl{http://www.perl.com/CPAN/authors/id/MERLYN/sh2perl-0.02.tar.gz}{}
\item  awk Âà¬° perl ªº a2p ©M sed Âà¬° perl ªº s2p ¤w¥]¬A¦b PERL ´²§G¤¤¡C
\item  ¤]½Ð¬Ý comp.lang.perl.* µ¥¦³Ãö PERL ªº·s»D²Õ
\end{itemize}



\subsection{Perl ¸ê®Æ®w¤¶­± DBI}


\subsubsection{¦ó¿× DBI¡H}

Perl ¸ê®Æ®w¤¶­±¡]DBI¡^¬O Perl »y¨¥ªº¤@­Ó¸ê®Æ®w¦s¨úÀ³¥Îµ{¦¡¤¶­±¡]API¡^¡CPerl DBI
API ³W®æ©w¸q¤F¤@²Õ¨ç¼Æ¡BÅÜ¼Æ©MºD¨Ò¡A¥H´£¨Ñ¤@­Ó¤@­P¦Ó¿W¥ß©ó¹ê»Ú©Ò¥Î¸ê®Æ®wªº¤¶­±¡C
¸ê®Æ®wÅX°Êµ{¦¡¡]Perl DBI¡^ªºµo°_¤H¬°¤@©w¼Æ¶qªº°Ó·~¸ê®Æ®w¤ÞÀº¨î©w¼Ð·Ç¡A
©Ò¥H§A¥u»Ýªá«Ü¤Ö¤u¤Ò«K¥i±q Oracle Âà¨ì PostgreSQL¡C


\subsubsection{PostgreSQL ªº DBD ÅX°Êµ{¦¡}

¦b§A¦w¸Ë DBD PostgreSQL ¡]ÅX°Êµ{¦¡¡^«e¡A§A­n¥ý¦w¸Ë DBI¡A±q¥H¤U¦a¤è¨ú±o DBI
ÅX°Êµ{¦¡¡J
\begin{itemize}
\item  ¥ý±q \nameurl{http://www.perl.com/CPAN/modules/by-module/CPAN}{} 
¨ú±o©Ò¦³ Perl ¼Ò²Õ¤§¥À¡A¥´¡¥/usr/bin/cpan¡¦¡B¡¥man CPAN¡¦©M¼Æ¥H¤d­pªº¼Ò²Õ \nameurl{http://www.perl.com/CPAN-local/modules/by-module}{}¡C
\item  DBI ¼Ò²Õ \nameurl{http://www.perl.com/CPAN-local/modules/by-module/DBI}{}
\item  DBI ¼Ò²Õ \nameurl{http://www.symbolstone.org/technology/perl/DBI}{}
\item  DBI FAQ \nameurl{http://www.symbolstone.org/technology/perl/DBI/doc/faq.html}{}
\item  Perl DBI ªº°Ñ¦Ò¤å¥ó \nameurl{http://www.symbolstone.org/technology/perl/DBI}{}
\item  DBI ³q«H½×¾Â \nameurl{http://www.fugue.com/dbi}{}
\item  Perl ¸ê®Æ®w°Ñ¦Ò¤å¥ó \nameurl{http://www.perl.com/reference/query.cgi?section=database}{}
\item  ¤U¸ü DBI rpm ¡]ª`·N¡J¥i¯à¬OÂÂª©¡^\nameurl{http://rpmfind.net/linux/rpm2html/search.php?query=DBI}{}
\end{itemize}


¦b¦¹¨ú±o DBD-Pg
\begin{itemize}
\item  ¥ý±q \nameurl{http://www.perl.com/CPAN/modules/by-module/CPAN}{} 
¨ú±o©Ò¦³ Perl ¼Ò²Õ¤§¥À¡A¥´¡¥/usr/bin/cpan¡¦¡B¡¥man CPAN¡¦©M¼Æ¥H¤d­pªº¼Ò²Õ \nameurl{http://www.perl.com/CPAN-local/modules/by-module}{}¡C
\item  DBD ¼Ò²Õ \nameurl{http://www.perl.com/CPAN-local/modules/by-module/DBD}{}¡A§ä DBD-pg ÀÉ©Î
\nameurl{http://www.perl.com/CPAN/modules/by-module/DBD}{DBD}¡C
\item  Comprehensive Perl Archive Network CPAN \nameurl{http://www.perl.com/CPAN}{} ¦b³o³B¿ï¡¥Database¡¦¡]¦b Search ²°¤l¤W¤è¡^¡A
À»¿ï¡¥Go¡¦«ö¶s¡C
\item  ¹w¥ý½sÄ¶¤Fªºµøµ¡ NT/2000 ®M¥ó¥i¦b \nameurl{http://www.edmund-mergl.de/export/DBD-Pg.zip}{} ±o¨ì
\item  ¤U¸ü DBD rpm ¡]ª`·N¡J¥i¯à¬OÂÂª©¡^\nameurl{http://rpmfind.net/linux/rpm2html/search.php?query=DBD}{}
\item  Perl ¼Ò²Õ¡]¼Æ¥H¤d­p¡^\nameurl{http://www.perl.com/CPAN-local/modules/by-module}{}¡C
\end{itemize}



\subsubsection{DBI ªº§Þ³N¤ä´©}



\begin{itemize}
\item  ½Ð±N·N¨£©Î¿ù»~³ø§i³s¦P perl -v ©M perl -V ªº¿é¥X¡BPostgreSQL 
ªºª©¥»¡BDBD-pg ªºª©¥»¡BDBI ªºª©¥»±H¦Ü
\onlynameurl{E.Mergl@bawue.de}
\end{itemize}



\subsubsection{DBI ¤å¥ó}

³o¸Ì¦³¤@¨Ç DBI ªº¸ê®Æ¨Ó·½¡C

{\bfseries POD ¤å¥ó¡J} POD ¬O´O¤J¨ì perl µ{¦¡¤¤¥Î¥H¡§§Y³õ¡¨¸ÑÄÀµ{¦¡½Xªº¤@¬q¤å¥ó¡A
¥Î¥Hµ¹µ{¦¡³]­p®v©M¼Ò²Õªº¥Î®a´£¨Ñ¦³¥Îªº¸ê®Æ¡CDBI ©MÅX°Êµ{¦¡ªº POD 
¥¿¶V¨Ó¶V¬y¦æ¡A­n¾\Åª¦³Ãö¤å¥ó¡A½Ð¨Ï¥Î¥H¤U«ü¥O¡C

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
DBI ³W®æªº PO ¥i¥Î¥H¤U«ü¥O¾\Åª
        $ perldoc DBI

¨Ï¥Îµ²¦X¨ì DBD::Oracle ªº Oraperl ¼ÒÀÀ¼hªº¤H¥i¥Î¥H¤U«ü¥O¾\Åª¦p¦ó¥Î Oraperl 
¤¶­±½s¼gµ{¦¡¡J
        $ perldoc Oraperl

DBD::mSQL ¼Ò²Õªº¥Î®a¥iÄy¥H¤U«ü¥O¾\Åª¤@¨Ç¸ÓÅX°Êµ{¦¡ªº¿W®a¨ç¼Æ (private 
functions) ©M¯S²§¥\¯àªº¸ê®Æ¡J
        $ perldoc DBD::mSQL

POD ¤å¥ó¤¤¤]¥]§t±`¨£°ÝÃD¡C­n¾\Åªªº¸Ü½Ð¿é¤J¡J
        $ perldoc DBI::FAQ

POD ªº¤@¯ë¸ê®Æ¡X¦p¦ó¼¶¼g POD¡A¤Î¾ãÅéªº POD ­õ¾Ç¡A¥iÄy¥H¤U«ü¥O¾\Åª¡J
        $ perldoc perlpod
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

¦w¸Ë¤F Tk ¼Ò²Õªº¥Î®a¥i¯à·|¹ï¤@­Ó¦W¬° tkpod¡A¨Ï¥Î Tk ªº POD ¾\Åª¾¹¦³¿³½ì¡C¥¦·|§â 
POD ½s±Æ¨ì¤@­Ó¤è«K¤Î¥i¾\Åªªº§Î¦¡¡C

¤]½Ð¬Ý¬Ý
\begin{itemize}
\item  ¨Ó¦Û DBI ªº³q«H½×¾Âªº¸ê®Æ  \nameurl{http://www.symbolstone.org/technology/perl/DBI/tidbits}{}
\item  DBI Perl Journal ºô­¶ \nameurl{http://www.tpj.com}{}
\item ¡§DBperl¡¨³o¤å³¹¦b¤@¤E¤E¤»¦~¤Q¤@¤ëªº¡§Dr. Dobbs Journal¡¨µoªí¡C
\item ¡§The Perl5 Database Interface¡¨¡A¤@¥»¥Ñ Alligator Descartes ¼g¦¨¡A¥Ñ 
O'Reilly and Associates ¥Xª©ªº®Ñ¡C
\end{itemize}


¥Î®a¥i¯à°Ñ¥[ªº³q«H½×¾Â¬°¡J
\begin{itemize}
\item  ³q«H½×¾Â \nameurl{http://www.fugue.com/dbi}{}
\item  {\bfseries dbi-announce}
¹q¶l¦Ü \onlynameurl{dbi-announce-request@fugue.com}
¥H 'subscribe' ¬°¥¿¤å¤º®e
\item  {\bfseries dbi-dev}
¶}µo¤H­û±M¥Î
Email: \onlynameurl{dbi-dev-request@fugue.com}
¥H 'subscribe' ¬°¥¿¤å¤º®e
\item  {\bfseries dbi-users} ¤@¯ë°Q½×
Email: \onlynameurl{dbi-users-request@fugue.com}
¥H 'subscribe' ¬°¥¿¤å¤º®e
\item  ¬ü°ê³q«H¦s®w \nameurl{http://outside.organic.com/mail-archives/dbi-users/}{}
\item  ¼Ú¬w³q«H¦s®w \nameurl{http://www.rosat.mpe-garching.mpg.de/mailing-lists/PerlDB-Interest}{}
\end{itemize}



\subsubsection{µøµ¡ 95/NT ¦³¨S¦³ DBI ¤ä´©¡H}

DBI ©M DBD::Oracle ªº Win32 ª©¥»¤w¦¨¬° DBI ªº¼Ð·Ç³¡¤À¡C¦]¦¹¡A¤ñ DBI 0.81 
°ªªºª©¥»À³¸Ó·|¥¿±`¹B§@¡C³z¹L ODBC¡A§A¥i¥H¦s¨ú·L³n Access ©M SQL-Server 
¸ê®Æ®w¡C¦b DBI-0.79¡]¤Î¥H«á¡^¦³¤@­Ó Win32::ODBC DBI ¼ÒÀÀ¼h¡C¥¦¦W¬° 
DBI::W32ODBC¡C§A»Ý­n¨Ï¥Î Win32::odbc ¼Ò²Õ¡C
\begin{itemize}
\item  Win32 DBI \nameurl{http://www.symbolstone.org/technology/perl/DBI}{}
\item  Win32 ODBC \nameurl{http://www.roth.net}{}
\item  ·L³n SQL server ªº Perl ¤¶­± \nameurl{http://www.algonet.se/~sommar/mssql}{}
\end{itemize}



\subsubsection{°Ó·~¤ä´©¤Î°V½m}

{\bfseries PERL CLINIC : }
Perl Clinic ¥H¦X¬ù§Î¦¡¬° Perl¡BDBI¡BDBD::Oracle ©M Oraperl 
´£¨Ñ°Ó·~¤ä´©¡C³o¨Ç¤ä´©¬O¥Ñ DBI §@ªÌ Tim Bunce 
¤u§@ªº¤½¥q´£¨Ñªº¡C±ýª¾¸Ô±¡¡A½Ð¬Ý¡J
\begin{itemize}
\item  ¤ä´© \nameurl{http://www.perlclinic.com}{}
\item  ¤ä´© \nameurl{http://www.perldirect.com}{}
\item  °ö°V \nameurl{http://www.westlake.com/training}{}
\end{itemize}



\subsection{´ú¸Õ Perl ¤¶­±}

½Ð°Ñ¾\\ref{Testing Perl} {(´ú¸Õ Perl¡XPostgreSQL ¤¶­±)}¤@¸`


\section{PostgreSQL ºÞ²z¤u¨ã}




\subsection{PGACCESS - ºÞ²z PostgreSQL ªº GUI ¤u¨ã}

PgAccess ¬O PostgreSQL ªº Tcl/Tk ¤¶­±¡C¥¦¤w¸g¥]¬A¦b PostgreSQL 
ªºµo¦æ®M¥ó¤¤¡C§A¥i¯à·Q±q³oºô­¶§ä¥X¥¦¦³¨S¦³·sª©¥»¡J
\begin{itemize}
\item  \nameurl{http://www.flex.ro/pgaccess}{}
\item  ¦p¦³¥ô¦ó·N¨£¡B§ï¨}ªº«ØÄ³¡A¹q¶l¡J
\onlynameurl{teo@flex.ro}
\end{itemize}

pgaccess ªº¥Îªk
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# man xhost
# xhost +
# su - postgres
bash$ man pgaccess
bash$ export DISPLAY=<¥D¾÷¦W>:0.0
bash$ pgaccess mydatabase
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


PgAccess ªº¯S¦â

PgAccess µøµ¡¡XMain window, Table builder,
Table(query) view, Visual query builder.

Tables
\begin{itemize}
\item ¶}±Òªí®æ (tables) ¬d¾\¡A³Ì¦h¤G¦Ê­Ó¬ö¿ý¡]¥i¦b perferences µæ³æ§ó§ï¡^
\item Äy©ì¦²««ª½®æ½u (grid line) ­«¾ã¤j¤p¡]¦b¦CªíªÅ¶¡ (table space) 
¶i¦æ¤ñ¦b¦Cªí¥Ø¿ý (table header) ¦n¡^
\item ³æ®æ¤¤¦Û°Ê´«¦æ¡X¨C­Óªí®æªº°t¸m¿W¥ßÀx¦s
\item ¶×¤J/¶×¥X¨ä¥LÀÉ®×®æ¦¡¡]SDF¡BCSV¡^
\item ¹LÂo¥\¯à¡]¿é¤J¦p price{$>$}3.14 ªº¹LÂo¾¹¡^
\item ±Æ§Ç¥\¯à¡]¦Û¦æ¿é¤J»Ý±Æ§ÇªºÄæ¦ì¡^
\item §Y³õ½s¿è
\item §ï¨}¤Fªºªí®æ²£¥Í§U²z (table generator assistant)
\item §ï¨}¤FªºÄæ¦ì½s¿è
\end{itemize}


Queries
\begin{itemize}
\item ©w¸q¡B½s¿è©MÀx¦s¡§¥Î®a©w¸q¬d¸ß¡¨(user defined queries)
\item §â¬d¸ßÀx¦s§@¬°´ºÆ[ (views)
\item ¬d¸ßªº°õ¦æ
\item Æ[¬Ý select §Î¦¡ªº¬d¸ßµ²ªG
\item §R°£©M§ó§ï¬d¸ß¦WºÙ
\item ¨ã©ì¦²©M©ñ¤U¥\¯àªº Visual query builder¡C¦pªG§A¦³¦w¸Ë Netscape 
Navigator ªº Tcl/Tk ´¡¥ó¡A§A¥i¦b¦¹¬Ý¨ì¥¦¤u§@¡J
¡]Ä¶«ö¡J¤£ª¾¦b­þ¡H¡I¡^
\end{itemize}


§Ç¦C (sequence)
\begin{itemize}
\item ©w¸q¡B§R°£©MÀË¬d§Ç¦C
\end{itemize}


¨ç¼Æ (Function)
\begin{itemize}
\item ¨Ï¥Î SQL »y¨¥©w¸q¡BÀË¬d©M§R°£¨ç¼Æ
\end{itemize}


±N¨ÓÁÙ·|¦³¥H¤U§ï¶i
\begin{itemize}
\item ªí®æ³]­p¡]¼W¥[Äæ¦ì¡B§ó¦Wµ¥µ¥¡^
\item ¨ç¼Æ©w¸q
\item ³ø§i²£¥Í¾¹
\item °ò¥»ªº©R¥O½Z½s¼g¥\¯à
\end{itemize}




¦³Ãö LIBGTCL ªº¸ê®Æ

§A·|¥Î¨ì PostgreSQL ¨ì Tcl ªº¤¶­±µ{¦¡®w libpgtcl¡A©Ò¿×ªº Tcl/Tk 
¥i¡¥¸ü¤J¡¦¼Ò²Õ¡Clibpgtcl ©M­ì©l½X¦ì©ó PostgreSQL ªº /src/interfaces/libpgtcl 
¥Ø¿ý¡C¯S©w¨Ó»¡¡A§A»Ý­n¤@­Ó¥i¦b Tcl/Tk¡¥¸ü¤J¡¦ªº libpgtcl 
µ{¦¡®w¡C§Þ³N¤W¨Ó»¡¡A¥¦©M´¶³qªº PostgreSQL ¥i¸ü¤J¥ØªºÀÉ¨Ã¤£¬Û¦P¡A¦]¬° libpgtcl 
¬O¤@°ï¥ØªºÀÉ (object files) ªº¶°¦X¡C³oÀÉ®×¦b Linux ¦W¬° 
libpgtcl.so¡C§A¥i¦b¥H¤Wºô§}¤U¸ü¤@­Ó¬° Linux i386 
¨t²Î¹w¥ý½sÄ¶¤Fªºª©¥»¡C¥u»Ý§â³oÀÉ®×«þ¨©¨ì¨t²Îµ{¦¡®w¥Ø¿ý¡]/usr/lib¡^
§Y¥i¡C¦p¦³ºÃÃø¡A¨ä¤¤¤@­Ó¸Ñ¨M¤èªk¬O§R°£­ì©l½X¤¤¦³Ãö¸ü¤J libpgtcl.so 
ªº¤@¥y©M¨Ï¥Î pgwish¡]©Î wishpg¡^¨Ó¸ü¤J pgaccess.tcl¡A¦Ó«D wish¡A¦]¬°³o wish 
¤wÃìµ² libpgtcl ¨ç¦¡®w¡C

¦pªG§A¦b½sÄ¶ pgaccess ¥Ø¿ý®É¹J¨ì crypt not found ªº°ÝÃD¡A½Ð¨Ï¥Î -lcrypt¡C


\subsection{PostgreSQL ¹Ï«¬¤¶­±¬d¸ß¤u¨ã GtkSQL }

GtkSQL ¬O¤@­Ó¹Ï«¬¤¶­±¬d¸ß¤u¨ã¡]¹³ PostgreSQL ªº psql¡^¡C¥¦¥H GNU GPL 
µo¦æ¡C¨Ï¥Î Gtk+ 1.2.3 ©M PostgreSQL 6.3 ¶}µo¦Ó¦¨¡C

GtkSQL ªº¥Dºô¯¸¬° \nameurl{http://gtksql.sourceforge.net}{}¡C

¥¦ªº¥D­n¯S¦â¥]¬A¡J
\begin{enumerate}
\item  ¦h­Ó SQL ¼È¦s°Ï
\item  SQL ÃöÁä¦r¡Bªí®æ¦WºÙ©MÄæ¦ì¦Û°Ê§¹¦¨
\item  Â²©öÅã¥Üªí®æ©w¸q
\item  PostgreSQL ©M MySQL ¤ä´©¡]¦Ó¥B®e©ö¥[¤W¨ä¥L¸ê®Æ®w¡^
\end{enumerate}

GtkSQL ¥Ø«eªºª©¥»¬° v. 0.3¡C§A¥i¦b
\nameurl{https://sourceforge.net/project/?form_grp=533}{} ¤U¸ü­ì©l½X¡C


\subsection{µøµ¡¤¤ªº PostgreSQL ¤¬°Ê¦¡¬d¸ß¤u¨ã¡]WISQL ©Î MPSQL¡^}

MPSQL ´£¨Ñµ¹¨Ï¥ÎªÌ¤@­Ó¹Ï¹³ SQL ¤¶­±±±¨î PostgreSQL¡CMPSQL »P Oracle ªº SQL 
Worksheet ©Î·L³n SQL Server ªº¬d¸ß¤u¨ã WISQL Ãþ¦ü¡C¥¦¦³¤@­Óº}«Gªº GUI 
©M«ü¥O°O¿ý¡C§A¤]¥i¥H°Å¤U¤Î¶K¤W¡C¥¦ÁÙ¦³¨ä¥L¦³§U´£°ª¥Í²£¤Oªº¥\¯à¡C
\begin{itemize}
\item  \nameurl{http://www.troubador.com/~keidav/index.html}{}
\item  ¹q¶l¡J
\onlynameurl{keidav@whidbey.com}
\item  \nameurl{http://www.ucolick.org/~de/}{} ¦b tcl\_syb/wisql.html ÀÉ¤¤
\item  \nameurl{http://www.troubador.com/~keidav/index.html}{}
\item  ¹q¶l¡J
\onlynameurl{de@ucolick.org}
\end{itemize}



\subsection{¦W¬° PSQL ªº PostgreSQL ¤¬°Ê¦¡¬d¸ß¤u¨ã¡]ISQL¡^}

ISQL ¬O¨Ñ¤å¦r«ü¥O¦æ²×ºÝ¾÷¨Ï¥Îªº¡C³o¤w¥]¬A¦bµo¦æª©¥»¤¤¡A¦W¬° psql¡C©M Sybase 
ISQL¡BOracle SQLplus ¤Q¤À¬Û¦ü¡C¦b Unix «ü¥O´£¥Ü¿é¤J¡¥psql¡¦·|¥X²{ psql$>$ ´£¥Ü¡C
\begin{tscreen}
\begin{verbatim}
bash# su - postgres
bash$ man psql
bash$ psql mydatabase
¥´ \h ¥H¾\Åª«ü¥Oªº¨D§U°T®§
\end{verbatim}
\end{tscreen}

«D±`¨Ï¥ÎªÌ¤Íµ½©M©ö¥Î¡C
¥i¦b¥~®Ø©R¥O½Z (shell script) ¤¤¨Ï¥Î¡C


\subsection{MPMGR¡XPostgreSQL ªº¸ê®Æ®wºÞ²z¤u¨ã}

 
MPMGR ¬° PostgreSQL ¬O¨Ñ¤@­Ó¹Ï¹³ºÞ²z¤¶­±¡C§A¥i¦b¥H¤U¦a¤è§ä¨ì¥¦¡J
\begin{itemize}
\item  \nameurl{http://www.mutinybaysoftware.com/}{}
\item  Email:
\onlynameurl{keidav@mutinybaysoftware.com}
\item  \nameurl{http://www.troubador.com/~keidav/index.html}{} 
\item  ¹q¶l¡J
\onlynameurl{keidav@whidbey.com} 
\item  \nameurl{http://www.ucolick.org/~de}{} in file tcl\_syb/wisql.html 
\item  PostgreSQL ªº WISQL\nameurl{http://www.ucolick.org/~de/Tcl/pictures}{} 
\item ¹q¶l¡J
\onlynameurl{de@ucolick.org} 
\end{itemize}



\subsection{PgAdmin¡BPhpPgAdmin ¤u¨ã}

\begin{itemize}
\item  µøµ¡ 95/NT ªº PgAdmin ¤u¨ã
µøµ¡ 95/NT ªº PostgreSQL ¸ê®Æ®w³]­p¤u¨ã
\nameurl{http://www.pgadmin.freeserve.co.uk}{}
\item  ºô¤W¹B§@ªººÞ²z¤u¨ã¡XPostgreSQL ¥Îªº PhpPgAdmin ¦b
\nameurl{http://www.phpwizard.net/projects/phpPgAdmin}{}
\end{itemize}



\subsection{PgBash - SQL shell ¤u¨ã}

PgBash ªº¥\¯àÃþ¦ü psql¡C¦Ó¥B¡APgBash ¨Ï¥Î bash ªº¥N¸¹ 
(alias)¡B¨ç¼Æ¡B¾ú¥v½s¿è³Ð³y¥X¤@­ÓÆF¬¡ªº¤¬°Ê¾Þ§@Àô¹Ò¡A´£¨Ñ¦³¥Îªº¥\¯à¡C

PgBash ªº¥Dºô­¶¦b \nameurl{http://www.psn.co.jp/PostgreSQL/pgbash/index-e.html}{}

PgBash ¬O¤@­Ó¥]¬A PostgreSQL¡§ª½±µ SQL¡¨©Î¡§´O¤J¦¡ SQL¡¨ ("direct SQL" or the 
"embedded SQL") ¤¶­±ªº shell¡AÄy§ï¨} bash¡]¥Ø«e³Ì·sª©¬° 2.03¡^shell 
¦Ó¨Ó¡CPgBash ¥i¥Î§@µn¤J shell¡Bsub-shell¡]±q shell ±Ò°Êªº shell) ©M shell µ{¦¡¡C

¦b¦¹¡Aª½±µ SQL ¦³§âµ²ªGª½±µ¿é¥X¨ì¼Ð·Ç¿é¥Xªº¯à¤O¡C¦Ó´O¤J¦¡ SQL
¦³§â´£¨ú¥X¨Óªºµ²ªG³]©w¨ì shell ÅÜ¼Æªº¯à¤O¡C¥¦­Ì«h¦A¸g shell ©R¥O½Z (script) 
»y¨¥³B²z¡C

SQL »y¥y¡]¥H¤À¼Æ§@µ²§ô¦r§¹¡^³Q·í§@¤@­Ó shell «ü¥O³B²z¡A§Ú­Ì¥i¥H°õ¦æ SQL
»y¥y¨Ã¥Î©óºÞ¹D (pipeline)¡B§ï¦V©M­I´º¤u§@¿ï¶µ¡C¦¹¥~¡A¨Ï¥Î exec\_sql
«ü¥O¡A§Ú­Ì¥i¥Î¤£¦Pªº¿ï¶µ¨Ó°õ¦æ SQL »y¥y¡C¹ê»Ú°õ¦æ SQL ªº¨Ò¤l¦p¤U¡C
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
prompt> /usr/local/bin/pgbash                ¡K¡K±Ò°Ê pgbash
pgbash> connect to db2@xxx.com user sakaida; ¡K¡K³s±µ¨ì¸ê®Æ®w
pgbash> select * from test limit 100; | more ¡K¡K¨Ï¥ÎºÞ¹D
pgbash> select * from test; > /tmp/sel.dat & ¡K¡K¨Ï¥Î§ï¦V©M­I´º¤u§@
pgbash> addr='Osaka'
pgbash> insert into test values(
>  111,'name',                               ¡K¡K¥i¥H´«¦æ
> '$addr'                                    ¡K¡K¨Ï¥Î shell ÅÜ¼Æ
> );
pgbash> connect to db3@yyy.com user postgres;
pgbash> set connection db2;                  ¡K¡K§â¥Ø«eªº¸ê®Æ®w§ï¬° db2
pgbash> select * from test;                  ¡K¡K¦Û db2 ªº test ªí®æ¿ï¾Ü
pgbash> exec_sql -d db3 "select * from test3"¡K¡K³s±µ¨ì db3
pgbash> ls
pgbash> begin;
pgbash> declare cur cursor for select * from test;
pgbash> fetch in cur into :AA,:BB;           ¡K¡K³]©w shell ÅÜ¼Æ
pgbash> echo "AA=$AA, BB=$BB"
pgbash> end;
pgbash> fc fetch                             ¡K¡K½s¿è¾ú¥v¬ö¿ý©M°õ¦æ
pgbash> !echo                                ¡K¡K¦A¦¸ echo
pgbash> disconnect all                       ¡K¡KÃö³¬©Ò¦³³s±µ
pgbash> exit                                 ¡K¡Kµ²§ô pgbash
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{PostgreSQL ªº Webmin ¤u¨ã}

webmin ¤u¨ã¡]³z¹L¥i¥H¬O«O¦wªººô­¶¨ÓºÞ²z Unix ¹q¸£¡^ªº³Ì·sª©¥»¡]0.82 ª©¡^¦³¤@­Ó
PostgreSQL ¼Ò²Õ¡C§A¥i¨Ï¥Î³o¼Ò²Õ¨Ó·s¼W¥Î¤á¡B¸s²Õ¡B¸ê®Æ®w¡Bªí®æ¡A¤]¥i¬d¾\ªí®æ¡C

§A¥i¦b \nameurl{http://www.webmin.com/webmin}{} §ä¨ì webmin¡C


\section{PostgreSQL ¥Îªº¤¤¥¡³B²z¾¹}

°Ñ¾\¤å¥ó \nameurl{http://metalab.unc.edu/LDP/HOWTO/CPU-Design-HOWTO.html}{} 
¥H±o¨ì¥i¥Î©ó PostgreSQL ªº¤¤¥¡³B²z¾¹¦W³æ¡A¥»¤å¤]·|´£¨Ñ¦³Ãö¤¤¥¡³B²z¾¹ªº¸Ô±¡¡C

¥H¤U¤¤¥¡³B²z¾¹ (CPUs)¡]32 ¦ì¤¸©M 64 ¦ì¤¸¡^¥i°õ¦æ PostgreSQL¡C¥¦­Ì³£¹B¦æ Linux¡C
\begin{itemize}
\item  ³B²z¾¹¥Dºô¯¸¬O¡JGoogle ·j´M¤ÞÀº CPU
¯¸¡§Computers{$>$}Hardware{$>$}Components{$>$}Microprocessors¡¨\nameurl{http://directory.google.com/Top/Computers/Hardware/Components/Microprocessors}{}
\end{itemize}


¥H¤U¬° GNU/GPL ¶}©ñ­ì©l½X³B²z¾¹¦W³æ¡J
\begin{itemize}
\item  ¶}©ñ­ì©l½X³B²z¾¹ºô¯¸¡XGoogle ·j´M "Computers{$>$}Hardware{$>$}Open Source"
\nameurl{http://directory.google.com/Top/Computers/Hardware/Open_Source}{}
\item  OpenRISC 1000 Free 32-bit ³B²z¾¹ IP ®Ö¤ß¡A»P±MÂ_ªº ARM ©M MIPS
Ävª§¡A¦ì©ó \nameurl{http://www.opencores.org/cores/or1k}{}
\item  OpenRISC 2000 ¦ì©ó \nameurl{http://www.opencores.org}{}
\item  ¼Ú¬w¤ÓªÅÁ`¸pªº ESA-32bit ©M ESA-64bit ³B²z¾¹¡§LEON¡¨Sparc \nameurl{http://www.estec.esa.nl/wsmwww/leon}{}
\item  GNU/GPL Freedom 64-bit F-CPU \nameurl{http://www.f-cpu.org}{} ©Î \nameurl{http://f-cpu.tux.org}{}
¬M®g¯¸¥x¦ì©ó \nameurl{http://www.f-cpu.de}{}
\item  STM 32 ¦ì¤¸¡AÂù¦V¶W¯Â¶q (2-way superscalar) RISC ³B²z¾¹ \nameurl{http://www.asahi-net.or.jp/~uf8e-itu}{}
\item  ¥H Verilog ©Î VRML ¼g¦¨ªº§K¶O·L³B²z¾¹©M DSP IP ®Ö¤ß \nameurl{http://www.cmosexod.com}{}
\item  ¥i¨Ï¶}µo¥[§Öªº§K¶Oµw¥ó®Ö¤ß \nameurl{http://www.scrap.de/html/opencore.htm}{}
\item  Opencores org¡X¶}©ñ­ì©l½X¡B¦Û¥Ñ IP core \nameurl{http://www.opencores.org}{}
\item  Linux ¶}©ñµw¥ó©M§K¶O EDA ¨t²Î \nameurl{http://opencollector.org}{}
\item  ARM ³B²z¾¹ \nameurl{http://www.arm.com/Documentation}{}
\item  Cogent ³B²z¾¹ \nameurl{http://www.cogcomp.com}{}
\end{itemize}


¥H¤U¬°°Ó·~³B²z¾¹¦W³æ¡J
\begin{itemize}
\item  «XÃ¹´µªº E2k 64-bit CPU¡]«Ü§Öªº³B²z¾¹¡I¡I¡I¡^
ºô¯¸¡J\nameurl{http://www.elbrus.ru/roadmap/e2k.html}{}
Elbrus ¤w©M¬ü°êª@¶§·L¨t²Îµ²¬°¦X§@¥ë¦ñ¡C
\item  Áú°ê¤T¬P (Samsung) 64 ¦ì¤¸³B²z¾¹¡A¨Ó¦Û DEC Alpha¡C
\nameurl{http://www.samsungsemi.com}{}
Alpha-64bit ³B²z¾¹¦b \nameurl{http://www.alpha-processor.com}{}
¤T¬P©M¬ü°êªº Compaq ¥¿¦X§@¶}µo Alpha ³B²z¾¹¡C
\item  ­^¯Sº¸ (Intel) IA 64 \nameurl{http://developer.intel.com/design/ia-64}{}
\item  ¥þ¬ü¹F (Transmeta) crusoe ³B²z¾¹¡A©M¤£¤[±N¨Óªº¥þ¬ü¹F 64 ¦ì¤¸³B²z¾¹¡C
\nameurl{http://www.transmeta.com}{}
\item  Sun Ultra-sparc 64 ¦ì¤¸³B²z¾¹
\nameurl{http://www.sun.com}{}
©Î \nameurl{http://www.sunmicrosystems.com}{}
\item  MIPS¡@RISC ³B²z¾¹ \nameurl{http://www.mips.com}{}
\item  SGI Graphics MIPS Architecture ¤¤¥¡³B²z¾¹ \nameurl{http://www.sgi.com/processors}{} 
\item  IDT MIPS Architecture ¤¤¥¡³B²z¾¹ \nameurl{http://www.idt.com}{}
\item  IBM Power PC¡]¼¯¦«Ã¹©Ô¡^\nameurl{http://www.motorola.com/SPS/PowerPC/index.html}{}
\item  ¼¯¦«Ã¹©Ô´O¤J¦¡³B²z¾¹¡CÎÚ¾Ú PowerPC¡BM-CORE¡BColdFire¡BM68k ©Î M68HC 
®Ö¤ß \nameurl{http://www.mot-sps.com}{}
\item  M68k ©Î  M68K ®Ö¤ß \nameurl{http://www.mot-sps.com}{}
\item  ¤é¥ß SuperH 64-bit RISC ³B²z¾¹ SH7750 \nameurl{http://www.hitachi.com}{} ¦pªG¤@¦¸¶R¤@¸U­Ó¡A¨C­Ó¥u°â¥|¤Q¬ü¤¸¡C
\item  Fujitsu 64-bit ³B²z¾¹ \nameurl{http://www.fujitsu.com}{}
\item  HAL (California) Super-Sparc 64-bit ³B²z¾¹ \nameurl{http://www.hal.com}{} ¤]©M Sun ªº sparc µ²ºc¬Û®e¡C
\item  Pyramid Technologies ªº Seimens Pyramid ¤¤¥¡³B²z¾¹
\item  Intel X86 ¨t¦C 32-bit ¤¤¥¡³B²z¾¹¡A©bÄË¡BÁÉ´­µ¥µ¥¡C
\item  AMDs X86 ¨t¦C 32-bit ¤¤¥¡³B²z¾¹¡AK-6¡BAthlon µ¥µ¥¡C
\item  National's Cyrix X86 ³B²z¾¹ 32-bit CPUs Cyrix µ¥µ¥¡C 
\item  ¨ä¥L°ê®a¡]¥xÆW¡BÁú°ê¡A¤é¥»¡^ªº¨ä¥L¤¤¥¡³B²z¾¹¡H¡H½Ð§i¶D§Ú¡K¡K
\end{itemize}


¨ä¥L­«­nªº³B²z¾¹ºô¯¸¬°¡X
\begin{itemize}
\item  ¤Ü¥|¤p®É¥þ²y³B²z¾¹·s»D \nameurl{http://www.newsnow.co.uk/cgi/NewsNow/NewsLink.htm?Theme=Processors}{}
\item  ¹q¸£µ²ºcºôÛÚ¦ì©ó \nameurl{http://www.cs.wisc.edu/~arch/www}{}
\item  ARM ³B²z¾¹ \nameurl{http://www.arm.com/Documentation}{}
\item  °¶¤jªº³B²z¾¹ \nameurl{http://www.cs.uregina.ca/~bayko/cpu.html}{}
\item  Microdesign ¸ê·½ \nameurl{http://www.mdronline.com}{}
\end{itemize}



\section{¥u¨Ï¥Î¤@­ÓÅã¥Ü¾¹ (monitor) ¨Ó³]©w¦h¥x PostgreSQL ¹q¸£}

 
¦pªG§A¤£·Qªá¿ú©óµw¥óªº¿ï¾Ü¾¹¡A§A¥i{\bfseries ¨Ï¥Î VNC (Vitual Network Computing)
§Þ³N}¡A¨Ó¦Û¹q°T·~¥¨¤H AT \& T¡C VNC ¬O GPL ªº¡A¬O¤@­Ó¦Û¥Ñ³n¥ó¡CÄyµÛ
VNC¡A§A¥i¦b¤@­Ó¨S¦³Åã¥Ü¾¹ªº¹q¸£°õ¦æ PostgreSQL
µ{¦¡¡A¦Ó¦b»·ºÝ¹q¸£ªºÅã¥Ü¾¹Åã¥Ü¥X¨Ó¡I¡I¤£¹L¡A¨º¨Ç¹q¸£¥²¶·¥H Ethernet
ºôµ¸¤¶­±¥d³s±µ¡CVNC ¥i¦b \nameurl{http://www.uk.research.att.com/vnc}{}
§ä¨ì¡C¡]Ä¶«ö¡JVNC ¬O¨Ï¥Î TCP/IP¡A²z½×¤W¥u­n¦³ IP
¦a§}«K¥i¦b»·ºÝ¹q¸£³s±µ¡A¤£¤@©w­n Ethernet¡C¤£¹L³t«×¥i¯à«ÜºC¡C¡^

§A¥iÅ|°_¦h¥x¹q¸£¥D¾÷¤Î¥u¥Î¤@­ÓÅã¥Ü¾¹¡A¦Ó¥Î¤@­Ó KWM¡]Áä½L¡B¼v¹³¡BÅã¥Ü¾¹¡^
(Keyborad, Video, Monitor) ¡]Ä¶«ö¡JM ¬O§_·í¬°·Æ¹«¡H¡^¿ï¾Ü¾¹¨Ó¿ï¾Ü©Ò¥Î¹q¸£¡C
³o¤£¦ý¸`¬Ù¦a¤è¡A´î¤Ö²V¶Ã¡A¤]¸`¬ÙÅã¥Ü¾¹¡BÁä½L©M·Æ¹«¡]¨C¥÷Á`­È 100 ¦Ü 500 
¬ü¤¸¡^¡C

ÄyµÛ¿ï¾Ü¾¹¡A§A¥iÅ|°ª¦h¥x PostgreSQL ¦øªA¾¹¡]¶}µo¡B´ú¸Õ¡B¥Í²£¡^¡B¤¬Ápºô¦øªA¾¹¡B
ftp ¦øªA¾¹¡B¤ºÁpºô¦øªA¾¹¡B¹q¶l¦øªA¾¹¡B·s»D¦øªA¾¹¦b¤@­Ó¤jÂd¡C³o¿ï¾Ü¾¹¤]¥i±±¨îµøµ¡
95/NT ©M OS/2 ¹q¸£¡C

½Ð¬d¬Ý¤U¦Cºô§}¡J
\begin{itemize}
\item  DataComm Warehouse Inc¡A¹q¸Ü 1-800-328-2261¡C¥L­Ì´£¨Ñ©Ò¦³«~ºØªº¹q¸£µw¥ó 
\nameurl{http://www.warehouse.com}{} 4 °ð¤â°Ê KVM  ¿ï¾Ü¾¹ (PS/2) ¤j¬ù 
\$89.99¡C Part No. DDS1354
\item  Network Technologies Inc \nameurl{http://www.networktechinc.com/servswt.html}{} (120 ¬ü¤¸/PC 8 °ð) 
ªº²M³æ¤¤¥]¬A 'Server Switches' ©M 'Video only switches' 
\item  Scene Double Inc, ­^°ê \nameurl{http://www.scene.demon.co.uk/qswitch.htm}{} 
\item  Cybex corporation \nameurl{http://www.cybex.com}{} 
\item  Raritan Inc \nameurl{http://www.raritan.com}{} 
\item  RealStar Solutions Inc \nameurl{http://www.real-star.com/kvm.htm}{} 
\item  Belkin Inc \nameurl{http://www.belkin.com}{} 
\item  Better Box Communications Ltd. \nameurl{http://www.betterbox.com/info.html}{} 
\item  ¨ìªþªñªºµw¥ó°Ó¾Q¬d¸ß¡§Server Switch¡¨©ÎºÙ¡§KVM Auto Switches¡¨¡C
\end{itemize}
 

¦b yahoo ·j´M¾¹¤¤§ä¥X§ó¦h¦³¡§Server Switches¡¨©Î¡§KVM Switches¡¨ªº¤½¥q¡C

¨C­Ó PostgreSQL ¸ê®Æ®w¦øªA¾¹³Ì¦n¥Î¤@³¡±M¥Îªº unix 
¹q¸£¡A¥H¼W±jªí²{¡C¥ô¦ó¨ä¥Lµ{¦¡/¦æµ{³£¤£­n¦b³o¹q¸£¤W°õ¦æ¡C
¾\Åª§A©Ò¦í¦a¤èªº³ø³¹ªº°Ó·~ª©§ä¥X¦³­þ¨Ç°Ó¾Q°â½æ Intel ¹q¸£©M 13 
¦T³æ¦â¿Ã¹õ¡]¤Q¤À·G©yªº¿Ã¹õ¡^¡C§A¥u»Ý­nµw¥ó¡A¦Ó{\bfseries ¤£»Ý}·L³nµøµ¡ / 
DOS¡C¸ê®Æ®w¦øªA¾¹¤£»Ý­n±m¦âÅã¥Ü¾¹¡A¦]¬°§A¥i¦b¤@­Ó±m¦âªº­Ó¤H¹q¸£¤W»»±±ºÞ²z¡C

§A¥i¦bºô¤W°Ó©±¶R¨ì³æ¯Âªº¹q¸£µw¥ó¡C§A¥i¦bºô¤W©ç½æ¤¤§ä¨ì¦nªº»ù¿ú¡C
\begin{itemize}
\item ºô¤W°Ó©±»P©ç½æ³õ\nameurl{http://www.egghead.com}{}
\item ºô¤W°Ó©±\nameurl{http://www.buy.com}{}
\item ©ç½æ³õ\nameurl{http://www.ubid.com}{}
\end{itemize}


¦b¥H¤U¦a¤è¨ú±o RedHat¡]©Î¨ä¥Lµo¦æª©¥»¡^Linux ªº¥úºÐ¡J
\begin{itemize}
\item Linux System Labs ºô§}¡J\nameurl{http://www.lsl.com/}{}  7 ¬ü¤¸
\item Cheap Bytes Inc ºô§}¡J\nameurl{http://www.cheapbytes.com/}{} 7 ¬ü¤¸
\end{itemize}
 
½T«O§AÁÊ¶Rªºµw¥ó³Q RedHat Linux ¤ä´©¡CÁÊ¶R«e¦b RedHat ªº ftp 
¯¸§ä¥XÀò±ÀÂËªºµw¥ó¡A¦p SCSI °t±µ¾¹©MÅã¥Ü¥d¡C¥Î¤j¬ù¤»¦Ê¬ü¤¸«K¥i±o¨ì¤@¥x±j«lªº 
Intel ¹q¸£¡A¥Î RedHat Linux ¨Ó°õ¦æ PostgreSQL¡C±qµøµ¡ 95¡BOS/2¡BUnix 
Motif¡BÂsÄý¾¹¡]¦p Redbaron¡BOpera¡BNetscape ¤Î¨ä¥L¤Ü¦h­Ó¡^¸g 
odbc/jdbc/perl/tcl ¨Ó³s±µ PostgreSQL¡C¡]ÂsÄý¾¹¥¿¨³³t¦¨¬°¼Ð·Çªº GUI 
«È¤á (client)¡C¡^

¨Ï¥Î KWM ¿ï¾Ü¾¹¡A§A¥i¥u¥Î¤@­ÓÅã¥Ü¾¹©M¤@­ÓÁä½L¨Ó±±¨î¦h¥x¥D¾÷¡C


\section{PostgreSQL ªº¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹}

¦³¨ÇÀ³¥Îµ{¦¡¦øªA¾¹¥i©M PostgreSQL ¦X§@¡A¶}©ñ­ì©l½XÁÙ¬O°Ó·~ª©¥»³£¦³¡C
µÛ¦Wªº¶}©ñ­ì©l½X¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹¦³¥H Perl ¬°°òÂ¦ªº SmartWorker¡BWIRM¡B
Velocigen¡BEnhydra¡]Java¡^©M Zope¡]Python¡^¡A°Ó·~ªº«h¦³ IBM Websphere¡BBEA 
Weblogic¡C

«ØÄ³§A¨Ï¥Î«O¦wªº¸Uºûºô¦øªA¾¹¦p Apache + mod\_ssl + OpenSSL¡C¦b \nameurl{http://www.c2.net/products/sh3}{} °Ñ¾\ Redhat StrongHold «O¦w¦øªA¾¹ªº¸ê®Æ¡C

¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹¥i¥H©Ò¤ä´©ªºµ{¦¡»y¨¥¤ÀÃþ¡C
§A¥²¶·¨Ï¥Î¤@­Ó¥H{\bfseries §A³Ì³ßÅw}ªº»y¨¥¬°°òÂ¦ªº¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹¡C

¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹ªº¤ÀÃþ¦p¤U¡J
\begin{itemize}
\item  ¥H PERL »y¨¥¬°°òÂ¦
\item  ¥H PHP »y¨¥¬°°òÂ¦¡]©M PERL ¬Û¦ü¡A¤]¦³ÂI¦ü Java¡^
\item  ¥H Python »y¨¥¬°°òÂ¦¡]ª«¥ó¾É¦V©R¥O½Z»y¨¥¡^
\item  ¥H Java »y¨¥¬°°òÂ¦¡]Sun Microsystems Java¡^
\item  ¥H Tcl »y¨¥¬°°òÂ¦¡]Tcl/TK¡XºÙ¬°¡§Tickle¡¨©R¥O½Z»y¨¥
\item  ¥H C++ »y¨¥¬°°òÂ¦¡]C++ ©M CORBA¡^
\end{itemize}



\subsection{PERL ¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹ \label{perlserv}}

©M¡§C¡¨»y¨¥¬Û¦ü¡APerl »y¨¥¤w¦³«Üªø¹Ø©R¡A¦Ó¥B Perl
¦b¥¼¨Ó{\bfseries ¤@¬q«Üªø®É¶¡}ÁÙ·|³Q¼sªxÀ³¥Î¡I¦b¬Y¨Ç¾Þ§@¤W¡APerl ¤ñ Java
{\bfseries §Ö¤T­¿}¡]¦ý Java ¦b¬Y¨Ç¾Þ§@¤W¤]¤ñ Perl §Ö¡^¡C Java 
¬O¤@­Ó«D±`½ÆÂøªº¨t²Î¡A¬J¦³µêÀÀ¾÷¾¹¡A¤S¦³ª½Ä¶¾¹¡A¨Ï±o¥¦«D±`½wºC¡B¤£Ã­©w©M¤£¥i¾a¡C
Perl «hÂ²¼ä¡B§Ö³t¡A§ó¬Oª«¥ó¾É¦V¡C

¦¹¥~¡APerl µ{¦¡¥i»´©ö¦a½sÄ¶¡A¥H¶i¤@¨B§ï¨}ªí²{¡C¨Ï¥Î Perl2Exe ³o­Ó«ü¥O¦C¤u¨ã¨Ó§â
perl ©R¥O½ZÂà¬°¥i°õ¦æÀÉ \nameurl{http://www.indigostar.com/perl2exe.htm}{}¡C

PERL ¥i¨Ï¥Î¥H¤U¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹
\begin{itemize}
\item  Mason \nameurl{http://www.masonhq.com}{} ¬O¤@­Ó¥\¯à±j«l¡A¥H Perl 
¬°°òÂ¦ªººô­¶¶}µo©M¶Ç°e¤ÞÀº¡C¨Ï¥Î Mason¡A§A¥i¦b§Aªº HTML ¤¤´O¤J Perl
½X¡A¤S¥i¦Û¦@¨É¡B¥i­«¥Îªº¤¸¥ó«Ø¥ßºô­¶¡C


\item  BingoX \nameurl{http://opensource.cnation.com/projects/BingoX}{}         
¬O¤@­Ó¶}©ñ­ì©l½X¡Bª«¥ó¾É¦Vªº¸UºûºôÀ³¥Î¬[ºc¡A¥Î mod\_perl
½s¼g¡A¥H¤j´T´î¤Ö«Ø¥ß¤j«¬°ÊºA¡B¸ê®Æ®wÅX°Êªººô¯¸©MÀ³¥Îµ{¦¡©Ò»Ý®É¶¡¡C
 SmartWorkder ¬O Perl Ãþ§Oªº¶°¦X¡A®e³\§Aªº¸UºûºôÀ³¥Îµ{¦¡¦¨¬°¯u¥¿ªºÀ³¥Îµ{¦¡¡A
¦Ó¤£¬O HTML ¼Ë¥»¤¤ÀH·N´O¤Jµ{¦¡½X¡C
SmartWorker \nameurl{http://www.smartworker.org}{}



\item  Apache-Perl ¾ã¦X­p¹º
mod\_perl ¨Ï±o§¹¥þ¥H Perl ¼g¦¨ Apache ¼Ò²Õ¦³¥i¯à¡C¦Ó¥B¡A´O¤J¨ì¦øªA¾¹ªº«ù¤[ª½Ä¶¾¹ 
(persistent interpreter) Á×§K¤F±Ò°Ê¥~³¡ª½Ä¶¾¹ªº³Â·Ð©M Perl ªº±Ò°Ê®É¶¡¡C

°Ñ¾\ \nameurl{http://perl.apache.org}{} ©M \nameurl{http://modperl.sourcegarden.org}{} ªº {\bfseries mod\_perl\_garden} ­p¹º¡C


\item  Apache::ASP \nameurl{http://www.apache-asp.org}{}
§â Active Server Pages ²¾´Ó¨ì Apache ¸Uºûºô¦øªA¾¹¡A¨Ï¥Î Perl
§@¬°¥D¾÷ªº©R¥O½Z»y¨¥¡CApache::ASP ®e³\¶}µo¤H­û³Ð³y¥]¬AÀô¸`ºÞ²z (session
management) ¥\¯à©M´O¤J Perl ½Xªº°ÊºAºô¤WÀ³¥Îµ{¦¡¡C¥t¥~¡A
¥¦ÁÙ¦³«Ü¦h±j«lªº©µ¦ù¥\¯à¡A¥]¬A XML tablibs¡BXSLT Åã²{ (XSLT
rendering)¡BÁÙ¦³¤£¦b­ì¥» ASP API ªº·s¨Æ¥ó¡C


\item  WIRM¡]Web Interface Repository Manager¡^¬O¤@­Ó¥H Perl
¬°°òÂ¦ªºÀ³¥Îµ{¦¡¦øªA¾¹¡A´£¨Ñ¤@­Ó°ª¶¥ªº½sµ{Àô¹Ò¥H¶}µoºô¤W¸ê°T¨t²Î (web
information systems)¡CWIRM ¥]¬A¤@­Óª«¥óÃöÁp¦¡¸ê®Æ®w©M¤@®M¥Î§@µøÄ±¤Æ
(visualizing)¡B¾ã¦X©M¤ÀªR²§½è (heterogeneous) ¦h´CÅé¸ê®Æªº Perl ¤¶­±¡CWIRM
´£¨Ñ¤u¨ã´À¦h´CÅé¸ê®Æ®w²£¥Í¹ï¤º®e±Ó·Pªº´ºÆ[ (context-sensitive views)¡A
¨Ï¶}µo¤H­û¥i¥H§Ö³t¶}µo¦b¤º®e©Mªí¹F¤è¦¡¾AÀ³¤£¦PÃþ«¬¥Î®aª«ºAºô­¶¡C
°Ñ¾\ \nameurl{http://www.wirm.org}{}


\item  EmbPerl \nameurl{http://perl.apache.org/embperl}{} Åý§A¥i¦b HTML
¤å¥ó¤¤´O¤J Perl µ{¦¡½X¡C¨Ï¥Î Perl ªí¥Ü§A¥i¨Ï¥Î¤@ºØºë¤ßªw»sªº»y¨¥¡A¦b WWW
¦­¤w¼sªx§Q¥Î¡C§A¤]¥i¥Î¼Æ¥H¦Ê­p¦­¼g¦nªºªº Perl ¼Ò²Õ¡X¥]¬A
DBI¡X¨Ó¦s¨ú¶V¨Ó¶V¦h¸ê®Æ®w¨t²Î¡C


\item  ePerl \nameurl{http://www.engelschall.com/sw/eperl}{} ª½Ä¶¤@­Ó¥[¤W¤F
Perl 5 µ{¦¡ªº ASCII ÀÉ¡A¥u³B²z Perl 5 µ{¦¡½X¦Ó¤£²z·|¯Â ASCII
¼Æ¾Ú¡C¥¦¥i¥Î¤£¦P¤èªk¹B§@¡J§@¬°¤@­Ó¿W¥ßªº Unix Âo¾¹©Î§â Perl 5
¼Ò²Õ¾ã¦X¨ì¤@¯ëªºÀÉ®×²£¥Í¤u§@¡A¥ç¥i§@¬°¤@ºØ±j«lªº¸Uºûºô¦øªA¾¹©R¥O½Z»y¨¥¡A
¨Ó²£¥Í°ÊºA HTML ­¶¡C


\item  XPP \nameurl{http://opensource.cnation.com/projects/XPP}{} ¥Nªí¡¥XPP
Parses Perl¡¦©Î¡¥XPML Page Parser¡¦¡A¬O¤@­Ó§Ö³t­Ý¦³®Äªº HTML
¤ÀªR¾¹¡A¥i¤ÀªR¦W¬° XPML ­¶ªº°ÊºA HTML ­¶¤¤´O¤J¤Fªº perl©MÃþ¦ü HTML ªº¼ÐÅÒ¡C


\item  Gamla¡X¤@­Ó¥H Perl ¬°°òÂ¦ªº RAD ©MÀ³¥Îµ{¦¡¦øªA¾¹¡Cgamla
­p¹ºªº¥Øªº¬O³Ð³y¤@­ÓÀ³¥Îµ{¦¡§Ö³t¶}µo¡]RAD¡^¤u¨ã©M¤@­Ó¥H Perl
¬°°òÂ¦ªº¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹¡C©Ò¦³ Gamla ­p¹º²£¥Íªº­ìµ{¦¡½X³£·|¦b¤½²³»â°ì
(public domain) ÄÀ©ñ¡C
 
Gamla ¦b \nameurl{http://gamla.iglu.org.il}{}


\item  AxKit \nameurl{http://www.axkit.org}{} ¬O¤@­Ó Apache¡]©M mod\_perl¡^©M 
XML À³¥Îµ{¦¡¦øªA¾¹¡C¥¦¯à§Y®É§â XML Âà´«¬°¥ô¦ó®æ¦¡¡A¦p HTML¡BWAP ©Î¯Â¤å¦r¡C
Âà´«¹Lµ{¥i¨Ï¥Î W3C ¼Ð·Ç§Þ¦Ò¡A©Î¦Û¦æ³]­pªºµ{¦¡½X¡CAxKit ¤]¨Ï¥Î¤º¸mªº Perl
ª½Ä¶¾¹¨Ó´£¨Ñ¦³½ì¦Ó±j«lªº§Þ¦Ò§@ XML Âà´«¤§¥Î¡C

AxKit ±j½Õªº¬O§â¤º®e©Mªí¹F¤èªk¤À¶}¡CAxKit ªººÞ½u (pipelining)
§Þ¥©®e³\¤º®e¤À¤£¦P¶¥¬qÂà´«¬°¥iªí²{ªº®æ¦¡¡A®e³\³¡¤À¥­¥x¥H¤£¦P¤è¦¡¬Ý¨ì¼Æ¾Ú¡C
AxKit ®e³\ºô­¶³]­p­û¶°¤¤ºë¤O©óºô¯¸³]­p¡A¤º®e¶}µoªÌ¯Âºé¬°¤º®e¤u§@¡A
¦Óºô¯¸ºÞ²z­û¤]¯à¦b¨ä±j¶µºÉ¨ä©Ò¯à¡C
\end{itemize}


Perl ªº°Ó·~¸Uºûºô¦øªA¾¹
\begin{itemize}
\item Zelerate AllCommerce  \nameurl{http://www.zelerate.org/html/eng/home.shtml}{}
¬O¤@­Ó°Ó·~¡B¤º®e¡B«È¤á©MÃö«YºÞ²z¨t²Î¡C³o­Ó°ªªí²{¡B¥i©µ®iªº¤¬ÁpºôÀ³¥Îµ{¦¡¥H Perl
¼g¦¨¡A¤Î¥Î¤F¤@­Ó«áºÝ¸ê®Æ®w¡C


\item VelociGen ªA°È XML¡B¸ê®Æ®w©Î§Y®É°e¨ìªº°ÊºA¤º®e¡A³t«×©MÀRºA HTML
¤@¼Ë¡X¹F¨ì CGI ªº¤»¤Q­¿¡A¦Ó§A¤£»Ý­×§ï§AªºÀ³¥Îµ{¦¡¡CVelociGen ¤]ÂÇ¦øªA¾¹ºÝ XML
¼ÐÅÒ¡B·N¥~«OÅ@ (crash protection) ©M¦h³¡¹q¸£¶¡­t¸ü¥­¿Å¡A¨Ï¶}µo§óÂ²³æ¡C
 
VelociGen ¥i§¹¬ü¦a¥[¤J¨ì¥ô¦ó¥­¥x¤Wªº¥ô¦ó¸Uºûºô¦øªA¾¹¡A
¼W±j¦øªA¾¹ªºªí²{©M¥[§Ö¥H°ÊºA¤º®e¥D¾Éªººô¯¸ªº¤ÏÀ³¡CVelociGen
¥i¦P®É³B²z¤j¶q­n¨D¡A¤ñ Java Servlets §Ö¤Q­¿©Î¤ñ Cold Fusion §Ö¥|­¿¡C

Velocigen \nameurl{http://www.binevolve.com/velocigen}{}
\end{itemize}



\subsection{PHP ¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹ \label{midgard}}

PHP ¥i¥Î¥H¤U¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹
\begin{itemize}
\item  Midgard PHP ¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹¥H PHP ©R¥O½Z»y¨¥¬°°òÂ¦¡A¦Ó PHP
°õ¦æ·¥¬°§Ö³t¡X¤ñ Java §Ö¡CMidgrad ªº¥Dºô¯¸¬° \nameurl{http://www.midgard-project.org}{}¡CPHP ¥i¥Î Zend ½sÄ¶º[Àu¤Æ¾¹½sÄ¶ \nameurl{http://www.zend.com}{}¡CPHP °õ¦æ±o«Ü§Ö¡A¦Ó³t«×¤ñ Java §Ö¤­¦Ü¤Q­¿¡C

°Ñ¾\ \ref{midgardinstall} {(Midgard ¦w¸Ë)} ©M PHP HOWTO
\nameurl{http://www.linuxdoc.org/HOWTO/PHP-HOWTO.html}{}
\item Ariadne
\nameurl{http://www.muze.nl/software/ariadne}{} ¬O¤@­Ó¸UºûºôÀ³¥Î¨t²Î¡C
¥¦¥]§t¤@­Ó§¹¾ãªº¬[ºc¡A¥Î PHP »´ÃP¦a¶}µo©MºÞ²z¸UºûºôÀ³¥Îµ{¦¡¡C
³o¨t²Î¨Ï¥Î¤@­Ó¼Ò²Õ¤Æªº¤è¦¡¡A©Ò¦³¥æ©ö³£¨Ï¥Î©â¶Hªº¤¶­±¡C
³o°µªk¬°§ó§ï¨t²Î¤u§@©Î¥[¤W·s¥\¯à±a¨Ó·¥¤jªº¦Û¥Ñ¡A¦Ó¥B¤£»Ý­«·s½s¼g¨ä¥L³¡¤À¡C
\end{itemize}



\subsection{Lutris Corp "Enhydra Enterprise" (Java) \label{Enhydra}}

Enhydra ¤ä´© PostgreSQL ¸ê®Æ®w¡C

Enhydra ¬O¤@­Ó·¥¬°¬y¦æªº Java/XML/J2EE ¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹¡A¥Ñ Lutris 
Corporation ¶}µo¡C¥¦¬O¥þ²y³Ì¦nªº Java/XML ¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹¡C¥¦¤ä´© 
EJB¡BServlets¡BJSP¡BJNDI¡BJDBC¡BJTA¡BCORBA¡BXMLC/Rocks¡BDODS 
©M°ê»Ú¤Æ¡C¥¦¤w¬°«Ü¦h¼Ú¬üªº Fortune 500 ¤½¥q±´¥Î¡CFrench Telecom 
¤@Ãþ¤½¥q¥¿ª½±µÃÙ§U Enhydra¡C¥¦¥H¦Ê¤À¦Ê¯Â¥¿ Java ¼g¦¨¡A¥i©ó \nameurl{http://www.enhydra.org}{} ¨ú±o¡CEnhydra ¬O¤@­Ó¶}©ñ­ì©l½X±M®×¡A
¦ý¥¦¥H°Ó·~§Î¦¡¥Ñ Lutris Corp °â½æ©M¤ä´©¡C½Ð°Ñ¾\ \nameurl{http://www.lutris.com}{}¡C

¦b \nameurl{http://www.enhydra.org/software/documentation/enhydra/NewApp-DODS-Tutorial-PGSQL.html}{PostgreSQL with Enhydra} ¾\Åª¦p¦ó³]©w PostgreSQL ©M Enhydra ªº«ü¾É¡A¤]½Ð°Ñ¾\ \nameurl{http://www.enhydra.org/software/documentation/enhydra/Enhydra-NewApp-DODS-Tutorial.htm}{Setup database with Enhydra} ¥H¤F¸Ñ¦p¦ó¬° Enhydra ³]©w¸ê®Æ®w¡C

§A¥i¥Î Borland ªº JBuilder ©M Enhydra ¦X§@¡CJBuilder ¦b \nameurl{http://www.inprise.com}{} §ä¨ì¡C

¤]½Ð©ó \nameurl{http://www.linuxdoc.org/HOWTO/Enterprise-Java-for-Linux-HOWTO.html}{} °Ñ¾\ Enterprise Java HOWTO¡C


\subsection{Zope¡]Python¡^ \label{Zope}}

Python º¥º¥¦¨¬°·¥¬y¦æªº¡u¯Â¡vª«¥ó¾É¦V©R¥O½Z»y¨¥¡CZope
¬O¤@­Ó¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹¡A´£¨Ñ¤F PostgreSQL ¤¶­±¡CZope ¥i¦b \nameurl{http://www.zope.org}{} ±o¨ì
Python ¥i¦b \nameurl{http://www.python.org}{} §ä¨ì¡C


\subsection{OpenACS¡]Tcl »y¨¥¡^\label{OpenACS}}

OpenACS (Open ArsDigita Community System)
\nameurl{http://openacs.org}{}
¬O¤@­Ó¥Î¨Ó«Ø¥ß¥iÂX®i¡BªÀ¸s¥D¾É (community-oriented)
ºô­¶À³¥Îµ{¦¡ªº¥ý¶i¤u¨ã½c¡C¥¦¨Ì¾a AOLserver¡A¤@­Óºô­¶ / À³¥Îµ{¦¡¦øªA¾¹¡A©M
PostgreSQL¡A¤@­Ó¯u¥¿²Å¦X ACID ªº
RDBMS¡C¥¦­Ì¬O¨â­Ó©M¶}©ñ­ì©l½X±ÂÅv¤Uªº§K¶O¦Ó°ª½èªº²£«~¡C



ACS ¥Ñ ArsDigita ½s¼g¡A\nameurl{http://www.arsdigita.com}{}¡A¥¦­Ìªº ACS
(ArsDigita Community System) ¹Á¸ÕºÉ¶q¿W¥ß©ó¸ê®Æ®w¡AÁöµM¥¦­ì¥»¥H Oracle
¬°°òÂ¦¡]¦]¦¹ Open ACS ­nªá®É¶¡¶i¦æ²¾´Ó¡^¡C

¤]½Ð°Ñ¾\ \nameurl{http://www.appserver-zone.com}{}¡C


\subsection{C++, CORBA ¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹ \label{corba}}

\begin{itemize}
\item  PortalSphere ¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹¥H C++ ¼g¦¨¡A¦b Unix¡]©M
Linux¡^¬°³Ì°ª³t«×©MÃ­©w«×¹B¦æ¡CPortalSphere ÄY®æ¦a¿í±q CORBA ¼Ð·Ç¡A¬J¤ä´©¼Ð·Çªº
HTTP ³q°T¨ó©w©M IIOP ÂI¹ïÂI¨ó©w¡A¥H´£¨Ñ¶W°ª³tªº¥D±q³s±µ¡C
©M©Ò¦³µÛ¦Wªº¸ê®Æ®wª½±µµ²¦X¡A³o¨Ç¯S¦â¨Ï PortalSphere §Ö¦p°{¹q¡A
¦Ó¥B¿W®a¾Ö¦³¦b¤¬Ápºô¤W¤ä´©¹ê®É¨Æ¥óªº¯à¤O¡C PortalSphere ¥i¤ñ HTTP/CGI
§Ö¤@¦Ê­¿¡Cª½±µ³s±µ¨ì¤j³¡¤ÀµÛ¦Wªº¸ê®Æ®w¡A¥i©µ®i¦Ü¤ä´©¶W¹L¤@¸U­Ó¥Î¤á³s±µ¡C
 
¨ì \nameurl{http://www.portalsphere.com/overview.html}{} ¤F¸Ñ PortalSphere¡C


\item  FlashPoint C++¡BC¡BPERL ¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹­p¹ºªº¥Ø«e¬O¦b¤@­Ó¦h¬y
(multi-thread) ªºÀô¹Ò¤ä´©°ª³tºô¤WÀ³¥Îµ{¦¡ªA°È¡B¤ä´©¦h¼Ëªº¶}µo»y¨¥¡A¥]¬A C ©M
C++¡B©M¤ä´©¦b«Ü¦h¨ä¥¦Àô¹Ò¤UÃø¥H°õ¦æªº³n¥ó¤uµ{¤è¦¡¡C¥¦¥i©M Apache
¤@°_¤u¥ó¡Aµø¥G§Aªº»Ý­n¡A¬Æ¦Ü¥i¨ú¥N¥¦¡C°Ñ¾\ \nameurl{http://www.bouldersoftware.com/products/flashpoint}{} ©M¤U¸ü \nameurl{http://www.bouldersoftware.com/products/flashpoint/download.html}{FlashPoint Redhat RPM} ®M¥ó¡C 


\item  "C Server Pages" \nameurl{http://cserverpages.20m.com}{}
¬O¤@­Ó¦³®Ä²v©M¥i©µ®iªºÀ³¥Îµ{¦¡¦øªA¾¹¡A¥H C++¼g¦¨¡A¨Ï¥¦¾Ö¦³³B²z¥H C++ 
¼g¦¨ªº¦øªA¾¹­¶©M´O¤J¤F°ÊºA¤¸¯Àªº¼Ëª©ªº¯à¤O¡C§A¥i¥Î§A³ßÅwªº¤è¦¡¡A©Î¨âºØ³£¥Î¡C
§A¥i¥Î C++ «Ø¥ß¦Û¤vªº°Ó·~ª«¥ó¡C§Aªººô­¶¥i¥H¬O¥«³õ¤W¥ô¦ó ORB ªº CORBA «È¤á¡C
\end{itemize}



\subsection{¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹¥Ø¿ý \label{webappdir}}

°Ñ¾\ \nameurl{http://198.85.71.76/html.html}{¸UºûºôÀ³¥Îµ{¦¡¦øªA¾¹}
¥Ø¿ý¡A¤º¦³¤@¥÷¡§¶À­¶¡¨¡C
 


\section{PostgreSQL ªºÀ³¥Îµ{¦¡©M¤u¨ã}


\subsection{PostgreSQL ªº 4GL ¸Uºûºô¸ê®Æ®wµ{¦¡¡XAppGEN ¶}µo¨t²Î}

 
AppGEN ¥i¦b¦¹¤U¸ü
\begin{itemize}
\item  \nameurl{http://www.man.ac.uk/~whaley/ag/appgen.html}{} 
\item  \nameurl{ftp://ftp.mcc.ac.uk/pub/linux/ALPHA/AppGEN}{}. 
\end{itemize}
 
AppGEN ¬O¤@ºØ°ª¶¥²Ä¥|¥Nµ{¦¡»y¨¥©MÀ³¥Îµ{¦¡²£¥Í¾¹ (application 
generator)¡A¥Î¥H²£¥Í¥H¸Uºûºô¬°°òÂ¦ªºµ{¦¡¡C³o¨Çµ{¦¡¤@¯ë¦b¤¬Ápºô©Î¤½¥q¤ºÁpºô¨Ï¥Î¡C
AppGen µ{¦¡¥H¦X¥G Common Gateway Interface (CGI) ¼Ð·Çªº C ©R¥O½Z (C scripts) 
¼g¦¨¡A¤j³¡¤À¤¬Ápºô¦øªA¾¹³£¥i¤ä´©¡C

­n¨Ï¥Î AppGen¡A§A»Ý­n¡J

PostgreSQL¡AÃöÁp¦¡¸ê®Æ®w¨t²Î

¤ä´© CGI ªº¤¬Ápºô¦øªA¾¹¡A¦p NCSA ªº HTTPD

¤@­Ó ANSI C ½sÄ¶¾¹¡A¦p GCC

AppGEN ¥]¬A¥H¤U Unix ¡]Linux¡^ ¥i°õ¦æµ{¦¡¡J

\begin{itemize}
\item       defgen¡A¥¦·|®Ú¾ÚÅÞ¿è¸ê®Æµ²ºc²£¥Í¤@­Ó°òÂ¦ªº¼ËªOµ{¦¡¡C
³o¨Çµ{¦¡¥i¥[¤J¡B§ó·s¡B§R°£©M´M§ä¸ê®Æ®w¤¤ªº¬ö¿ý¡A¤S¥i¦Û°Ê«O«ù°Ñ¦Ò¾ã¦X©Ê 
(referential integrity)¡C
      
\item       appgen¡AAppGEN ªº½sÄ¶µ{¦¡¡C¥¦·|§â AppGEN ªº·½µ{¦¡½X½sÄ¶¬°¥i¥Ñ 
CGI °õ¦æªº C ­ì©l½X¤Î¥i§Y®É¦bºô¤W¨Ï¥Î HTML ®æ¦¡¤å¥ó¡C
  
\item       dbf2sql¡A§â dBase III ¬Û®eªº .dbf ÀÉÂà´«¬°¥i°õ¦æªº SQL 
©R¥O½Zªº¤u¨ãµ{¦¡¡C³o¨Ï±o¤j³¡¤ÀÀx¦s¦b DOS/µøµ¡¸ê®Æ®w®M¥óªº¸ê®Æ¥i²¾´Ó¨ì¤@­Ó SQL 
¦øªA¾¹¡A¦p PostgreSQL¡C
\item ¦¹¥~¡AAppGEN ¦¬¶°¤F¤@¨Ç·|¦b°õ¦æ´Á¶¡¨Ï¥Îªº HTML ¤å¥ó¡BGIF ÀÉ©M Java 
¤pµ{¦¡¡C·íµM¡A¦p©Ò¦³¦nªº³n¥ó¯ë¡A¥¦¤]¥]¬A§¹¾ãªº·½µ{¦¡½X¡C
\end{itemize}
 

§@ªÌ Andrew Whaley ¥i¥H¥H¤U³~®|±µÄ²¡J 
\begin{itemize}
\item        \onlynameurl{andrew@arthur.smuht.nwest.nhs.uk} 
\end{itemize}
 
 


\subsection{PostgreSQL ªº¤¬Ápºô¤¶­±¡XDBENGINE}

dbengine ¬O Ingo Ciechowski ©Ò¼gªº¤@­ÓÀH´¡§Y¥Îªº PostgreSQL ¤¬Ápºô¤¶­±¡C¥¦¦b
\begin{itemize}
\item   \nameurl{http://www.cis-computer.com/software/dbengine/ }{} 
\end{itemize}
 
{\bfseries ¦³Ãö DBENGINE¡J}
dbengine ¬O¤¬Ápºô»P Postgres95 ¤§¶¡ªº¤¶­±¡A¥u»Ýªá¼Æ¤ÀÄÁ¡A
¥¦«K¥i¦s¨ú¥ô¦ó²{¦sªº¸ê®Æ®w¡C

PHP Åý§A¦b¤å¥ó¤¤½s¼gÃþ¦ü Perl ªº»y¨¥¡A¦ý¤£¬O¯uªº Perl¡AAppGEN ©M WDB-P95 
»Ý­n§A¬°¨C¤@­Ó¸ê®Æ®w«Ø¥ß³]©wÀÉ (configuration files)¡X¡XÅ¥°_¨Ó¡A
§A¦ü¥G³£­n¥ý¾Ç¤@Ãþ·sªº°²»y¨¥ (meta language) ¤~¯à±Ò¥Î¡C

©M¨ä¥L¤u¨ã¤£¦P¡A§A¤£»Ý­n¾Ç¥ô¦ó¯S§Oªºµ{¦¡©Î©R¥O½Z»y¨¥¨Ó¨Ï¥Î 
dbengine¡C¤]¤£·|¦³¨C­Ó¸ê®Æ®w³£¦³³]©wÀÉªº±¡ªp¡A©Ò¥H§A¤£»Ý­n¼ô²ß³o¨Ç·sµ²ºc¡C
¤£¹L¡A¦pªG§A·Q¥Î¨ì dbengine ªº§¹¾ã¥\¯à¡A¾Ç²ß Perl ·|¬O¤@­Ó¦n¥D·N¡C

¾ã­Ó¨t²Î¥iÄy³B²z¤@­Óªþ¥[ªº¸ê®Æ®w³]©w¦n¡A
¥¦·|¥]§t¦³Ãö¦p¦ó²z¸Ñ§Aªº¸ê®Æ®w¦s¨úªº¸ê®Æ¡C§A¬Æ¦Ü¥i¥H«ü©wµê°²Äæ (virtual 
fields)¡A¥Î¥H¦b¸ê®ÆÅã¥Ü¦b¿Ã¹õ¤§«e§@¥X§Y®É­pºâ¡C
 


\subsection{PostgreSQL ªº Apache ¦øªA¾¹¼Ò²Õ¡XNeoSoft NeoWebScript}

 
Apache ¬O¤@­Ó¦³¦Wªº¤¬Ápºô¦øªA¾¹¡C¤@­Ó PostgreSQL ¨ì Apache ªº¤¶­±¼Ò²Õ¦ì©ó¡X
\begin{itemize}
\item   \nameurl{http://www.neosoft.com/neowebscript/}{} 
\end{itemize}
 
NeoWebScript ¬O¤@µ{®e³\§A§â¤£¦P½ÆÂøµ{«×ªºµ{¦¡´O¤J¨ì HTML ÀÉµ{¦¡»y¨¥¡C

·í¦³¤H­n¨D¤@­Ó¥]§t NeoWebScript ªº HTML ºô­¶®É¡A¤ä±Â NeoWebScript 
ªº¦øªA¾¹«K°õ¦æ´O¤J¤Fªº©R¥O½Z (script)¡A²£¥Í¤@­Ó§t¦³¦Û­q¤º®eªººô­¶¡C

NeoWebScript ¬Oª½±µ¦bºô­¶ªº HTML ½X½s¼g¥\¯à±j¤j¡B
¦øªA¾¹¬°°òÂ¦ªº¤¬°Êµ{¦¡ªº¤@­Ó¤èªk¡A°ª³t¡B¦w¥þ¡B©ö¾Ç¡CÄyµÛ 
NeoWebScript¡A§Y¨Ï¹ï·s¤â¨Ó»¡¡A­p¼Æ¾¹ (counter)¡B¹q¶lªí®æ (email 
forms)¡BÀð¯È¡BÃ±¦WÃ¯ (guest books)¡B³X«È¬ö¿ý³£ÅÜ±oÂ²³æ¡C½Ð¬Ý¬Ý NeoWebScript 
¹ï¦Û¤v¡BPERL ©M JavaScript §@¥Xªº¤ñ¸û¡C

¦pªG§A·Q¦b§Aªº¤¬Ápºô¦øªA¾¹¦w¸Ë NeoWebScript¡A
§Aªººôµ¸ºÞ²z­û¦b¶}©l«e»Ý¥ý¾\Åª¥L­Ìªº Sysop FAQ¡C¡mTheory of Operations¡n·|¸ÑÄÀ 
NeoWebScript ¦p¦ó¹B§@¡A¡mInstallation¡n·|³v¨B»¡©ú¡C¡mManagement¡n
Ãö©ó³]©w©M°õ¦æ¦øªA¾¹ªº¨Æ©y¡A¡mTest¡nÅý§A½T©w NeoWebScript 
¹B§@¥¿±`¡A¡mTroubleshooting¡n©M¦øªA¾¹ªº°ÝÃD¦³Ãö¡C

¦b¦Û¤vªº ISP¡B¤ºÁpºô©Î¥~Ápºô¨Ï¥Î NeoWebScript ¶O¥Î¥þ§K¡A
§A·|¦bµn°O¤U¸ü®É±o¨ì§¹¥þªº°õ·Ó¡C¤£¹L¡A
¦pªG§A·Q§â¥¦´O¤J¨ì¦Û¤vªº²£«~©Î¦b°Ó·~ªº¦øªA¾¹¡]¦p SSL¡^¨Ï¥Î¡A¥¦Á`­È 99 ¬ü¤¸¡C

NeoWebScript ¬O¤@­Ó®e³\§A¦bºô­¶¤¤´O¤J Tcl/Tk »y¨¥§@¬°©R¥O½Z¤u¨ãªº Apache 
¼Ò²Õ¡C¥¦¥Ñ Karl Lehenbauer¡ANeoSoft ªº Chief Technical Officer µo©ú¡A¨Ã¥Ñ 
Neosoft ªºµ{¦¡³]­p®v©M§Þ³N¼¶½Z­û½s¼g¤å¥ó¡B§ï¨}¤Î¥[±j¥\¯à¡C

Apache ¬O¥@¤W³Ì¬y¦æªº¤¬Ápºô¦øªA¾¹¡A¸g½Õ¬dªººô¯¸¤¤¦³¤»¤Q¤K¤Ú¥P¨Ï¥Î¡C

Tcl/Tk ¬O¥Ñ Dr. John Ousterhout ¶}µoªº¤@ºØ±j«l¡B¦Û¥Ñ¡B¸ó¥­¥xªº©R¥O½Z»y¨¥¡C
¥L»¡¹L¡§Tck/Tk¡¨®e³\³n¥ó¶}µo¤H­û¤ñ¨Ï¥Î¥H C ©Î C++ ¬°°òÂ¦ªº¤u¨ã§Ö¤Q­¿§¹¦¨¤u§@¡C
¥¦¤]¬O¤@ºØ°¶¤jªº½¦¤ô»y¨¥ (glue language)¡A¨Ï±o²{¦sªºµ{¦¡¦@¦P¤u§@¡B
§ó¹Ï¹³¤Æ©M¥i¥Î©ó¤¬Ápºô¡C¡¨



NeoSoft ³Ð¿ì¤H¤Î Chief Technical Officer¡AKarl Lehenbauer ¦b¶}©l®É«K¤w°Ñ»P 
Tcl/Tk ¶}µo¡C¥L¤]©M Mark Diehkans ¤@°_³Ð§@¤F Extended Tcl¡A¤S¦W¬° TclX ©Î 
NeoSoft Tcl¡A©µ¦ù³oºØ»y¨¥ªº¥\¯à¡C«Ü¦h Tcl ªº®Ö¤ß«ü¥O³£¨Ó¦Û Extended Tcl¡A¦Ó¥Ñ 
Dr. Ousterhout ¥[¤J¨ì®Ö¤ß»y¨¥¤¤¡C

NeoSoft Inc., 1770 St. James Place, Suite 500, Houston, TX 77056 USA 
 


\subsection{HTML ªº¦øªA¾¹ºÝ©µ¦ù HEITML ©M¤@­Ó PostgreSQL ªº 4GL »y¨¥}

 
heitml ¬O¥t¤@­Ó postgres »P¸Uºûºô¶¡ªº¤¶­±¡C±ýª¾¸Ô±¡¡A½Ð±µÄ²
\begin{tscreen}
\begin{verbatim}
 
          Helmut Emmelmann H.E.I. Informationssyteme GmbH 
          Wimpfenerstrasse 23 Tel. 49-621-795141 
          68259 Mannheim Germany Fax. 49-621-795161 
\end{verbatim}
\end{tscreen}
 
\begin{itemize}
\item    Mr.Helmut Emmelmann ªº¹q¶l¦a§} \onlynameurl{emmel@h-e-i.de} 
\item  Heitml ¥Dºô­¶ \nameurl{http://www.heitml.com}{} 
\item  Heitml ¦¸ºô­¶ \nameurl{http://www.h-e-i.deom}{} 
\end{itemize}
 

Heitml ¦P®É¬O HTML ªº¦øªA¾¹ºÝ©µ¦ù©M¤@ºØ 4GL »y¨¥¡Cºô­¶½s¼g¤H­û¥i¥H HTML 
ªº­·®æ¥ÎÃþ¦ü HTML ¼ÐÅÒ½s¼gµ{¦¡¡C

Heitml¡]­µ "Hi"-TML¡^¬O HTML ªº©µ¦ù¤Î¤@­Ó¥þ­±ªº²Ä¥|¥N»y¨¥¡A
¥¦®e³\¥H¤¬Ápºô¬°°òÂ¦ªºµ{¦¡ª½±µ§Q¥Î SQL ¸ê®Æ®w¤¤ªº¸ê®Æ¡A¦Ó¤£»Ý¨Ï¥Î½ÆÂøªº CGI 
©R¥O½Z¡C

Heitml ¦b¦øªA¾¹ºÝ©µ¦ù HTML¡A°ÊºA¦a§â¡§.hei¡¨ÀÉÂà´«¬° HTML ®æ¦¡¡A
¨Ï¥¦»P¥ô¦óÂsÄý¾¹­Ý®e¡C¥¦¥]¬A¤j®a¼ô±x¡B©ö¥Îªº HTML »yªk¡A
¤Î´£¨Ñ¤j¶q¹w¥ý¶}µo¤Fªº¼ÐÅÒ©Mµ{¦¡®w¨ÓÀ³ªþ¥H©¹¥Ñ CGI ¶i¦æªº¤u§@¡C¹³ XML 
¯ë¡Aheitml ®e³\¨Ï¥ÎªÌ¦Û©w¼ÐÅÒ¡CÄyµÛ heitml¡A¨Ï¥ÎªÌ¦Û©wªº¼ÐÅÒ¥iÂ½Ä¶¬° HTML 
¤Î¶Ç°eµ¹ÂsÄý¾¹¡C

Heitml ¦P®É¥H HTML ³]­pªÌ©M±M·~ªºµ{¦¡³]­p®v¬°¥Ø¼Ð¡CHTML ³]­p®v¥i¨Ï¥Î heitml 
¼ÐÅÒ¨Ó«Ø¥ß°ÊºAªººô­¶¡A¦s¨ú SQL ¸ê®Æ®w¡A©Î«Ø¥ß§¹¾ãªº¸UºûºôÀ³¥Îµ{¦¡¡C­p¼Æ¾¹¡B
µn°O¸ê®Æ®w (registration databases)¡B·j´M¾¹ªí®æ¡B¹q¶lªí®æ¡B¶¥¼h¦¡¿ï³æ 
(hierachical menus) ³£¥i»´ÃP¦aÄyµÛ¦b¤j¶q¤¸¥ó¨ç¦¡®w (Component Libraries) 
¹w«ØªºÃþ¦ü HTML ªº¼ÐÅÒ²£¥Í¡C

¹ïµ{¦¡³]­p®v¨Ó»¡¡Aheitml ¦b HTML ¤¤´O¤J¤F§¹¾ãªº²Ä¥|¥Nµ{¦¡»y¨¥¡A

\begin{tscreen}
\begin{verbatim}
 
(¦p <if>, <while>, ©M <let> ¼ÐÅÒ)¡A 
\end{verbatim}
\end{tscreen}
 
©M¹ï§t¾ã¼Æ¡B¹ê¼Æ¡B¥¬ªL­È¡B¦r¦ê©M¤¸²Õ (tuple) ªºªí¹F¦¡±j«l¹Bºâ¯à¤O¡C
¤¸²Õªº°Ñ¦Ò»yªk (reference semantics) ´N¹³ª«¥ó¾É¦V»y¨¥¡A¤ÎÀx¦s¦b°ïÅ|¤¤¡CHeitml 
ÅÜ¼Æ¡A¥]¬A©Ò¦³¦b°ïÅ|¤¤ªº½ÆÂø¸ê®Æµ²ºc¡A¦b Session Mode ¤¤¥i¦b¤£¦Pºô­¶¶¡ºû«ù¡C
§A¤]¥i¥H¦Û­q¼ÐÅÒ©ÎÀô¹Ò¼ÐÅÒ (environment tags)¡A¬Æ¦Ü­«·s©w¸q HTML ¼ÐÅÒ¡C

heitml ¨Ï±o¥H¤U¨Æ±¡¦³¥i¯à

¡X¡X¥H¨ãµ²ºc¤Î¼Ò²Õ¤Æ (structured and modular) ¤è¦¡¶}µoºô­¶¡A¤j´T´î§CºûÅ@§xÂZ¡C

¡X¡X¶}µo¦³´¼¼z¤Î¤¬°Êªººô­¶¡A¤º®e¥i°ÊºA¦a¾AÀ³¥ÎªÌ©Ò»Ý¡C

¡X¡XµL»Ý³]­pµ{¦¡«K¥iÅã¥Ü SQL ¸ê®Æ®wªº¤º®e¡A§A¥u»Ý­n¨Ï¥Î¹w¥ý
©w¸qªº¡§dba¡¨¨t¦C¼ÐÅÒ¡C

¡X¡X¨Ï¥Î Session Variables ¶}µo½ÆÂøªº¸ê®Æ®w¤Î¥Ø¿ýÁÊª«µ{¦¡¡C

Heitml ¥i¸g CGI ¤¶­±¦b Linux ªº¥ô¦ó¤¬Ápºô¦øªA¾¹¤¤°õ¦æ¡A¦Ó¦b Apache ¤¤¥i¨Ï¥Î 
apache API ¨Ï±o°õ¦æ³t«×¯S§O§Ö¡]Á×§K¤F CGI ªº¤u§@¡^¡C¥Ø«e¡A¥¦¤ä´© 
mSQL¡]²Ä¤@¤Î¤Gª©¡^¡BPostgreSQL¡]²Ä¤»ª©¡^¡BmySQL¡B¤Î the yard 
databases¡Cheitml ¥i¦b Linux¡BBSDi¡BSolaris ©M SunOS °õ¦æ¡A¥H¤Î¦bµøµ¡ NT ¥[¤W 
CGI ©M ISAPI¡BODBC¡Bµøµ¡ 95 ¤¤¨Ï¥Î¡C

heitml¡]Linux ª©¡^¹ï¬ã¨s¡B«D°Ó·~©Ê©M­Ó¤H¥Î³~¬O§K¶Oªº¡C°Ó·~ºô¯¸»Ýªþ¥X±ÂÅv¶O¡C
³]¦³¸Õ¥Î´Á­­¦Ó¥\¯à§¹¾ãªº¸Õ¥Îª©¥i§K¶O¤U¸ü¡C¡]¤£¹L­nª`·N¡A¨C­Ó§A¶}µoªº¡§.hei¡¨
ºô­¶³£·|¦L¥X¤@­Ó°T®§«ü¥X¥¦¬O«D°Ó¥Îª©¥»¡Cµn°O¤§«á§A·|¦¬¨ì¤@­ÓÁä½X¡A
¨Ï§A¥iÃö±¼³o°T®§¦ÓµL»Ý­«·s¦w¸Ë¡C¡^

heitml¡]­µ¡§Hi¡¨-TML¡^ÄyµÛ¥i¦Û¦æ©w¸qªº¼ÐÅÒ©M§¹¾ãªºµ{¦¡³]­p¯à¤O¤j´T©µ¦ù¤Î¼W±j 
HTML ªº¥\¯à¡C³o¨Ï°ÊºAªº¤º®e©M¸ê®Æ®wµ{¦¡¥i¦b HTML ¥@¬É¤¤¥X²{¡A¦Ó¤£»Ý­n CGI 
©Î¥~³¡¤â½Z©Îµ{¦¡»y¨¥¡C¤]´N¬O»¡¡A¤@­Ó HTML §@ªÌ¥i¦bºô­¶¤¤´O¤JÀ³¥Îµ{¦¡¡C
³o¥u»Ý­n¨Ï¥Î·sªº¼ÐÅÒ¡A¦Ó¤£»Ý CGI ©Îµ{¦¡³]­p¡C¥t¤@¤è­±¡A
¶i¶¥¨Ï¥ÎªÌ©Îµ{¦¡³]­p®v¥i³Ð³y¤Î³]­p±j«lªº¼ÐÅÒ®w¡C³o°µªk¨Ï±o heitml ¹ï HTML 
·s¤â©M±M·~µ{¦¡³]­p®v¦@®É¾A¥Î¡Cheitml ¦b¸Uºûºô¦øªA¾¹¤W°õ¦æ¤Î°ÊºA¦a²£¥Í 
HTML¡A©Ò¥H heitml ©M¤¬Ápºô¼Ð·Ç­Ý®e¡A¤]©M¥ô¦óÂsÄý¾¹­Ý®e¡C
¥¦¤@¤è­±¬°¥ÎªÌ´£¨Ñ§¹¾ãªº¸ê®Æ®w¦s¨ú¥\¯à¡A¥t¤@¤è­±¨Ï¥ÎªÌµL»Ý²z·|¥ô¦ó¤£¥²­nªº 
CGI ½ÆÂø©Ê¡Cheitml ¬O®Ú¾Ú¦³Ãö½sÄ¶¾¹ºc³y©M¥æ©ö (transaction) 
¨t²Îªº³Ì·s¬ã¨s¦¨ªG¦Ó¶}µoªº¡C

heitml ­¶ªº¶}µo¹Lµ{©M HTML ­¶¤@¼Ë¡A³£¬O¨Ï¥Î¤å¦r½s¿è¾¹©Î HTML 
½s¿è¾¹¡A¤]¦p±`¦a©ñ¦b¸Uºûºô¦øªA¾¹¤W¡C¤£¹L¡A·sªººô­¶¥i¥]¬A°ÊºAªº heitml 
¼ÐÅÒ©M¨Ï¥Î¼ÐÅÒ®w¡C§A¥i¨Ï¥Î³o¨Ç¼ÐÅÒ¦s¨ú¸ê®Æ®w¡B²£¥Í°ÊºA¤º®e¡B±H¥X¹q¶l¡A
¬Æ¦Ü¥i¥H¶}µo±j«lªºÀ³¥Îµ{¦¡¡A¦pµn°O¸ê®Æ®w (registration database) ©MÁÊª«¨t²Î¡C

HTML ·s¤â©M±M·~µ{¦¡³]­p®v¤@¼Ë·|¬°¯à°÷°ª³t¦ÓÂ²©ö¦a³]­pºëªöªºÀ³¥Îµ{¦¡¡A
¦p§Ú­Ìªº¤¬°ÊÃ±¦WÃ¯¡A¦Ó¤£»Ý¨Ï¥Î½ÆÂø¦ÓÃø¾Çªº CGI ©R¥O½Z¦ÓÅå³Y¡C³o¤u§@¥u»Ý¨Ï¥Î 
dba ¼ÐÅÒ®w¤¤ªº¤u¨ã«K¥i°µ¨ì¡C

heitml ¥]¬A¤£¦PºØÃþªº¼ÐÅÒ®w¡A¥Î¥H²£¥ÍÃ±¦WÃ¯¡B¸ê®Æ®wºûÅ@µ{¦¡¡B
¥i©µ¦ùªº¬d¸ßªí®æ¡B±j«lªº¹q¶lªí®æ©Îºô­¶ªº¶¥¼h¦¡¿ï³æ 
(hierarchic menu)¡C³o¨Ç¤u¨ã¤w¥i¨Ï¥Î¡A§A¥u»Ý¦bºô­¶¤W¥[¤W¹ïÀ³ªº¼ÐÅÒ¡C

§@¬°¤@­Ó¦³¸gÅçªºµ{¦¡³]­p®v¡A§A¥i¥þ­±¨Ï¥Î heitml ªº«ù¤[°ÊºA¤¸²Õ¬[ºc 
(persistent dynamic tuple architecture)¡Jheitml ¤£³æ¬O¦³°ÊºA«¬ºA 
(dynamic typing)¡B¥þ¥\¯àªºªí¹F¦¡­pºâ¡B»¼°j¨ç¼Æ©MÂ×´Iªº°Ñ¼Æ¶Ç»¼¯S¦âªº©R½Z»y¨¥¡A
¤]Äy°ÊºA¤¸²Õ¬[ºc¦Û°Ê«O«ù¥ô¦ó¤j¤pªº session ¸ê®Æ¡C

 


\subsection{PostgreSQL ªº America On-line AOL ¸Uºûºô¦øªA¾¹}

 
AOLserver 2.3 ª©¬O¤@­Ó§K¶Oªº°Ó·~¸Uºûºô¦øªA¾¹¡A¥¦¥i³s±µ¨ì 
PostgreSQL¡C±ýª¾¸Ô±¡¡A½Ð¬Ý
\begin{itemize}
\item  AOL ¸Uºûºô¦øªA¾¹¥Dºô­¶ \nameurl{http://www.aolserver.com}{} 
\item  Philip Greenspun ªº AOLserver ¤¶²Ð \nameurl{http://photo.net/wtr/aolserver/introduction-1.html}{}
\end{itemize}
 
AOLserver ¬O¤@­Ó§Ö³t¡A¥þ¦h¬y³B²z (multithreaded)¡A¤ä´© Tcl
ªº¸Uºûºô¦øªA¾¹¡C¦ý¤£¤î©ó¦¹¡A¥¦ÁÙ¬O¤@­Ó¥þ­±¤ä´©¸ê®Æ®wªº¸Uºûºô¶}µo¥­¥x¡C

¨Ï¥Î AOLserver¡A§A¥i¦³¤½¥Î (pooled) ªº PostgreSQL¡]©M¨ä¥L 
RDBMS¡^³s±µ¡A¥Ñ¤£¦P°õ¦æºü (threads) ¤À¨É¡CAOLserver ¦³ Tcl ©M C
API¡AÅý§A¥i¶}µo±j«lªº°ÊºAºô­¶¡C©Ò¦³³o¨ÇªF¦è³£¦b 1995 ¦~¶}©l¡C¥¦¥H APL
(AOLserver Public License) ©Î GPL ±ÂÅv¡A¦]¦¹¬O¥þ¦Û¥Ñªº³n¥ó¡C

¹ïºô­¶¨Ó»¡¡ATcl API ³Ì¦³¥Î¡CAOLserver ¦³¤@²Õ±j«lªº Tcl ©I¥s¡A¨Ò¦p
ns\_sendmail¡]¥Î¨Óµo¥X¹q¶l¡^¡Bns\_httpget¡]¥Î¨Ó¨ú¦^¤@­Ó URL¡^¡Bns\_schedule¡]Ãþ¥H 
cron ªº¥\¯à¡A¥Î¥H±Æ©wµ{¦¡¦b¯S©w®É¶¡°õ¦æ¡^µ¥µ¥¡C§A¤]¥i¥Î Tcl API ¨Ó»´©öÂX®i
AOLserver ªº¥\¯à¡C¨C¤@­Ó AOLserver ªºµêÀÀ¦øªA¾¹³£¥i¾Ö¦³¨p®aªº Tcl 
©R¥O½Z¡§¨ç¦¡®w¡¨¡A¥Ñ AOLserver ¸ÑÄÀ¡A¨Ã¥iÅý¸ÓµêÀÀ¦øªA¾¹¤¤¥ô¦óºô­¶¨Ï¥Î±o¨ì¡C

§A¥i¥Î¤TºØ¤èªk¬° AOLserver ¶}µoºô­¶¡J
\begin{itemize}
\item ¯Â HMTL
\item .tcl ­¶¡X¡X§Y¥i¥Î ns\_write ©I¥s¨Ó¶Ç¦^ HTML ªº tcl µ{¦¡¡C
\item .adp ­¶¡X¡XAOL Dynamic Pages¡C§A¥H¯Â HTML ¶}µoºô­¶¡A¦ý§A¥i¥Î {$<$}\% \%{$>$} ©Î
{$<$}\%= \%{$>$} ¨Ó´O¤J Tcl ½X¡A©M PHP ©Î ASP ¬Û¦ü¡C
\end{itemize}


ÁöµM AOLserver ¬O¤@­Ó°¶¤jªºªº¤¬Ápºô¦øªA¾¹¡A¾Ö¦³Àu¨}ªº¬[ºc¡A
¥¦ªº¥ú¨~¦b©ó¥¦³s±µ¸ê®Æ®wªº¯à¤O¡CAOLserver ¾Ö¦³¦Û¤vªº¸ê®Æ®w©â¶H¼h (abstraction 
layer)¡AÅý§A§¹¥þ¤£»Ý­×§ïµ{¦¡¦Ó³s±µ¨ì¤£¦P RDBMS¡C³o¨Ç RDBMS ªº³s±µ¬O¤½¥Î 
(pooled)¡B«ùÄò (persistent) ªº¡A¥Ñ¤£¥Îªº°õ¦æºü¤À¨É¡C
³o®e³\«Ü§Öªº³sµ²©M¦³®Ä¹B¥Î¸ê·½¡C

AOLserver ¾Ö¦³©Ò¦³¥D­nªº RDBMS ªºÅX°Êµ{¦¡¡JPostgreSQL¡BOracle¡BSybase¡B
Informix¡BIllustra¡BSolid¡BInterbase ©M MySQL¡C
 


\subsection{PostgreSQL ªººÃÃø / ­p¹º°lÂÜ¨t²Îµ{¦¡¤u¨ã}

 
¥¦¦b 
\begin{itemize}
\item   \nameurl{http://www.homeport.org/~shevett/pts/}{} 
\end{itemize}
 
 


\subsection{§â dbase ªº dbf ÀÉÂà´«¦Ü PostgreSQL}

 
dbf2msql µ{¦¡©M mSQL ¤Î PostgreSQL ¦X§@´r§Ö¡C§A¥i¦b¥H¤U¤è§ä¨ì
\begin{itemize}
\item  \nameurl{ftp://ftp.nerosworld.com/pub/SQL/dbf2sql/}{} 
\item  \nameurl{ftp://ftp.postgresql.org/pub/incoming/dbf2pg-3.0.tar.gz}{} 
\end{itemize}
 

³oµ{¦¡¥Ñ Faculty of Electrical Engineering TU Delft, NL 
Computer Architecture and Digital Technique section 
ªº Maarten Boekhold ¼g¦¨¡C 
\begin{itemize}
\item  \onlynameurl{M.Boekhold@et.tudelft.nl} 
\end{itemize}
 

§A¤]¥i¨Ï¥Î python ªº¤èªk (method) ¦bÅª¤J dbf ÀÉ¤Î¸ü¤J¨ì postgres ¸ê®Æ®w¡C
\begin{itemize}
\item  See \nameurl{http://www.python.org}{} 
\end{itemize}
 


\subsection{§â·L³n MDB ¸ê®Æ®wÂà´«¦Ü PostgreSQL}

­p¹º¤¤ªº MDB Tools ¬O¤@²Õ¨ç¦¡®w©M¤½¨ãµ{¦¡¡A¥Î©ó§â·L³n Access ¸ê®Æ®w¡]mdb 
ÀÉ¡^¶×¥X¦Ü¦h¥Î¤áªº¸ê®Æ®w¡A¦p Oracle¡BSybase¡BDB2¡BInformix¡BMySQL¡BPostgreSQL 
¤§Ãþ¡C
\begin{itemize}
\item  ±q \nameurl{http://mdbtools.sourceforge.net}{} ¨ú±o MDB Tools
\item  ³q«H½×¾Â \nameurl{http://lists.sourceforge.net/mailman/listinfo/mdbtools-dev}{}
\end{itemize}



\subsection{Zeos «È¤á}

¡§Zeos¡¨¬O¤@­Ó¥Î¨Ó¶}µo©MºÞ²z¸ê®Æ®wÀ³¥Îµ{¦¡ªº³n¥ó²£«~¡A¥Î©ó¶}©ñ­ì©l½X SQL
¦øªA¾¹¡XMySQL¡BPostgreSQL ©M InterBase
\nameurl{http://www.zeos.dn.ua/eng/index.html}{}


\subsection{Java ªº Report Writer}

Generic Report Writer ¬O¤@­Ó¥Ø¿ýÅX°Êªº³ø§i½s¼g¾¹¡C¥¦¤£¬O©ì¡X©ñ (drag-and-drop)
¤¶­±¡C¥i¥Î©ó PostgreSQL¡BMySQL ©M Access¡C¥¦¤]«Ü¥i¯à¥i¥Î©ó¨ä¥L§A¦³ Type 4 JDBC
version 1 ÅX°Êµ{¦¡ªº¸ê®Æ®w¡C¥¦¦b 
\nameurl{http://www.geocities.com/SiliconValley/Ridge/4280/GenericReportWriter/grwhome.html}{}¡C


\section{¸ê®Æ®w³]­p¤u¨ã¡X¹êÅéÃö«Y¹Ï (Entity Relation Tool) ¤u¨ã}

"DeZign for databases" (\nameurl{http://www.heraut.demon.nl/dezign/index.html}{}) 
¬O¤@­Ó¨Ï¥Î¹êÅéÃö«Y¹Ïªºªº¸ê®Æ®w¶}µo¤u¨ã¡C¥¦¥Hµø¹³§Î¦¡¤ä´©¹êÅé©MÃö«Yªº±Æ¦C¡A
¨Ã¦Û°Ê¬°¤j³¡¤À¬y¦æ²£¥Í¸ê®Æ®w¤è®× (schema)¡C

¡§DeZign for databases¡¨¦b³]­p®É¨Ï¥Î¦Û°Ê¥~ÁäÂà²¾ (automatic foregin key 
migration ?)¡A¦¨¥\±q³æ¤@ªº³W½d¤ä´©ÅÞ¿è©M¹ê½è¼Æ¾Úµ¥¯Å (data level)¡C
¦h´ÚÅã¥Ü³]©w¥]¬A¹êÅé/¥DÁä/³s¥~ÁäªºÄÝ©Ê/¤£³s¥~ÁäªºÄÝ©Ê¡C¡§DeZign for databases¡¨
¤]¤ä´©©w¸q°ì (domain)¡]¥Î¤á¦Û©w¸ê®Æ«¬ºA¡^¡C

DeZign ²£¥Íªº³ø§i¥i±N½ÆÂøªº³]­p¥HÂ²¤Æ¤Fªº§Î¦¡´£¥æ¤©¤£¦Pµ¥¯ÅªººÞ²z¼h¡C
§A¥u»Ý«ö¤@¤U·Æ¹««K¥i²£¥Í³ø§i¡B¸ê®Æ¦r¨å (datadictionaries) ©M¸ê®Æ®w¡C
¥¦¤ä´©¥H¤U¸ê®Æ®w¡JOracle¡BInterbase¡BIBM DB2¡BSybase¡B·L³n Access
(95/97/2000)¡B·L³n SQL Server¡BParadox¡BdBase¡BInformix¡BSQL-Anywhere¡BMySQL ©M
PostgreSQL¡C

Heraut¡§DeZign for databases¡¨¦b¡]\nameurl{http://www.heraut.demon.nl}{}¡^¡C
 


\section{PostgreSQL ªº¤¬Ápºô¸ê®Æ®w³]­p/§¹¦¨¤u¨ã¡XEARP}

 
\begin{itemize}
\item  \nameurl{http://www.oswego.edu/Earp}{} 
\item  \nameurl{ftp://ftp.oswego.edu}{} ªº¡¥pub/unix/earp¡¦¥Ø¿ý¡C 
\end{itemize}
 
 


\subsection{EARP ¬O¤°»ò¡H}

 
¬O David Dougherty ªº¡§Easily Adjustable Response Program¡¨¡CEARP ¬O¤@­Ó§Q¥Î 
PostgreSQL ¸ê®Æ®w¨t¨tªººô¤W¸ê®Æ®w³]­p/¹ê¬I¤u¨ã¡C¥\¯à¥]¬A¡J

\begin{itemize}
\item      ¤@­ÓµøÄ±¤Æªº³]­p¨t²Î¡C
\item      ¤@­Ó sendmail ¤¶­±¡C¡]¥i¦¬µo¹q¶l¡^
\item      ¤@­Ó¼W±j¤Fªº«O¦w¾÷¨î¡C
\item      ¤@­Ó cgi ÅX°Êµ{¦¡¡C
\end{itemize}
 
 


\subsection{¬I¦æ}

EARP ¥D­n¬I¦æ¤@­Ó¦b http ºÊ±±µ{¦¡ (daemon) ¤U°õ¦æªº CGI 
¤G¤¸ÀÉ¨Ó¦s¨ú¸ê®Æ®w¦øªA¾¹¡C©Ò¦³³]­p¤u¨ã³£«Ø¥ß¦bÅX°Êµ{¦¡¤¤¡A°£¦bºô¤W¡A
¦A¨S¦³¦a¤è»Ý­n§@¥X³]­p¡C¨º¨Ç¤u¨ã¥»¨­»Ý­n¤@­Ó¤ä´©¹Ï¹³ªºÂsÄý¾¹¡A
©Ò³]­p¥X¨Óªºª«¥ó¿W¥ß©ó½s¼g¤èªk¡A¦Ó¬O®Ú¾Ú­Ó¤H¦n´c¡C

 


\subsection{¥¦¦p¦ó¤u§@¡H}

 
EARP ªº¨ä¤¤¤@­Ó¥D­n¯S¦â¬O¥¦¨Ï¥Îª«¥ó¾É¦Vªº¤èªk¨Ó²£¥Í¥Î¥H³s±µ¸ê®Æ®wªº html 
­¶¡C¤j³¡¤À­¶­±³£¥]§t¦h­Óª«¥ó¡C¨C­Óª«¥ó³£¥H¬Y¨Ç¤u¨ã²£¥Í¤Î¨ú±o¤@­Ó¦W¦r¡A
³o¨Çª«¥ó·|³Q­¶­±¤u¨ã (page tool) ¥H¤@­Ó¥i©I¥sªº¶¶§Ç (callable sequence) 
³sµ²¦b¤@°_¡Cª«¥ó¥i¦b¨ä¥L­¶­±¤¤­«¥Î¡C¦³Ãö HTML¡B¬d¸ß¡BÅª¨ú¨Ï¥ÎªÌ¿é¤J¡B
¥i©µ¦ùªº¬d¸ß©M¿é¤Jª«¥ó®æ¦¡¤Æ (Extendable Formatting of Query and Input 
objects)¡B§â²{¦³ª«¥ó³sµ²¦¨¨ä¥Lª«¥óªº°ò¥»¤u¨ã¬Ò¦³´£¨Ñ¡C
§ó¥ý¶i¤u¨ã¥]¬A¹q¶l¤u¨ã©M¦h¬y¬d¸ß¤u¨ã¡C

EARP ªº¥t¤@­Ó¯S¦â¬O¥ý¶iªº«O¦w¡C¦³¦hºØ¤èªk­­¨î¦s¨ú EARP 
¨t²Îªº¤£¦P³¡¤À¡C¬°¹F¨ì¥ý¶iªº«O¦w¡AEARP ÀË¬d¨C¤@­Ó³s±µ¡A
¥H½T©w¨C­Ó³s±µ¤H­ûªº¨­¤À (ids) ¤Î¸s²Õ (groups)¡C¤£¦P³¡¤Àªº¦s¨ú¿W¥ß©w¸q¡A
³Ì²×ªº²Õ¦X¨M©wµ²ªG¯à§_¦s¨ú EARP ªº¤@­Ó¯S©w³¡¤À¡C¦¹¥~¡A
¹ê¬I³o¨Ç«O¦w¯S¦â¥u»Ý¤@­Ó¤ä´©°ò¥»¡]©Î§ó¨Î¡^¨Ï¥ÎªÌ»{ÃÒ (user authentication) ªº 
http ¦øªA¾¹¡C


\subsection{¦ó³B¨ú±o EARP¡H}

EARP ¥iÄy°Î¦W (anonymous) ftp ¨ú±o¡J
\begin{itemize}
\item  \nameurl{ftp://ftp.oswego.edu}{} ªº 'pub/unix/earp' ¥Ø¿ý¡C
\end{itemize}



\section{PHP Hypertext PreProcessor¡XPostgreSQL ªº¦øªA¾¹ºÝ html ´O¤J©R¥O½Z»y¨¥\label{PHP}}

¸Uºûºô¤¶­±¤u¨ã¦ì©ó¡J
\begin{itemize}
\item  \nameurl{http://www.php.net}{}
\item  \nameurl{http://www.vex.net/php}{}
\end{itemize}

PHP ¤]¦³¤@­Ó¦W¬° Zend ªº½sÄ¶¾¹¡A¥i¤j´T§ïµ½ªí²{¡C­º¥ý§A¦b¶}µo¡B´ú¸Õ©M°£¿ù®É¨Ï¥Î 
PHP ©R¥O½Z»y¨¥¡C·í·Ç³Æ¦n¥¿¦¡¨Ï¥Î®É¨Ï¥Î Zend ½sÄ¶¾¹²£¥Í¥i¨³³t°õ¦æªº°õ¦æÀÉ¡C

«e¨­¬° Professional Home Pages¡]PHP¡^¦Ó²{¦bºÙ¬° PHP Hypertext Pre-Processor
\begin{itemize}
\item  «Ü¦h°ê©w³£¦³¬M®g¯¸¥x¡A¦W¬° www.COUNTRYCODE.php.net
\item  \nameurl{http://www.fe.de.php.net}{}
\item  \nameurl{http://www.sk.php.net}{}
\item  \nameurl{http://php.iquest.net/}{}
\item  °ÝÃD¥i¹q¶l¨ì¡J
\onlynameurl{rasmus@lerdorf.on.ca}
\end{itemize}

PHP ¬O¤@­Ó¦øªA¾¹ºÝ html ´O¤J©R¥O½Z»y¨¥¡C¥¦Åý§A¦b§Aªº .HTML 
ÀÉ¤¤¥[¤JÂ²³æªº©R¥O½Z¡A¹³ JavaScript ¯ë¡C¤£¹L¡A©M JavaScript ¤£¦P¡APHP 
¿W¥ß©óÂsÄý¾¹¡CJavaScript ¬O¤@ºØ«È¤áºÝªº html ´O¤J©R¥O½Z»y¨¥¡A¦Ó PHP 
¬O¦øªA¾¹ºÝ»y¨¥¡CPHP ªº·§©À©M Netscape ªº LiveWire Pro 
²£«~¬Û¦ü¡C¦pªG§A³ßÅw§Ö³t§ó·s¤S¥]¬A·½µ{¦¡½Xªº¦Û¥Ñ³n¥ó¡A§A¤j·§·|³ßÅw PHP 3¡C

\begin{itemize}
\item  ¤ä´© PostgreSQL ªºµ{¦¡½X¥Ñ Adam Sussman ¼g¦¨
\onlynameurl{asussman@vidya.com}
\end{itemize}





\subsection{¥D­n¯S¦â}

\begin{itemize}
\item ¼Ð·Çªº CGI¡AFastCGI ©M Apache ¼Ò²Õ¤ä´©¡X
§@¬°¤@­Ó¼Ð·Çªº CGI µ{¦¡¡APHP ¥i¦b°õ¦æ¥ô¦ó Unix ¤¬Ápºô¦øªA¾¹ªº¥ô¦ó Unix 
¹q¸£¤W¦w¸Ë¡C¥[¤W¹ï·s FastCGI ¼Ð·Çªº¤ä´©¡APHP ¥i±q¤¤±o¨ì³t«×¤Wªº§ïµ½¡C§@¬°¤@­Ó 
Apache ¼Ò²Õ¡A PHP ÅÜ¦¨ CGI µ{¦¡¥~¤@­Ó±j«l¤Î{\bfseries §Ö¦p°{¹q}ªº¿ï¾Ü¡C
\item  ¦s¨ú°O¿ý (Access Logging)¡X
ÄyµÛ PHP ªº¦s¨ú¬ö¿ý¥\¯à¡A¥ÎªÌ¥i¦Û¦æºûÅ@©R¤¤¼Æ¦r (hit counting) 
¤Î§@¥X¬ö¿ý¡C¥¦§¹¥þ¤£§Q¥Î¨t²Î¤¤¥¡ªº¬ö¿ýÀÉ¡A¦Ó¥B§Y®ÉºÊ¹î¦s¨ú¹Lµ{¡CLog Viewer 
Script ´£¨Ñ¤F­Ó§O¥ÎªÌ¾Ö¦³ªº­¶­±ªº¦s¨úºK­n¡C¦¹¥~¡A
¥»®M¥ó¥i³Q³]©w¬°¦b¨C­¶²£¥Í¤@­ÓÅã¥Ü¦s¨ú¸ê®Æªºµù¸}¡C¥»­¶ªºµ²§À´N¦³¤@­Ó¨Ò¤l¡C
\item  ¦s¨ú±±¨î (Access Control)¡X
¤@­Ó¥H¸Uºûºô¬°°òÂ¦ªº¤º«Ø³]©wµe­±³B²z¨ú±±¨î³]©w¡C
¥ÎªÌ¥i¥H¬°¬Y¤H¾Ö¦³ªº©Ò¦³©Î­Ó§Oºô­¶«Ø¥ß³W«h¡A­­¨î½Ö¤H¯à¤Î¥L¯à«ç¼Ë¾\Åª¦³Ãöºô­¶¡C
®Ú¾Ú¥ÎªÌªººô°ì¡BÂsÄý¾¹¡B¹q¶l¦a§}¬Æ¦Ü¨Ó·½¤å¥ó (referring 
document)¡Aºô­¶¥i¥H±K½X«OÅ@¡B§¹¥þ¬Ý¤£¨ì¡B¸T¤î¬ö¿ý (logging disabled) 
©M°µ¨ä¥L¨Æ¡C
\item  PostgreSQL ¤ä´©¡X
Postgres ¬O¤@­Ó¥ý¶iªº¦Û¥Ñ RDBMS¡C§Q¥Î PHP¡A¥ÎªÌ¥iª½±µ¦b .HTML ÀÉ¤¤´O¤J 
PostgreSQL ªº¡uSQL ¬d¸ß¡v¡C
\item  RFC-1867 ÀÉ®×¤W¶Ç¤ä´©¡X
ÀÉ®×¤W¶Ç¬O Netscape 2.0 ªº·s¥\¯à¡C¥¦Åý¥ÎªÌ§âÀÉ®×¤W¶Ç¨ì¸Uºûºô¦øªA¾¹¡C
¨Ï±o³o¨Æ¦æ¥iªº­ì¦]¡A¬O¹ê»Úªº Mime ¸Ñ½X¥Ñ PHP ´£¨Ñ¡A¥¦¥i´£¨ÑÃB¥~ªº®Ø¬[¡A
¦b¦¬¨ì¤W¶ÇªºÀÉ®×«á°µ¨Ç¦³¥Îªº¨Æ¡C
\item  HTTP ¬°°òÂ¦ªº»{ÃÒ±±¨î¡X
PHP ¥i¥Î¨Ó¦b Apache ¸Uºûºô¦øªA¾¹¤¤«Ø¥ß¦Û©wªº¥H HTTP ¬°°òÂ¦ªº»{ÃÒ¾÷¨î¡C
\item  ÅÜ¼Æ¡B¦C°}¡B¬ÛÁp¦C°} (Associative Arrays)¡X
PHP ¤ä´©ÅÜ¼Æ§ÎºA¡B¦C°}¡B¬Æ¦Ü¦p Perl ¯ëªº¬ÛÁp¦C°}¡C¥¦­Ì¥iÄy GET ©Î POST 
¤èªk¦bºô­¶¶¡¶Ç»¼¡C
\item  ±ø¥ó¦¡¡BWhile °j°é¡X
PHP ¤ä´©¤@ºØÃþ¦ü C ªº¥þ¥\¯à©R¥O½Z»y¨¥¡C§A¥i¨Ï¥Î if/then/elseif/else/endif 
±ø¥ó¦¡¡Bwhile °j°é©M switch/case ±Ô­z¨Ó«ü¤Þ§Aªº html ­¶ªºÅã¥ÜªºÅÞ¿è¬y¦V¡C
\item  ©µ¦ù¥¿³Wªí¹F¦¡¡X
¥¿³Wªí¹F¦¡±`³Q¥Î©ó¼Ë¦¡¤Ç°t¡B¼Ë¦¡´À´« (pattern substitutions) 
©M¤@¯ëªº¦r¦ê³B²z¡CPHP ¤ä´©©Ò¦³±`¥Îªº¥¿³Wªí¹F¦¡¹B§@¡C
\item  ­ì©l HTTP ¼ÐÀY±±¨î¡X
­n¶i¦æ°ª¶¥ºô¯¸³]­p¡A¨Ïºô­¶µø±¡§Î¶Ç°e¦Û©w HTTP ¼ÐÀYªº¯à¤O¬O¥²¶·ªº¡C
¤@­ÓºD±`¥Îªk¬O¶Ç°e¤@­Ó Location: URL ¼ÐÀY¨Ó§â«È¤áºÝ¶Ç°e¨ì¨ä¥L 
URL¡C¥¦¤]¥i¥Î©óÃö±¼§Ö¨ú©Î³B²zºô­¶­¶­º¤Wªº¡§last update¡¨¼ÐÀY¡C
\item  §Y®É GIF ¹Ï¹³²£¥Í¡X
PHP ¤ä´© Thomas Boutell ªº GD ¹Ï¹³¨ç¦¡®w¡A¨Ï¥¦¥i§Y®É²£¥Í GIF ¹Ï¹³¡C
\item  ISP¡§¦w¥þ¼Ò¦¡¡¨¤ä´©¡X
PHP ¤ä´©¤@­Ó¿W¦³ªº¡§¦w¥þ¼Ò¦¡¡¨(Safe Mode)¡A¨Ï±o¦b¦P¤@¦øªA¾¹¤W¦³¦h­Ó¥Î¤á¨Ï¥Î 
PHP ©R¥O½Z¤]¨S¦w¥þ°ÝÃD¡C
\item  ·sª©¥»ªº PHP ¥[¤J¤F«Ü¦h·s¥\¯à¡A½Ð°Ñ¾\¥Dºô­¶ \nameurl{http://www.php.net}{}
\item  ¥¦¬O¦Û¥Ñªº¡I
³Ì«á¤@­Ó¥²­nªº¯S©Ê¡C³o®M¥ó¬O§¹¥þ¦Û¥Ñªº¡C¥¦¥H GNU/GPL 
±ÂÅv¡AÅý§A¥i¬°¥ô¦ó¥Øªº¨Ï¥Î³o³n¥ó¡A¥]¬A°Ó·~¥Î³~¡C±ýª¾¸Ô±¡¡A½Ð°Ñ¬Ý GNU General 
Public License ¤å¥ó¡C
\end{itemize}



\subsection{PHP¡XÂ²¥v}

ªì¥X²{®É¡APHP ¬O¤@­Ó¥H Perl ¼g¦¨¤p¥©Â²³æªº cgi ¥]¸Ë¾¹ 
(wrapper)¡C³o®M¥ó³Ì¥ý¦W¬° Personal Home Page Tools¡A«á¨ÓÅÜ¬° Personal Home 
Page Construction Kit¡C

¥t¦³¤@¤u¨ã¬O¼g¨ÓÂ²¤Æ¦bºô­¶¤¤´O¤J SQL ¬d¸ßªº¤u§@¡C¥¦°ò¥»¤W¬O¥t¤@­Ó CGI 
¥]¸Ë¾¹¡A¯à¤ÀªR (parsed) SQL ¬d¸ß¤ÎÂ²¤Æ«Ø¥ß®Ú¾Ú³o¨Ç¬d¸ßªºªí®æ©M¦Cªíªº¤u§@¡C
³o¤u¨ã¦W¬° FI (Form Interpreter)¡C

PHP/FI 2.0 ª©§¹¥þ­«¼g³o¨â®M¥ó¡A±N¤§¦X¦Ó¬°¤@¡C¥¦¶i¤Æ¦Ü¥i§âÂ²³æ¹q¸£»y¨¥´O¤J 
HTML ÀÉ¤¤¡C¥¦ÄyµÛ§â©ÒÂ²³æªº©R¥O½Zª½±µ´O¤J HTML ÀÉ¤¤¡A®ø°£¤j¶q¤p«¬ Perl cgi 
µ{¦¡ªº»Ý­n¡C³o¼Ë·|¥[§Ö§Aªººô­¶¡A¦]¬° fork ¦h¦¸ Perl ªº§xÂZ¤w¸g®ø°£¡C
¥¦¤]Â²¤Æ¤FºÞ²z¤j«¬ºô¯¸ªº¤u§@¡A¦]¬°§A¥i§âºô­¶ªº©Ò¦³³¡¤À©ñ¦b¤@­Ó html 
ÀÉ¤¤¡C¥[¤W¦hºØ¸ê®Æ®wªº¤ä´©¡A¥i¨Ï¥Î¸ê®Æ®wªººô­¶ªº¶}µoÅÜ±oÂ²³æ¡C
«Ü¦h¤HÄ±±o´O¤J¬d¸ß¤ñ¤À§O«Ø¥ß HTML ©M CGI ÀÉÂ²³æ±o¦h¡C

PHP/FI ¤w§ï¦W¬° PHP¡C


\subsection{¨º»ò¡A§Ú¯à¥Î PHP °µ¤°»ò¡H}

¦pªG§A¨Ï¥Î PHP¡A§A­º¥ý·|ª`·N¨ì¥¦¦b­¶§À¥[¤W³oºô­¶´¿³QÂsÄý¹L¦h¤Ö¦¸ªº¸ê®Æ
¡]¦pªG§A¦b¦b½sÄ¶®É¿ï¨ú¤F access logging¡^¡C³o¥u¬O PHP ©Ò°µªº¤@¤p³¡¤À¡C
¥¦ªº¥t¤@­Ó­«­n¨¤¦â¬O§@¬°¤@­Óªí®æª½Ä¶ cgi µ{¦¡ (form interpreter 
cgi)¡A³o¤]´N¬O­º¦W¤¤ FI ªº·N«ä¡C¨Ò¦p¡A¦pªG§A¦b¤@­Óºô­¶¤¤«Ø¥ß¤F¤@­Óªí®æ¡A
§A»Ý­n¤@­Óµ{¦¡¨Ó³B²zªí®æ¤Wªº¸ê®Æ¡C§Y¨Ï§A¥u·Q§â¸ê®Æ¶Ç°e¨ì¥t¤@ºô­¶¡A§A¤]»Ý­n 
cgi µ{¦¡ªºÀ°§U¡CPHP ¨Ï±o¨ú±o©M³B²zªí®æªº¸ê®Æ·¥¬°®e©ö¡C


\subsection{¤@­ÓÂ²³æªº¨Ò¤l}

°²³]§A¦³¤@±iªí®æ¡J
\begin{tscreen}
\begin{verbatim}
<FORM ACTION="/cgi-bin/php.cgi/~userid/display.html" METHOD=POST>
<INPUT TYPE="text" name="name">
<INPUT TYPE="text" name="age">
<INPUT TYPE="submit">
<FORM>
\end{verbatim}
\end{tscreen}

§Aªº display.html «K¥i¥]¬AÃþ¦üªºªF¦è¡J
\begin{tscreen}
\begin{verbatim}
< ?echo "Hi $ name, you are $ age years old!<p>" >
\end{verbatim}
\end{tscreen}

´N¬O³o¼ËÂ²³æ¡IPHP ¦Û°Ê¬°¨C­Óªí®æ¿é¤JÄæ¦ì²£¥Í¤@­ÓÅÜ¼Æ¡C¤§«á§A«K¥i¦b ACTION URL 
ÀÉ¤¤¨Ï¥Î³o¨ÇÅÜ¼Æ¡C

¦b§A§ä¥X¦p¦ó¨Ï¥ÎÅÜ¼Æ¤§«áªº¨BÆJ´N¬O¦bºô­¶¤¤¸Õ¥Î¤@¨ÇÅÞ¿è¬yµ{¼ÐÅÒ¡C¨Ò¦p¡A
¦pªG§A·Q®Ú¾Ú¥ÎªÌ¿é¤JÅã¥Ü¤£¦P°T®§¡A§A¥i¨Ï¥Î if/else ÅÞ¿è¡C¦b¤W­±ªº¨Ò¤l¡A
§Ú­Ì¥i§ïÅÜ display.html¡A¨Ï±o¤£¦PªF¦è·|®Ú¾Ú¥Î¤á¿é¤JÅã¥Ü¥X¨Ó¡J
\begin{tscreen}
\begin{verbatim}
<?
    if($age>50);
        echo "Hi $name, you are ancient!<p>";
    elseif($age>30);
        echo "Hi $name, you are very old!<p>";
    else;
        echo "Hi $name.";
    endif;
>
\end{verbatim}
\end{tscreen}

PHP ´£¨Ñ¤@ºØ«D±`±j«lªº©R¥O½Z»y¨¥¡A¯à°µ¨ìªº¨Æ¤ñ¥H¤WÂ²³æªº¨Ò¤l¦h«Ü¦h¡C±ýª¾¸Ô±¡¡A
½Ð°Ñ¾\¦³Ãö PHP Script Language ªº³¹¸`¡C

§A¤]¥i¨Ï¥Î PHP ¨Ó³]©w¦³¤°»ò¤H¯à¬Ý¨ì§Aªººô­¶¡C³o¥i¨Ï¥Î¤@­Ó¤º«Øªº³]©wµe­±°µ¨ì¡C
¨Ò¦p¡AÄyµÛ¥¦§A¥i«ü©w¥u¦³¬Y¨Çºô°ìªº¤H¥i¬Ý¨ì§Aªººô­¶¡A
©Î«Ø¥ß¤@¨Ç³W«h¨Ó¥Î±K½X«OÅ@¬Y¨Çºô­¶¡C±ýª¾¸Ô±¡¡A½Ð°Ñ¾\¦³Ãö Access Control ªº³¹¸`¡C

PHP ¤]¦³¯à¤O±µ¦¬¥ô¦ó¨Ì·Ó RFC-1867 ³W©wªºÂsÄý¾¹¤W¶ÇªºÀÉ®×¡C
³o¯S¦â¨Ï¥ÎªÌ¯à¤W¶Ç¤å¦r©Î¤G¤¸ÀÉ¡CÄyµÛ PHP ªº¦s¨ú±±¨î©MÅÞ¿è¥\¯à¡A
§A¥i¥þ­±±±¨î²a³\½Ö¤W¶Ç¤Î¤W¶Ç«á°µ¤°»ò¡C±ýª¾¸Ô±¡¡A½Ð°Ñ¾\¦³Ãö File Upload ªº³¹¸`¡C

PHP ¤ä´© PostgreSQL ¸ê®Æ®w®M¥ó¡C¥¦¤ä´©¦b .HTML ÀÉ¤¤´O¤J SQL ¬d¸ß¡C

PHP ¤]¤ä´© mysql ¸ê®Æ®w®M¥ó¡C¥¦¤ä´©¦b .HTML ÀÉ¤¤´O¤J SQL ¬d¸ß¡C


\subsection{CGI §ï¦V (Redirection)}




\subsubsection{Apache 1.0.x ºK­n}

¨Ï¥Î Apache ¦øªA¾¹ªº cgi §ï¦V¼Ò²Õ¬O°õ¦æ PHP ªº¤@­Ó¦n¤èªk¡C
½Ðª`·N§AµL¶·¾á¤ß§ï¦V¼Ò²Õ¡A¦pªG§A¨Ï¥Î PHP ªº Apache ¼Ò²Õª©¥» (Apache module 
version)¡C¦³¨â­Ó³oÃþ§ï¦V¼Ò²Õ¡C¤@­Ó¬O Dave Andersen ¶}µoªº¡J
\begin{itemize}
\item        \onlynameurl{angio@aros.net}
\end{itemize}

¥¦¥i¦b¥H¤U¦a¤è§ä¨ì
\begin{itemize}
\item      \nameurl{ftp://ftp.aros.net/pub/util/apache/mod_cgi_redirect.c}{}
\end{itemize}

¥t¤@­Ó¤w¥]¬A¦b Apache ¤¤¡A¦W¬° mod\_actions.c¡C³o¨Ç¼Ò²Õ·¥¬°¬Û¦ü¡A
¥u¬O¦b¥Îªk¤W¦³¤Ö³\®t§O¡C¨â­Ó³£´ú¸Õ¹L¡A¯à©M PHP ¶¶§Q¦X§@¡C

¬d¬Ý Apache ªº¤å¥óÃö©ó¦p¦ó¥[¤J¤@­Ó¼Ò²Õ¡C¤@¯ë¨Ó»¡¡A§A§â¼Ò²Õ¦WºÙ¥[¨ì¤@­Ó¦W¬°
Configuration ªºÀÉ®×¤¤¡C¦pªG§A¨Ï¥Î mod\_actions ¼Ò²Õ¡A§A­n¥[ªº¤@¥y¬O¡J

Module action\_module mod\_actions.o

¦pªG§A¨Ï¥Î mod\_cgi\_redirect ¼Ò²Õ¡A¥[¤W¥H¤U¤@¥y¡J

Module cgi\_redirect\_module mod\_cgi\_redirect.o

­«·s½sÄ¶§Aªº httpd ¤Î¦w¸Ë¥¦¡C­n³]©w cgi §ï¦V§A»Ý­n¦b§Aªº mime.types 
ÀÉ¤¤«Ø¥ß·sªº mime Ãþ«¬¡A©Î¦b§Aªº srm.conf ÀÉ¤¤¨Ï¥Î AddType «ü¥O¨Ó¥[¤W mime 
Ãþ«¬¡C©Ò¥[¤Wªº mime Ãþ«¬À³Ãþ¦ü¡J
\begin{tscreen}
\begin{verbatim}
     application/x-httpd-php phtml
\end{verbatim}
\end{tscreen}

¦pªG§A¨Ï¥Î mod\_actions.c ¼Ò²Õ¡A§A»Ý¦b srm.conf ÀÉ¤¤¥[¤W¥H¤U¤@¦æ¡J
\begin{tscreen}
\begin{verbatim}
     Action application/x-httpd-php /cgi-bin/php.cgi
\end{verbatim}
\end{tscreen}

¦pªG§A¨Ï¥Î mod\_cgi\_redirect.c ¼Ò²Õ¡A§A»Ý¦b srm.conf ÀÉ¤¤¥[¤W¥H¤U¤@¦æ¡J
\begin{tscreen}
\begin{verbatim}
     CgiRedirect application/x-httpd-php /cgi-bin/php.cgi
\end{verbatim}
\end{tscreen}

¤£­n¦P®É¨Ï¥Î mod\_actions.c ©M mod\_cgi\_redirect.c¡C

¦w¸Ë¤Î¥¿½T³]©w¤F³o¨Ç cgi §ï¦V¼Ò²Õ«á¡A§A¥u»Ý§â©µ¦ùÀÉ¦W©w¬° .phtml¡A
«K¥i¥H«ü©w³oÀÉ®×¥Ñ PHP ¤ÀªR¡C¦¹¥~¡A¦pªG§A¦b srm.conf ÀÉªº DirectoryIndex 
³]©w¦æ¥[¤W index.phtml¡A³Ì¤W¼hªººô­¶«K·|¦Û°Ê¥Ñ php ¤ÀªR¡A¦pªG§Aªº index 
ÀÉ¦W¬° index.phtml¡C


\subsubsection{Netscape HTTPD}

§A¥iÄy Netscape Server CGI Redirection 
¼Ò²Õ¨Ó«ü©w¦Û°Ê§â¹ï¬Y¨Ç©µ¦ùÀÉ¦WªºÀÉ®×ªº­n¨D§ï¦Vµ¹ PHP¡C³o¼Ò²Õ¥i¦b PHP ºô­¶ªº 
File Archieves ¤¤§ä¨ì¡C®M¥ó¤¤ªº README ©ú½T¦a¸ÑÄÀ¤F¦p¦ó³]©w¥¦¨Ó¥Î©ó PHP¡C


\subsubsection{NCSA HTTPD}

¥Ø«e¡ANCSA ¨Ã¤£¤ä´©¼Ò²Õ¡A©Ò¥H¡A­n¨Ï¥Î cgi §ï¦Vªº¸Ü¡A§A­n­×§ï¦øªA¾¹ªº­ì©l½X¡C
¤@­Ó¹ï NCSA 1.5 °µ³o¤u§@ªº´O¸É¦b¦b PHP ÀÉ®×¦s®w¤¤§ä¨ì¡C


\subsection{¦b«ü¥O¦æ°õ¦æ PHP}

¦pªG§A«Ø¥ß¤F CGI ª©¥»ªº PHP¡A§A¥u»Ý¦b«ü¥O¦æ¿é¤J php.cgi filename¡A¦Ófilename 
¬O§A·Q¤ÀªRªºÀÉ®×¡C§A¥i«Ø¥ß¿W¥ßªº PHP ©R¥O½Z¡A¥u»Ý§â©R¥O½Z (script) 
ªº²Ä¤@¦æ¼g¬°Ãþ¦ü¡J
\begin{tscreen}
\begin{verbatim}
    #!/usr/local/bin/php.cgi -q
\end{verbatim}
\end{tscreen}

¡§-q¡¨ªý¤î¦L¥X HTTP ¼ÐÀY¡C³ßÅwªº¸Ü¡A§A¥i¤£¥Î³o¿ï¾Ü¡C


\subsection{PHPGem ®M¥ó}

PHPGem ¬O¤@­Ó PHP ©R¥O½Z¡A¥Î¥H¥[³t½s¼g¨Ï¥Îªí®æªº PHP ©R¥O½Z¡C¥¦¥i¥Î©ó¤£¦Pªº 
SQL ¦øªA¾¹¡A¦p PostgreSQL¡BMySQL¡BmSQL¡BODBC ©M Adabas¡C
§A¿é¤Jªí®æÄæ¦ìªº´y­z©M°Ñ¼Æ¡]Äæ¦ì¦WºÙ¡BÄæ¦ìªº on/off searching (?) µ¥µ¥¡^¡A
PHPGem ¿é¥X¥t¤@­Ó¨Ï¥Î¨º¨Çªí®æªº PHP ©R¥O½Z¡]ÀËµø/¥[/­×§ï/§R°£/­«ÂÐ¤º®e©M·j¯Á¡^¡C
PHPGem ¥i¨Ï¥Î¦h¼h±_ª¬ªí®æ (multi-level nested tables, ??)¡CPHPGem 
®e³\§A«ü©w¨C­Óªí®æ¨C­ÓÄæ¦ì¨C¤HÊú¦s¨ú±±¨î¡CPHPGem ¤]¤ä´©¼v¹³¡C

PHPGem ¦b \nameurl{http://sptl.org/phpgem}{} §ä¨ì¡C


\section{PostgreSQL ªº Python ¤¶­±}

Python ¬O¤@­Óª½Ä¶ªºª«¥ó¾É¦V©R¥O½Z»y¨¥¡C¥¦¨Ï¥ÎÂ²©ö¡]»´¥©ªº»yªk¡B
Â²³æª½±µªº¥y¤l¡^¡A¦³«Ü¦h¥Î©ó«Ø¥ß GUI ªº©µ¦ù¡B¸Uºûºô¤¶­±µ¥µ¥¡C
¤@­Ó¦³´¼¼zªºÂsÄý¾¹¡]Ãþ¦ü HotJava¡^¥¿¦b¶}µo¤¤¡]¤@¤E¤E¤­¦~¤Q¤@¤ë¡^¡A
³o·|µ¹¤©µ{¦¡³]­p­û«Ü¦h¾÷·|¡CPython ªºª©Åv«ù¦³¤H¬°²üÄõªü©i´µ¯S¤¦ªº Stichting S 
Mathematisch Centrum¡A¥i¦Û¥Ñ´²§G¡C¥¦¥]¬Aª«¥ó¡BÃþ§O (classes)¡B¼Ò²Õ¡B©M¨Ò¥~ 
(exceptions) ªº°ÊºA¸ü¤J¡C¨Ï¥Î C »y¨¥¨Ó±N¨ä¤¶­±¥[¤J·s¨t²Î¨ç¦¡®w¬Oª½±µªº¤u§@¡A¨Ï 
Python ¦b¦Û¦æ³]©w®É®e©ö¨Ï¥Î¡CPython ¬O¤@­Ó¾Ö¦³ X ¤¶­±ªº°ªµ¥©R¥O½Z»y¨¥¡C¦b 
Linux ¥úºÐ¤¤ªº Python ®M¥ó¥]¬A¤j³¡¤À¼Ð·Ç Python ¼Ò²Õ¡A¥H¤Î¥Î§@ Tk ¤¶­±ªº Tix 
widget ¼Ò²Õ¡C

PyGreSQL ¬O¤@­Ó¥Î§@ PostgreSQL ¸ê®Æ®wªº¤¶­±¡C¥¦´O¤J¤F PostgreSQL 
¬d¸ß¨ç¦¡®w¡A¨Ï±o¦b Python ¤â½Z¤¤¨Ï¥Î±j«lªº PostgreSQL ¯S©Ê¤Q¤ÀÂ²³æ¡CPyGreSQL 
¥Ñ D'Arcy J.M. Cain ©M Pascal Andre ¼g¦¨¡C
\begin{itemize}
\item  PyGreSQL ªº·sºô¯¸ \nameurl{http://www.druid.net/pygresql/}{}
\item  D'Arcy ©ÒºûÅ@ªº \nameurl{http://www.druid.net/~darcy/}{}
\item  ÂÂºô¯¸¦b \nameurl{ftp://ftp.via.ecp.fr/pub/python/contrib/Database/PyGres95.README }{}
\item  D'Arcy J.M. Cain \onlynameurl{darcy@druid.net}
\item  Pascal Andre \onlynameurl{andre@chimay.via.ecp.fr}
\item  Pascal Andre \onlynameurl{andre@via.ecp.fr}
\end{itemize}





\subsection{¦p¦ó¨ú±o PyGres¡H}

¤£¦P®M¥óªº¥Dºô¯¸¦b¡J
\begin{itemize}
\item  Python \nameurl{ftp://ftp.python.org:/pub/www.python.org/1.5/python1.5b2.tar.gz}{}
\item  PyGreSQL \nameurl{ftp://ftp.druid.net/pub/distrib/PyGreSQL-2.1.tgz}{}
\item  ÂÂºô¯¸ \nameurl{ftp://ftp.via.ecp.fr/pub/python/contrib/Database/PyGres95-1.0b.tar.gz }{}
\end{itemize}

µL½×¦p¦ó¡A§AÀ³¹Á¸Õ´M§ä³Ì±µªñ§Aªº¬M®g¯¸¥x¡C½Ð°Ñ¾\¸ê®Æ¨Ó·½¨Ó§ä³o¨Ç¯¸¥x¡CPygreSQL
¤]·|¦b Python ©M PostgreSQL ¯¸¥xªº contrib ¥Ø¿ý§ä¨ì¡C




\subsection{¸ê®Æ©M¤ä´©}

¦pªG§A»Ý­n³o¨Ç®M¥óªº¸ê®Æ¡A½Ð¬d¬Ý¥H¤Uºô­¶¡J
\begin{itemize}
\item  Python¡J     \nameurl{http://www.python.org/}{}
\item  PostgreSQL¡J \nameurl{http://epoch.cs.berkeley.edu:8000/postgres95/index.html}{}
\item  PyGreSQL \nameurl{ftp://ftp.druid.net/pub/distrib/PyGreSQL-2.1.tgz}{}
\item  PyGreSQL ÂÂºô¯¸¡J   \nameurl{http://www.via.ecp.fr/via/products/pygres.html}{}
\end{itemize}


¤ä´©¡J
\begin{itemize}
\item  PyGreSQL ªº³q«H½×¾Â¡C­n°Ñ¥[ªº¸Ü¡A§A¥i¹q¶l¦Ü¡J
\onlynameurl{majordomo@vex.net}
¦b¥¿¤å¤¤¼g¡§subscribe pygresql name@domain¡¨¡A§â¡§name@domain¡¨
§ï¬°§A¦Û¤vªº¹q¶l¦a§}¡C
\item   Python ªº·s»D²Õ¡J     newsgroup comp.lang.python
\item   PyGreSQL :   ¦p¦³¯äÂÎ³ø§i¡B·N¨£¡Bª`ÄÀ¡A½Ð§ä Andre
\onlynameurl{andre@via.ecp.fr}
\end{itemize}



\subsection{´ú¸Õ Python ¤¶­±}

½Ð°Ñ¦Ò \ref{Testing PyGreSQL} {(´ú¸Õ Python¡XPostgreSQL ¤¶­±)} ¤@¸`¡C


\section{PostgreSQL ©M¸Uºûºôªº¹h¸ô (gateway) ¡X WDB-P95}




\subsection{¦³Ãö wdb-p95}

WDB-P95 - ¤@­Ó¥Ñ J. Douglas Dunlop ¶}µoªº PostgreSQL ¸ê®Æ®w¸Uºûºô¤¶­±
¥¦¦b¡J
\begin{itemize}
\item  J Rowe ªº·s WDB ¦b \nameurl{http://www.lava.net/beowulf/programming/wdb}{}
\item  ·sª©¥»ªº WWW-WDB ¦b \nameurl{http://www.eol.ists.ca/~dunlop/wdb-p95/}{}
\item  ¦³°ÝÃD©Î·Q¥[¤J³q«H½×¾Â
\onlynameurl{dunlop@eol.ists.ca}
\end{itemize}

³o¬O¤@­Ó­×§ï¤Fªº wdb-1.3a2¡A´£¨Ñ¤@­Ó PostgreSQL ¨ì¸Uºûºôªº¹h¸ô¡C
³oª©¥»¤]»Ý­n¯à³B²z HTML ªí®æªºÂsÄý¾¹¡C­ì¥»ªº wdb µL¦¹­n¨D¡A¦ý­nÁÙ­ì¤]¤£Ãø¡C

§A¥i¹Á¸Õ CASI Tape ©M Image Query¡C§A¥i¬Ý¬Ý¨ä Form Definition File 
(FDF)¡A¥¦¤]¥Î©ó²£¥Í CASI Tape ©M Image Query¡A¥¦¥]§t¤F¨â­Ó¦CªíªºÁpµ² (join)¡C

³oª©¥»¥]§t©Ò¦³»Ý­n¥Î©ó¦w¸Ë©M°õ¦æ¥H WDB-P95 ¬° PostgreSQL 
¤¶­±ªºÀÉ®×¡C­n§â³o¨t²Î²¾´Ó¨ì¨ä¥L¸ê®Æ®wÀ³»á¬°Â²³æ¡X¦pªG¥¦¤ä´©¼Ð·Çªº SQL ©M¾Ö¦³ 
Perl ¤¶­±¡C




\subsection{PostgreSQL ¦øªA¾¹¡Bpgperl ©M httpd ¬O§_»Ý¦b¦P¤@¹q¸£¡H}

§_¡XPostgreSQL ¤£»Ý¦b¦P¤@¹q¸£¡C¦] WDB-P95 ¥Ñ httpd ºÊ±±µ{¦¡ (daemon) 
©I¥s¡A¥¦­Ì­n¦b¦P¤@³¡¹q¸£¡C¤S¦]¬° WDB-P95 ¨Ï¥Î Pg.pm¡Apgperl ¤]­n¦b¦P¤@¹q¸£¡C
Pgperl ¬O¥H libpq ¨ç¦¡®w¼g¦¨¡A©Ò¥H¥¦¥i¦s¨úºôµ¸¤W¥ô¦ó PostgreSQL 
¦øªA¾¹¡A´N¦p¨ä¥L PostgreSQL «È¤á¡C¦p¤U©Ò­z¡J

(¸Uºûºô«È¤á (Netscape)) ={$>$} (HTTP ¦øªA¾¹ (NCSA's http) + WDB-P95 + pgperl + libpq)={$>$} (PostgreSQL ¦øªA¾¹)

¬A¸¹ () ¥Nªí¹q¸£¡C

¨C³¡¹q¸£¥i¬O¤£¦PÃþ«¬¡JNT¡BSUN¡BHP¡K¡K¦ý§A»Ý­n¦b§A¥´ºâ°õ¦æ WDB-P95 ªº¹q¸£ªº 
libpq ¤¶­±¨ç¦¡®w¡A¦]¬°§A­n¥Î¥¦¨Ó½sÄ¶ pgperl¡C¡]³o¨t²Î³]­p¦¨·|¨Ï¥Î HTML 
ªí®æ¡A©Ò¥H³Ì¦n¦³¤@·sªñªº¸Uºûºô«È¤áºÝ¡C¡^


\section{"C", "C++", ESQL/C »y¨¥¤¶­±©M PostgreSQL ªº³v¦ì¹Bºâ¤¸ (Bitwise Operators)}




\subsection{"C" ¤¶­±}

¥¦¤w¥]§t¦bµo¦æª©¥»¤¤¡A¦W¬°¡¥libpq¡¦¡C©M Oracle OCI¡BSybase DB-lib¡BInformix 
CLI ¨ç¦¡®w¬Û¦ü¡C




\subsection{"C++" ¤¶­±}

¥¦¤w¥]§t¦bµo¦æª©¥»¤¤¡A¦W¬°¡¥libpq++¡¦¡C
½Ð°Ñ¦Ò \ref{Testing libpq} {(´ú¸Õ libpq, libpq++ ¤¶­±)} ¤@¸`¡C


\subsection{ESQL/C}

PostgreSQL ESQL/C 'Embedded C Pre-compiler' Ãþ¦ü Oracle Pro*C¡BInformix 
ESQL/C¡CPostgreSQL ESQL/C ¬O¤@ºØ SQL À³¥Îµ{¦¡¤¶­± (API)¡A¨Ï C 
µ{¦¡³]­p®v¯à¦Û¦æ³]­p¥i¾Ö¦³ºÞ²z¸ê®Æ®wªº¯à¤OªºÀ³¥Îµ{¦¡¡CPostgreSQL ESQL/C 
®e³\§A¨Ï¥Î§A©Ò¼ô±xªº²Ä¤T¥N¹q¸£»y¨¥¦Ó¤S¯à§Q¥Î¨ìµ²ºc¤Æ¬d¸ß»y¨¥ (SQL) ªºÀuÂI¡C

ESQL/C ¥]§t¥H¤U³n¥ó¡J
\begin{itemize}
\item  ESQL/C ¨ç¦¡®w´£¨Ñ¨ã¸ê®Æ®w¦øªA¾¹¦s¨ú¯à¤Oªº C ¨ç¦¡¡C
\item  ESQL/C ¼ÐÀYÀÉ´£¨Ñ¹ï ESQL/C µ{¦¡¦³¥Îªº¸ê®Æµ²ºc¡B±`¼Æ©M¥¨¶°ªº©w¸q¡C
\item  ESQL/C ¹w³B²z¾¹¡A¤@­Ó§â¥]§t SQL ¥y¤lªº C 
ÀÉÂà´«¬°¥i°õ¦æÀÉªº·½µ{¦¡¹w³B²z¾¹¡C

¡]Ä¶«ö¡JÀ³¬°§â§t´O¤J¦¡ SQL ªº C ÀÉ®×Âà´«¬°¼Ð·Çªº C ÀÉ®×¡A¨Ã¥i¥Ñ gcc ½sÄ¶¬°¥i°õ¦æÀÉ¡C¥t¥~¡APostgreSQL ªº SQL ´O¤J¦¡ SQL ¹w³B²z¾¹À³¦W¬° ecpg¡C¡^
\end{itemize}

¥¦¦b
\begin{itemize}
\item  PostgreSQL ªº ESQL/C ¤w¥]§t¦bµo¦æª©¥»¤¤¡C
\item  ¥Dºô¯¸ \nameurl{ftp://ftp.lysator.liu.se/pub/linus}{}
\item ¹q¶l¡J
\onlynameurl{linus@epact.se}
\end{itemize}

½Ð°Ñ¦Ò \ref{Testing ecpg} {(´ú¸Õ ecpg ¤¶­±)} ¤@¸`¡C

­n¨Ï¥Î Vim ±m¦â½s¿è¾¹½s¼g¡¥ecpg¡¦ÀÉ¡]*.pgc¡^¡A§A­n³o¼Ë°µ¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ su - postgres
bash$ mkdir $HOME/vim
«Ø¥ß¤@­Ó¦W¬°¡¥$HOME/vim/myfilestypes.vim¡¦ªºÀÉ®×¡A¤º¦³¥H¤U¼Æ¦æ

    " myfiletypefile
        au! BufRead,BufNewFile *.pgc    set filetype=esqlc
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

§AÀ³¸Ó¦³¤@­Ó \$HOME/.gvimrc ÀÉ¡C§_«h½Ð¦Û¤v»s³y¤@­Ó¡A½Ð°Ñ¦Ò¦b 
\nameurl{http://metalab.unc.edu/LDP/HOWTO/Vim-HOWTO.html}{} ªº Vim HOWTO ¤å¥ó¡C

¦b \$HOME/.gvimrc ¥[¤W¥H¤U¤@¦æ 
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
let myfiletypefile = "~/vim/myfiletypes.vim"
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

²{¦b¦pªG§A¥Î
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ gvim sample.pgc
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

½s¿èÀÉ®×¡A§A¥i±o¨ì¨Ì»yªk¬ð¥X¤º¤å (syntax highlight) ªºÃC¦â¡C


\subsection{PostgreSQL ªº³v¦ì¤¸¹Bºâ¤¸}

³v¦ì¤¸¹Bºâ¤¸¥Ñ Nicolas Moldavsky ¼g¦¨
\begin{itemize}
\item        \onlynameurl{nico@overnet.com.ar}
\end{itemize}

¹ê½î³v¦ì¤¸¹Bºâ¡]AND¡BOR¡BXOR¡B¦ì¤¸¸É¼Æ (bitwise complement)¡^ªº 
pgsql¡§C¡¨¨ç¦¡¡C¥i¸g°Î¦W FTP ±o¨ì¡J
\begin{itemize}
\item  \nameurl{ftp://ftp.overnet.com.ar/pub/utils/linux/bitpgsql.tgz}{}
\end{itemize}

¥]¬A¤F Linux ªº Makefile¡C


\section{PostgreSQL ªº¤é¤å°²¦W½X (Kanji Code)}

¥¦¦b¥H¤Uºô§}¡J
\begin{itemize}
\item   \nameurl{ftp://ftp.sra.co.jp/pub/cmd/postgres/}{}
\end{itemize}



\section{²¾´Ó PostgreSQL ¨ìµøµ¡ 95 / µøµ¡ NT}

µøµ¡ NT ª©ªº PostgreSQL ¤G¤¸ÀÉ¥i¦b¥H¤U¦a¤è§ä¨ì¡J
\begin{itemize}
\item  µøµ¡ NT PostgreSQL ¤G¤¸ÀÉ \nameurl{http://www.askesis.nl}{}
\item  \nameurl{http://www.postgresql.org}{}
\end{itemize}

¤U¸ü¥i°õ¦æÀÉ¡A±N¥¦¸ÑÀ£¡A¨Ã±q²Ä¤Q¤T¨B¶}©l¸ò±q\ref{installpgsql} {(¦w¸Ë PostgreSQL)}¡C

¦pªG§A·Q­«·s½sÄ¶­ìµ{¦¡½X¡A½Ð¸ò±q¥H¤U«ü¥Ü¡C²¾´Ó¨ìµøµ¡ NT ­n¨Ï¥Î Cygnus 
cygwin32 ®M¥ó¡A¥¦¥]¬Aµøµ¡ NT/95 ªº gcc¡Bgmake¡C
\begin{itemize}
\item  Cygwin 32 ®M¥ó¦b \nameurl{http://www.cygnus.com/misc/gnu-win32}{}
§ä¨ì
\end{itemize}

¨ì¦¹ºô­¶¨ú±o cdk.exe ÀÉ¡]gnu-win32 ªº¦Û§Ú¸ÑÀ£ÀÉ¡^
¡]Ä¶«ö¡J¦¹¤u¨ã¤w§ï¦W¬° cygwin¡Aºô§}¬° \nameurl{http://sourceware.cygnus.com}{}¡C¡^


\subsection{NT ª©ªº§@ªÌ}

PostgreSQL NT ª©ªº§@ªÌ¬°¡X
\begin{itemize}
\item  Daniel Horak 
\onlynameurl{horak@mmp.plzen-city.cz}
\item  Joost Kraaijeveld
\onlynameurl{JKraaijeveld@askesis.nl}
\item  Kevin Lo
\onlynameurl{kevlo@FreeBSD.org}
\item  NT ª©ªººô­¶¦b \nameurl{http://www.freebsd.org/~kevlo/postgres/portNT.html}{}
\end{itemize}



\subsection{¦w¸Ë Cygwin ®M¥ó}

\begin{enumerate}
\item  ¤U¸ü \nameurl{ftp://go.cygnus.com/pub/sourceware.cygnus.com/cygwin/latest/full.exe}{}
\item  °õ¦æ full.exe¡A¦w¸Ë¨ì c:$\backslash$Unix$\backslash$Root ¥Ø¿ý¡C
\item  °õ¦æ Cygwin¡AÁä¤J¡¥mount --help¡¦¥H¾\Åª¤å¥ó¡C§A¥i¥Î -f
¿ï¶µ±j¨î±¾¤W¡C¤§«á°õ¦æ¡§umount / " ©M¡§mount c:$\backslash$Unix$\backslash$Root /¡¨
\end{enumerate}



\subsection{³]©w Bash µøµ¡}

¦w¸Ë Cygwin ®M¥ó«á¡A½Ð¶i¦æ¥H¤U¤u§@¥H³]©w¤u§@Àô¹Ò¡J

1. ¦w¸Ë Vi ½s¿è¾¹¡¥Vim¡¦¡C½Ð°Ñ¾\
\nameurl{http://metalab.unc.edu/LDP/HOWTO/Vim-HOWTO.html}{}

2. cygwin bash ªº¹w©wµøµ¡¬O¤@­Ó¤Ü¥|¦æ¡A©³¦â¬°¶Â¦âªºµøµ¡¡C­n³]©w bash
µøµ¡ªº©³¦â©M¤j¤p¡A«ö¶}©l-{$>$}±±¨î¥x-{$>$}MS DOS ¥D±±¥x¡A§â©³¦â³]©w¬°¶Â¦â¡A
¤j¤p§ï¬°¤C¤Q¦æ¡C

¡]©Î¡^¥kÀ»µøµ¡¼ÐÃD¦C¡A§ïÅÜ¤º®e¡C

3. ½s¿è c:$\backslash$cygnus$\backslash$cywinb20 ¤¤ªº cygnus.bat ©M§@¥H¤U³]©w¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
set HOME=c:\cygnus\cygwinb20
bash --login
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


¤Î½s¿è ~/.bash\_profile ¥[¤W³o´X¦æ
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
set -o vi
PATH=$PATH:/usr/local/bin:/usr/bin
export PATH
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


4. ­n±Ò¥Î«ü¥O¦C¾ú¥v½s¿è¡AÁä¤J¡X

bash\$ set -o vi

¨Ï¥Î l¡Bk¡Bj¡Bh¡A§A¥i¥Î vi
«ü¥O½s¿è«ü¥O¦C¾ú¥v¡C§A¥i­«ÂÐ©M­×§ï¤§«eªº«ü¥O¡A¥H¸`¬Ù¥´¦r®É¶¡¡C

5. §A¥i¥Î¥H¤U«ü¥O±¾¤WºÏºÐ¾÷ / ¥Ø¿ý¡X

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ umount /
bash$ mount "c:\cygnus"  /
bash$ mount "c:\cygnus\cygwin-b20\postgres" /usr/local/pgsql
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


6. ¥Î¥H¤U«ü¥O¾\Åª½u¤W¨D§U°T®§¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ mount --help
bash$ ls --help
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}





\subsection{¦w¸Ë Andy Piper ¤u¨ã}

\begin{enumerate}
\item ¨ì \nameurl{ftp://ftp.xemacs.org/pub/xemacs/aux/}{} ¤U¸ü 
cygwin-b20-local.tar.bz2 ¨ì 
c:/Unix/Root ¥Ø¿ý¡C 
\item  cd c:/Unix/Root; bunzip2 cygwin-b20-local.tar.bz2 
\item  tar -xvf cygwin-b20-local.tar 
\item  cd /local/bin; sh check\_cygwin\_setup.sh 
\item  §¹¦¨²Ä¥|¨B«á¡A§A·|¬Ý¨ì¥H¤U°T®§¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
You don't have /bin would you like to mount cygwin as /bin?" 
[ y/n ]   
¿ï¡¥n¡¦¡A¨ä¥L°ÝÃD«h¿ï¡¥y¡¦¡C
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\item  mount c:/Unix/Root/cygwin-b20/H-i586-cygwin32/i586-cygwin32/bin 
/bin 
\item  cd c:/Unix/Root/cygwin-b20/H-i586-cygwin32/i586-cygwin32; mkdir 
libexec share 
man etc sbin info 
\item  cp -R /local/$\{$ bin,libexec,share,man,etc,sbin,info,include $\}$
\end{enumerate}



\subsection{¦w¸Ë Ludovic Lange ªº Cygwin32 IPC ®M¥ó}

\begin{enumerate}
\item  ¨ì \nameurl{http://www.multione.capgemini.fr/tools/pack_ipc}{} ¤U¸ü 
cygwin32\_ipc-1.03.tgz ¨ì c:/Unix/Root ¥Ø¿ý¡C
\item  tar -zxvf cygwin32\_ipc-1.03.tgz 
\item  cd cygwin32\_ipc-1.03/src and run 'make' 
\item  mkdir -p c:/usr/local/$\{$bin,include,lib,include/sys$\}$ 
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
cp /cygwin32_ipc-1.03/bin/* c:/usr/local/bin 
cp /cygwin32_ipc-1.03/include/sys/* c:/usr/local/include/sys 
cp /cygwin32_ipc-1.03/lib/* c:/usr/local/lib 
cp c:/usr/local/bin/* /bin 
cp c:/Unix/Root/cygwin-b20/H-i586-cygwin32/bin/* /bin 
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\item  mount c:/usr/local/bin /usr/local/bin 
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
mount c:/usr/local/include /usr/local/include 
mount c:/usr/local/lib /usr/local/lib 
cp /local/lib/* /usr/local/lib 
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{enumerate}



\subsection{¦w¸Ë PostgreSQL \label{installpgsql}}

\begin{enumerate}
\item  ¤U¸ü³Ì·sªº PostgreSQL ·½µ{¦¡½X
\item  Postgres §â©Ò¦³ÀÉ®×·í§@¤G¤¸ÀÉ¡A©Ò¥H·|¹J¨ì lf/cf 
°ÝÃD¡A§Ú­Ì­n°µ²Ä¤G¦Ü¤­¨B¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
mkdir -p c:/Postgres/{Source,Binary} 
mkdir c:/Postgres/Binary/pgsql 
mkdir -p /usr/src/pgsql 
mkdir -p /usr/local/pgsql 
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\item  §â Postgres ·½µ{¦¡½X«þ¨©¨ì c:/Postgres/Source ¥Ø¿ý¡A¤§«á
tar -zxvf postgresql-6.5.3.tar.gz 
\item  mv postgresql-6.5.3 pgsql 
\item  ²{¦b±¾¤W¦U­Ó¥Ø¿ý¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
mount -b c:/Postgres/Binary/pgsql /usr/local/pgsql 
mount c:/Postgres/Source/pgsql /usr/src/pgsql 
mount c:/Unix/Root/cygwin-b20/share /sw/cygwin-b20/share 
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\item  mkdir -p /usr/local/pgsql/$\{$bin,include,lib,data$\}$ 
\item  cd /usr/src/pgsql/src/win32 
\item  «þ¨©¼ÐÀYÀÉ¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
cp un.h c:/Unix/Root/cygwin-b20/H-i586-cygwin32/i586-cygwin32/include/sys 
cp endian.h c:/Unix/Root/cygwin-b20/H-i586-cygwin32/i586-cygwin32/include 
cp tcp.h c:/Unix/Root/cygwin-b20/H-i586-cygwin32/i586-cygwin32/include/netinet 
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\item  ln -s /usr/local/lib /usr/src/pgsql/src/backend/libpostgres.a 
\item  cd /usr/src/pgsql/src, ¤§«á°õ¦æ './configure' 
\item  make {$>$} make.txt 2{$>$}\&1 
\item  make install  {$>$} make.install.txt 2{$>$}\&1 
\item  cp /usr/local/pgsql/lib/pq.dll /usr/local/pgsql/bin 
\item  ¦b make install ¤§«á§A­n§â bin ©M lib ¥Ø¿ý¤¤ªº¤å¦rÀÉÂà´«¡A¥H²M°£ cr/lf 
©M eof ¤§ÃþªF¦è¡C
\item  ¦b / ¥Ø¿ý¨Ï¥Î¥ô¦ó½s¿è¾¹²£¥Í .bashrc ¦p¤U¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
PATH=$PATH:/usr/local/pgsql/bin:/usr/local/bin 
PGDATA=/usr/local/pgsql/data 
PGLIB=/usr/local/pgsql/lib 
LD_LIBRARY_PATH=/usr/local/pgsql/lib:/usr/local/lib 
export LD_LIBRARY_PATH PATH PGDATA PGLIB 
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\item  source /.bashrc, ¤§«á°õ¦æ 'initdb --username=xxxx' 
­nª`·N¸ê®Æ®w¨t²Îªº¾Ö¦³¤H¤£¥i¥H¬O root/administrator¡C
\item  ½s¿è /usr/local/pgsql/data/pg\_hba.conf ÀÉ¡A¦p¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
host        all     163.17.11.109   255.255.255.0   trust 
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\item  ipc-daemon.exe\& 
\item  postmaster -i\& 
\item  °õ¦æ ' psql -h host\_name template1'
\end{enumerate}



\section{³q«H½×¾Â}




\subsection{PostgreSQL ªº¹q¶l¤á¤f}

¥H¤U¦a¤è¨ú±o§K¶O¹q¶l
\begin{itemize}
\item  ¦b Yahoo \nameurl{http://www.yahoo.com}{} À»¿ï e-mail
\item  In Lycos \nameurl{http://www.lycos.com}{} À»¿ï new e-mail accounts
\item  In hotmail \nameurl{http://www.hotmail.com}{} À»¿ï new e-mail accounts
\end{itemize}


­q¾\ PostgreSQL ³q«H½×¾Â¡A¦Ó Yahoo ¦³¤@­Óªþ¥[¯S¦â¡A¥i¬° PostgreSQL 
¹q¶l«Ø¥ß¿W¥ßªº¥Ø¿ý¡A§K­PÂZ¶Ã§A¨ä¥Lªº¹q¶l¡C¾Ü¿ï¥Ø¿ý Email- $>$ Options- $>$ 
Filters ¤Î´z¿ï seperate folder for email¡C
§A¥i¥Î³o­Ó¹q¶l¤á¤f¦b¥@¬É¥ô¦ó¦a¤è¦¬µo¹q¶l¡A¥u­n§A¯à¤Wºô¡C

¦pªG§A¦³¨ä¥L¹q¶l¡A§A¥i¥Î¡§Mail Filters¡¨¨Ó¦Û°Ê§â PostgreSQL 
¶l¥ó©ñ¨ì¿W¥ßªº¥Ø¿ý¡A¥H§K²V¶Ã¡C


\subsection{­^¤å³q«H½×¾Â}

½Ð°Ñ¾\¥Dºô­¶ªº Mailing Lists ¶µ¥Ø¡J
\begin{itemize}
\item  \nameurl{http://www.postgresql.org/}{}
\item §â°ÝÃD¹q¶l¦Ü¡J
\onlynameurl{pgsql-questions@postgresql.org}
\item  ¶}µo¤H­û \onlynameurl{pgsql-hackers@postgresql.org}
\item  ¦³Ãö²¾´Óªº°ÝÃD \onlynameurl{pgsql-ports@postgresql.org}
\item  ¤å¥ó°ÝÃD \onlynameurl{pgsql-docs@postgresql.org}
\end{itemize}

§A·|¦b¤@¤é¤§¤º±q¹q¶l¦¬¨ìµª®×©Î¦^ÂÐ¡C

§A¤]¥i­q¾\³q°T½×¾Â¡C­n­q¾\©Î°±¤î­q¾\¡A¹q¶l¦Ü
\begin{itemize}
\item  \onlynameurl{pgsql-questions-request@postgresql.org}
\item  \onlynameurl{pgsql-hackers-request@postgresql.org}
\item  \onlynameurl{pgsql-ports-request@postgresql.org}
\item  \onlynameurl{pgsql-docs-request@postgresql.org}
\end{itemize}

°T®§ªº¥¿¤å¥u¥i¦³¤@¦æ

subscribe

¡]©Î¡^

unsubscribe


\subsection{³q«H½×¾Â¦s®w}

³q«H½×¾Â¤]¥H html ®æ¦¡¦s®w¦b¥H¤U¦a¤è¡J
\begin{itemize}
\item  ¸g MHonarc ¦A¸g WWW ªº¨C¤é¥Ø¿ý
\nameurl{http://www.postgresql.org/mhonarc/pgsql-questions}{}
\item  \nameurl{ftp://ftp.postgresql.org}{} ¥Ø¿ý /pub/majordomo
\end{itemize}

PostgreSQL ¥Dºô­¶¤¤¤]¦³¤@­Ó±M¬° pgsql °ÝÃD¦Ó³]ªº·j´M¤ÞÀº¡C


\subsection{¦è¯Z¤ú¤å³q«H½×¾Â}

¥Ø«e¦³¤@­Ó¡u«D©x¤è¡vªº¦è¯Z¤ú¤å PostgreSQL ³q«H½×¾Â¡C­n­q¾\ªº¸Ü¡A¥ÎªÌ»Ý¹q¶l¦Ü¡J
\begin{itemize}
\item  \onlynameurl{majordomo@tlali.iztacala.unam.mx}
\end{itemize}

°T®§ªº¥¿¤å¥u¥i¦³¤@¦æ

inscripcion pgsql-ayuda


\section{¤å¥ó©M°Ñ¦Ò®Ñ}




\subsection{¥Î¤á«ü¤Þ©M»¡©ú®Ñ}

PostgreSQL µo¦æª©¥»¤¤¤w¥]¬A¥H¤U¦U¶µªº postscript¡BHTML ®æ¦¡ ©M unix 
man-pages¡C¥¦­Ì¦b /usr/doc/postgresql* ¥Ø¿ý¤¤¡C¦pªG§A¯à¤Wºô¡A
§A¥i¦b¥H¤U¦a¤è§ä¨ì¤U¦C¤å¥ó¡J \nameurl{http://www.postgresql.org/docs}{}

\begin{itemize}
\item  "Installation Guide"
\item  "User Guide" for PostgreSQL
\item  "Implementation Guide" ¸Ô²Ó»¡©ú PostgreSQL ¸ê®Æ®wªº¤º³¡¹B§@
\item  ½u¤W»¡©ú®Ñ
\item  HTML ®æ¦¡ªº½u¤W»¡©ú®Ñ
\item  Postscript ®æ¦¡ªº½u¤W»¡©ú®Ñ¡A¥Î¥H¦C¦L
\end{itemize}



\subsection{½u¤W¤å¥ó}

\begin{itemize}
\item  ¤º«Ø¸ê®Æ«¬ºA©M¹Bºâ¤¸ªº¦W³æ©M¸Ñ»¡
\begin{tscreen}
\begin{verbatim}
A ¬O§_ PSQL «ü¥Oªº¤@³¡¤À
\end{verbatim}
\end{tscreen}
\item  ¤ä´©ªº SQL ÃöÁä¦r¦W³æ
\begin{tscreen}
\begin{verbatim}
¦b·½µ{¦¡ /tools ¥Ø¿ý¤¤¦³¤@­Ó©R¥O½Z (script)
\end{verbatim}
\end{tscreen}
\item  ¤ä´©ªº¥y»y¦W³æ
\begin{tscreen}
\begin{verbatim}
¨Ï¥Î psql \h «ü¥O
\end{verbatim}
\end{tscreen}
\item  PostgreSQL ªº°ò¥»ªºÃöÁp¦¡¸ê®Æ®w·§©À¡]¹ê¬I¤èªk¡^©M¼Æ­Ó½u¤W¨Ò¤l¡]¬d¸ß¡^
\begin{tscreen}
\begin{verbatim}
¬Ý src/test ¤¤ªº regression ´ú¸Õ¡A½Ð°Ñ¾\ <ref name="¨Ò¤l RPM" 
id="Examples RPM">¡C§A·|§ä¨ì regress/sql ©M suite/*.sql ¥Ø¿ý¡C
\end{verbatim}
\end{tscreen}
\item  PostgreSQL «ü¾É
\begin{tscreen}
\begin{verbatim}
SQL «ü¾É½Z¥ó¦b src/tutorial ¥Ø¿ý¤¤
\end{verbatim}
\end{tscreen}

¤]½Ð°Ñ¾\¥»¤å¥óªþ¿ý¤A \ref{Appendix B} {(ªþ¿ý¤A)} ªº¡§ªì¾ÇªÌ SQL «ü¾É¡¨¡C
\end{itemize}



\subsection{¦³¥Îªº°Ñ¦Ò®Ñ}

\begin{itemize}
\item  "Understanding the New SQL: A Complete Guide" - Jim Melton ©M 
Alan R.Simon µÛ
\begin{tscreen}
\begin{verbatim}
Morgan Kaufman Publisher ¬O¨ä¤¤¤@¥»³Ì¦nªº SQL ®Ñ¡C³o¥»®Ñ¥H SQL92 ¬°·Ç¡C
\end{verbatim}
\end{tscreen}
\item  "A Guide to THE SQL STANDARD" - C.J.Date µÛ
\begin{tscreen}
\begin{verbatim}

Addison-Wesley Publishing company ¤]¬O¤@¥»¦n®Ñ¡C¦³Ãö SQL ªº¦W§@¡C
\end{verbatim}
\end{tscreen}
\item SQL - The Standard Handbook,  ¤@¤E¤E¤G¦~¤Q¤@¤ë
\begin{tscreen}
\begin{verbatim}
Stephen Cannan ©M Gerard Otten
McGraw-Hill Book Company Europe , Berkshire, SL6 2QL, England
\end{verbatim}
\end{tscreen}
\item SQL Instant Reference, 1993
\begin{tscreen}
\begin{verbatim}
Martin Gruber, Technical Editor: Joe Celko
SYBEX Inc.  2021 Challenger Drive Alameda, CA 94501
\end{verbatim}
\end{tscreen}
\item  C.J.Date, "An introduction to Database Systems"
(²Ä¤»ª©), Addison-Wesley, 1995, ISBN 0-201-82458-2
\begin{tscreen}
\begin{verbatim}
³o¥»¬O¸ê®Æ®wºÞ²z¨t²Îªº¸t¸g¡C³o¥»®Ñ¸Ô²Ó»¡©ú¥¿³W¤Æ (normalization)¡BSQL¡B«ì´_ 
(recovery)¡B¨Ã¦æ©Ê (concurrency)¡B«O¦w¡B¾ã¦X©Ê (integrity)¡B
¹ï­ì¥»ªºÃöÁp¼Ò¦¡ªº©µ¦ù¡B²{¤µªº¸ÜÃD¦p¥D±q¨t²Î©Mª«¥ó¾É¦V¼Ò¦¡¡C
¤]¥]¬A¤j¶q°Ñ¦Ò¸ê®Æ¥H¨Ñ²`¤J¬ã¨s¡C¦V¤j³¡¤À¥Î¤á±ÀÂË¡C
\end{verbatim}
\end{tscreen}
\item  Stefan Stanczyk, "Theory and Practice of Relational Databases",
UCL Press Ltd, 1990, ISBN 1-857-28232-9
\begin{tscreen}
\begin{verbatim}
³o¥»®Ñ¸Ô²Ó»¡©úÃöÁp¦¡¸ê®Æ®w¡BÃö«Y¥N¼Æ (relational algebra)¡BÃö«Yºtºâ (calculus)
©M¥¿³W¤Æªº²z½×¡C¦ý¥¦¤£¥]§t²{¹ê¥@¬Éªº°ÝÃD©M¸û½ÆÂøªº¨Ò¤l¡C¦V¤j³¡¤À¥Î¤á±ÀÂË¡C
\end{verbatim}
\end{tscreen}
\item "The Practical SQL Handbook" ²Ä¤Tª©¡A
Addison Wesley Developers Press
ISBN 0-201-44787-8
\begin{tscreen}
\begin{verbatim}
¦V¤j³¡¤À¥Î¤á±ÀÂË¡C
\end{verbatim}
\end{tscreen}
\item  Michael Stonebraker, "Readings in Database Systems",
Morgan Kaufmann, 1988, ISBN 0-934613-65-6
\begin{tscreen}
\begin{verbatim}
³o¬O¹L¥h¼Æ¦~¦³Ãö¸ê®Æ®wªº½×¤å¶°¡C¥¦¤£¬Oµ¹¤@¯ë¥ÎªÌ¬Ý¡A¦Ó¬O¶i¶¥ªº¾Ç¥Í¡]¬ã¨s¥Í¡^
©Î¸ê®Æ®w¶}µo¤H­û¡C
\end{verbatim}
\end{tscreen}
\item  C.J.Date, "Relational Database - Selected Readings",
Addison-Wesley, 1986, ISBN 0-201-14196-5
\begin{tscreen}
\begin{verbatim}
³o¬O¹L¥h¼Æ¦~¦³Ãö¸ê®Æ®wªº½×¤å¶°¡C¥¦¤£¬Oµ¹¤@¯ë¥ÎªÌ¬Ý¡A¦Ó¬O¶i¶¥ªº¾Ç¥Í¡]¬ã¨s¥Í¡^
©Î¸ê®Æ®w¶}µo¤H­û¡C
\end{verbatim}
\end{tscreen}
\item  Nick Ryan ©M Dan Smith, "Database Systems Engineering",
International Thomson Computer Press, 1995, ISBN 1-85032-115-9
\begin{tscreen}
\begin{verbatim}
³o¥»®Ñ²`¤J»¡©ú¦s¨ú¤èªk©MÀx¦s§Þ¦Ò¡C
\end{verbatim}
\end{tscreen}
\item  Bipin C. Desai, "An introduction to Database Systems",
West Publishing Co., 1990, ISBN 0-314-66771-7
\begin{tscreen}
\begin{verbatim}
¥¦¤£¬Oµ¹¤@¯ë¥ÎªÌ¬Ý¡A¦Ó¬O¶i¶¥ªº¾Ç¥Í¡]¬ã¨s¥Í¡^©Î¸ê®Æ®w¶}µo¤H­û¡C
\end{verbatim}
\end{tscreen}
\item  Joe Celko "INSTANT SQL Programming"
\begin{tscreen}
\begin{verbatim}
Wrox Press Ltd.
Unit 16, 20 James Road, Tyseley
Birmingham, B11 2BA, England
1995
\end{verbatim}
\end{tscreen}
\item  Michael Gorman "Database Management Systems: Understanding and 
Applying Database"
\begin{tscreen}
\begin{verbatim}
Technology
QED and John Wiley
1991
\end{verbatim}
\end{tscreen}
\item  Michael Gorman "Enterprise Database for a Client/Server Environment"
QED and John Wiley
\begin{tscreen}
\begin{verbatim}
»¡©ú«Ø¥ß¸g¥Ñ repository metamodels ªº¥D±q¸ê®Æ®wÀ³¥Îµ{¦¡ªº­n¨D©M ANSI
¼Ð·Ç SQL 1993 ªºÀ³¥Î¡C
\end{verbatim}
\end{tscreen}
\end{itemize}


ÁÙ¦³¼Æ¥H¦Ê­p¦³Ãö SQL ªº®Ñ¡I¨ì®Ñ©±¬Ý¬Ý§a¡C


\subsection{ANSI/ISO SQL ³W®æ¤å¥ó¡XSQL 1992, SQL 1998}

ANSI/ISO SQL ³W®æ¤å¥ó¥i¦b¤U¦Cºô¯¸§ä¨ì¡J
\begin{itemize}
\item  \nameurl{http://www.naiua.org/std-orgs.html}{}
\item  \nameurl{http://www.ansi.org/docs}{} ´w°ÊÀÉ®× cat\_c.html 
¤Î´M§ä¡§Database SQL¡¨¡C
\item  SQL92 ¼Ð·Ç \nameurl{http://www.jcc.com}{} ´w°ÊÀÉ®× sql\_stnd.html¡C
\item  ANSI/ISO SQL ³W®æ \nameurl{http://www.contrib.andrew.cmu.edu/~shadow/sql.html}{} 
§A·|¦b¦¹§ä¨ì SQL ªº°Ñ¦Ò¸ê®Æ¡C
\end{itemize}



\subsection{ANSI/ISO SQL 1992 ªº»yªk}

½Ð°Ñ¾\¥»¤å¥óªºªþ¿ý¥Ò \ref{Appendix A} {(ªþ¿ý¥Ò)}


\subsection{ANSI/ISO SQL 1998 ªº»yªk}

SQL 1998 (SQL 3) ³W®æ¤´¦b¶}µo¤¤¡C°Ñ¬Ý¥»¤å¥óªº¡§¹q¤l³~®|¨ú±o SQL3 ¯ó®×¡¨
\ref{SQL 1998} {()}


\subsection{ªì¾ÇªÌ SQL ¾É¤Þ}

°Ñ¬Ý¥»¤åªþ¿ý¤A \ref{Appendix B} {()}


\subsection{SQL92 ªº®ÉºA©µ¦ù (Temporal Extension)}

\begin{itemize}
\item SQL92 ªº®ÉºA©µ¦ùªº¤å¥ó
\nameurl{ftp://FTP.cs.arizona.edu/tsql/tsql2/}{}
\item Temporal SQL-3 ³W®æ
\nameurl{ftp://FTP.cs.arizona.edu/tsql/tsql2/sql3/}{}
\end{itemize}


³o¥Ø¿ý¤¤¥]¬A¤@­Ó SQL-92 »y¨¥³W®æªº®ÉºA©µ¦ù¡C³oºØ·s»y¨¥³Q¦W¬° TSQL2¡C

³o¸Ìªº»y¨¥³W®æ¬O³o»y¨¥ªº³Ì²×ª©¥»¡C

¥iª½±µÁpµ¸ TSQL2 ³]­p©e­û·|ªº¥D®u¡JRichard T.Snodgrass, 
Department of Computer Science, University of Arizona, Tucson, AZ 85721,
\begin{itemize}
\item        \onlynameurl{rts@cs.arizona.edu}
\end{itemize}

TSQL2 Language Design Committee ªº¹q¶l¦a§}©M¤J·|¸Ô±¡¥i¦b»y¨¥³W®æ³Ì«áªº
¤@³¹§ä¨ì¡C

³o¥Ø¿ý¤¤ªº¤º®e¦p¤U¡C

spec.dvi,.ps    TSQL2 »y¨¥³W®æ¡A¤@¤E¤E¥|¦~¤E¤ë¥Xª©

bookspec.ps     TSQL2 »y¨¥³W®æ¡A¤º®e¦p¦b TSQL2 ªº®Ñ¯ë¡A¤@¤E¤E¤­¦~¤Q¤ë
¥Xª©¡]½Ð°Ñ¾\¤U¤å¡^

sql3            ´£¥æµ¹ ANSI ©M ISO SQL3 Äw©e·|ªº­×­q«ØÄ³

©M»y¨¥³W®æ¤@°_¡A³o¸ÌÁÙ¦¬¶°¤F¤@¨Ç¦³Ãö³]­p¤Wªº¨M©wªºµû½×¡B´£¨Ñ¨Ò¤l¡B
©M¬ã¨s¦p¦ó¹ê½î³o»y¨¥¡C³o¨Çµû½×­ì¥»¬Oµ¹ TSQL2 Language Design Committee 
ªº«ØÄ³¡C¥¦­Ì²{¦b¦³¥t¤@­Ó¥Î³B¡J´£¨Ñ¦³Ãö TSQL2 ºc³yªº¨Ò¤l¡B
±À°Ê³]­p®É§@¥Xªº¤j¶q¨M©w¡B¤ñ¸û TSQL2 ©M¹L¥h¤Q¤­¦~¦³¤H´£Ä³¹Lªº¤j¶q»y¨¥¡C
¥²¶·±j½Õ¡A½Ð¨Çµû½×¥Ø«e¤£¬O TSQL2 »y¨¥³W®æªº¤@³¡¤À¡A¦Ó¬O¹ï¥¦ªº¸É¥R©Mµo®i¡C
³o»y¨¥³W®æ¤w¬O TSQL2 ªº³Ì²×¨M©w¡C

³o¨Çµû½×¡A¥[¤W»y¨¥³W®æ¡B¼Æ­Ó¯Á¤Þ©M¨ä¥L¤ä´©§÷®Æ¡A¤w¸g¶°µ²¦¨®Ñ¡J

Snodgrass, R.T., editor, The TSQL2 Temporal Query Language, Kluwer
Academic Publishers, 1995, 674+xxiv ­¶¡C

®Ñ¤¤¦³¤@­Ó¸`¿ý¤Fªºµû»ù¡A§¹¾ãªºµû»ù¦b¦¹¥Ø¿ý¤¤ªº eval.ps ´£¨Ñ¡C

tl2tsql2.pl ÀÉ¬O¤@­Ó§âÀò±µ¨üªº®ÉºAÅÞ¿è (temporal logic) Â½Ä¶¬° TSQL2 ªº 
prolog µ{¦¡¡C³oµ{¦¡¥Ñ Michael Boehlen ¼g¦¨¡C
\begin{itemize}
\item        \onlynameurl{boehlen@iesd.auc.dk}
\end{itemize}

¦U¦ì¥i±µÄ²¥L¥H¨ú±o¤@¥÷¸ÑÄÀ³oÂ½Ä¶¹Lµ{ªº½×¤å¡C³o¬O³oµ{¦¡ªºÂÂª©¥»¡C·sª©¥»¦b
\begin{itemize}
\item  \nameurl{http://www.cs.auc.dk/general/DBS/tdb/TimeCenter/Software}{}
\end{itemize}

(the TimeDB and Tiger systems).


\subsection{²Ä¹s³¡¤À¡X¨ú±o ISO/ANSI SQL ¤å¥ó \label{SQL 1998}}

³o¤å³¹»¡©ú¦p¦ó¡]¦Xªk¦a¡^¨ú±o¤@¥÷ SQL-92 ¼Ð·Ç©M«ç¼Ë¨ú±o¤@¥÷¡§²{®Éªº¡¨SQL3 ¯ó®×¡C

³o¼Ð·Çª©Åv©Ò¦³¡A ANSI ¼Ð·Çªº«ù¦³¤H¬° ANSI¡AISO ¼Ð·Çªº«ù¦³¤H¬° ISO¡C

²{®É¦³¨â¡]2¡^­Ó SQL ¼Ð·Ç¡A¤À§O¥Ñ ANSI ©M ISO ¥Xª©¡C³o¨â¥÷¼Ð·Ç¨C­Ó¦r³£¤@¼Ò¤@¼Ë¡A
°£¤F¤@¨Ç¤p¸`¡A¦p¤å¥ó¼ÐÃD¡B­¶­º¡Bµu¥y¡§International Standard¡¨©M¡§American 
Standard¡¨¤§Ãþ¡C



ÁÊ¶R SQL-92 ¼Ð·Ç

The ISO standard, ISO/IEC 9075:1992, Information Technology - Database
Languages - SQL¡A¥Ø«e¡]¤@¤E¤E¤T¦~¤T¤ë¡^¦b ANSI ¦³¦s³f¤Î¥i±o¨ì¡J
\begin{tscreen}
\begin{verbatim}
     American National Standards Institute
     1430 Broadway
     New York, NY 10018 (USA)
     Phone (sales): +1.212.642.4900
\end{verbatim}
\end{tscreen}

»ù¿ú US\$230.00¡CANSI ª©¡AANSI X3.135-1992, American National Standard for 
Information Systems - Database Language SQL¡A¥Ø«e¨ÃµL¦s³f¡A
¦ýÀ³¸Ó¥i¦b¤@¤E¤E¤T¦~¤T¤ë¤U¦¯¦Ü¤­¤ë¤W¦¯¶¡±o¨ì¡C¦ô­p¥¦ªº»ù¿ú¬O US\$225.00¡C

¦pªG§A±q ANSI ÁÊ¶R¥ô¦ó¤@¥÷¤å¥ó¡A§A»Ý­nµ¹ 7\% ªº¤âÄò¶O¡]§Y¤j¬ù 
US\$9.10¡^¡C®ü¥~¶l±HªÖ©w·|§ó¶Q¡CANSI ­n¨D©Ò¦³³æ¾Ú³£¦ñÀH¤@¥÷¤½¥q­q³æªº½Æ¦L¥»¡A
©ÎªÌ§A¥i¥H¬ü¤¸±H¤@±i¬ü°êªº»È¦æªº¤ä²¼¡A¥L­Ì·|¦bµ²¤F½ã«á±Hµ¹§A¡C
¡]¨Ò¥~±¡ªp¡J¦pªG§Aªº²ÕÂ´¬O ANSI ªº¤½¥q·|­û (corporate member)¡AANSI 
·|§â¤å¥ó±Hµ¹§A¦Ó¦V¤½¥q¦¬¿ú¡C¡^

¦b¬ü°ê°ê¥~¡AISO ¼Ð·Ç¤]¥i±q§@¬° ISO (International Organization for 
Standardization) ©Î IEC (International Electrotechnical Commission) 
·|­ûªº¥»¤g°êÀç¾÷ºc¡]°ê®aªº¼Ð·Ç²ÕÂ´¡^ÁÊ¶R¡C°êÀç¾÷ºc¤Î¨ä¦a§}ªº¦W³æ¥i±q ANSI 
©Î¨ä¥L°êÀç¾÷ºc¨ú±o¡C¥¦­Ì¤]¥i±q ISO ±o¨ì¡J
\begin{tscreen}
\begin{verbatim}
     International Organization for Standardization
     Central Secretariat
     1, rue de Varembi
     CH-1211 Genhve 20
     Switzerland
\end{verbatim}
\end{tscreen}

¦pªG§A·Q¥H§ó¤è«K§Ö±¶ªº¤èªk­qÁÊ³o¼Ð·Ç¡A§A»Ý­nªþ¥X¥N»ù¡C§A¥i±q¥H¤U²ÕÂ´¥H 
US\$308.00 ­qÁÊ ISO/IEC 9075:1992, Information Technology - 
Database Languages - SQL¡J
\begin{tscreen}
\begin{verbatim}
     Global Engineering Documents
     2805 McGaw Ave
     Irvine, CA 92714 (USA)
     USA
     Phone (works from anywhere): +1.714.261.1455
     Phone (only in the USA): (800)854-7179
\end{verbatim}
\end{tscreen}

§Ú¤£ª¾¹D³o¬O§_¥]¬A³f¹B¶O¡A¦ý§Ú¦ô­p¡]°_½X¡^°ê»Ú³f¹B·|ÃB¥~¦¬¶O¡C
¥L­Ì·|»á¬°§Ö±¶¦a§â¤å¥ó±Hµ¹§A¡A¬Æ¦Ü·|±µ¨ü¡§¥D­nªº«H¥Î¥d¡¨¡CGlobal ÁÙ¨S¦³ ANSI 
ª©¡A©Î¥L­Ì¨S¦³»ù¿ú©Î¦ô­p®É¶¡¡]¦ý§Ú¹w­p¥¦·|¦b ANSI ¥Xª©«á¼Æ¶g¤§¤º¥X²{¡A»ù¿ú±µªñ 
US\$300.00¡^¡C



ÁÊ¶R¤@¥÷ SQL3 ¯ó®× (Working Draft)

§A¥i±q ANSI X3 Secretariat, CBEMA (Computer and Business Equipment Manufacturers
Association) ÁÊ¶R¤@¥÷ SQL3 ¯ó®×ªº½Æ¦L¥»¡C¥L­Ì·N¹Ï½T«O¯à´£¨Ñ¡§³Ìªñ¡¨ª©¥»ªº 
SQL3 ¯ó®×¡A¨Ã¥H US\$60.00 ¦Ü US\$65.00 ¥X°â¡C§A¥i¥H¥H¤U³~®|±µÄ² CBEMA¡C
\begin{tscreen}
\begin{verbatim}
     CBEMA, X3 Secretariat
     Attn: Lynn Barra
     1250 Eye St.
     Suite 200
     Washington, DC 20005 (USA)
\end{verbatim}
\end{tscreen}

Lynn Barra ¤]¥i¥H¹q¸Ü¸¹½X +1.202.626.5738 ±µÄ²¥H­n¨D¤@¥÷¡A¤£¹L¶l±H¦ü¥G¸û¦³Â§»ª¡C

¹q¤l®|¨ú±o SQL3 ¯ó®×

³Ì·sª©¥»¡]¥H¼g¥»¤å®É¬°·Ç¡^ªº SQL3¡]ANSI ©M ISO¡^¯ó®×¡]©M©Ò¦³ªþ¥ó¡^
¥i¦b¥H¤U¯¸¥x¥H¡§anonymous ftp¡¨©Î¡§ftpmail¡¨±o¨ì¡J
\begin{tscreen}
\begin{verbatim}
     gatekeeper.dec.com

  ¦b

     /pub/standards/sql/
\end{verbatim}
\end{tscreen}

³o¥Ø¿ý¤¤¦³¦h­ÓÀÉ®×¡A¥]¬A PostScript ÀÉ©M¯Â¤å¦rÀÉ¡]®æ¦¡¤£«Ü¬üÆ[¡A
¦ý¥i¦b¿Ã¹õ¤WµL¶·¯S§O³n¥ó¾\Åª¡^¡C

¤@¯ë¨Ó»¡¡A§A¥i§ä¨ìÃþ¦ü¦WºÙªºÀÉ®×¡J
\begin{tscreen}
\begin{verbatim}
     sql-bindings-mar94.ps
     sql-bindings-mar94.txt
     sql-cli-mar94.ps
     sql-cli-mar94.txt
     sql-foundation-mar94.ps
     sql-foundation-mar94.txt
     sql-framework-mar94.ps
     sql-framework-mar94.txt
     sql-psm-mar94.ps
     sql-psm-mar94.txt
\end{verbatim}
\end{tscreen}

§¹¦¨·sª©¥»ªº¤å¥ó«á¡A¡§mar94¡¨·|§ïÅÜ¨Ó»¡©ú·sªº¥Xª©¤é´Á¡]¨Ò¦p¡§aug94¡¨¬O¦ô­p¦b
¡§mar94¡¨¤§«áªºª©¥»¡^¡C

¥t¥~¡A¬°·ÓÅU¤£¯à±q FTP ¨ú±oÀÉ®×¦W³æªºÅªªÌ¡A§Ú­Ì¦b¥Ø¿ý¤¤©ñ¸m¤F¤@­Ó¦W¬°
\begin{tscreen}
\begin{verbatim}
     ls
\end{verbatim}
\end{tscreen}

ªºÀÉ®×¡C³oÀÉ®×¡]¯«©_¡I¡^¥]¬A¤F¥Ø¿ý¤ºªºÀÉ®×¦W³æ¡C



±q Ftp ª½±µÀò±oÀÉ®×

³o¬O¨Ï¥Î FTP ªº¨Ò¤l¡C¥¦¯S§O»¡©ú¦p¦ó³s±µ¨ì gatekeeper.dec.com¡A
¨ì¹F©ñ¸m³o¨ÇÀÉ®×ªº¥Ø¿ý¡A¤Î§âÀÉ®×¶Ç°e¨ì§Aªº¹q¸£¡C­nª`·Nªºªº¹q¸£­n¦³¤Wºô¥\¯à¡C
Ã±¤J¦WºÙ¬O¡¥ftp¡¦¡A±K½X«h¬O§Aªº¹q¶l¦a§}¡]§Y©Ò¿×¡¥anonymous ftp¡¦¡^¡C«ü¥O¡¥type 
binary¡¦¬O¥Î¨Ó½T«O¦¬¨ìªºÀÉ®×¤¤¨S¦³¦ì¤¸³QºI¥h¡C¡¥get¡¦¤@¦¸¨ú±o¤@­ÓÀÉ®×¡C
¦b©R¥O½Z (script) ¤¤ªºª`¸Ñ·|¦b¨¤¬A¸¹¤º $<$ §Y¬O¦p¦¹ $>$¡C
\begin{tscreen}
\begin{verbatim}
  % ftp gatekeeper.dec.com
  Connected to gatekeeper.dec.com.
  220- *** /etc/motd.ftp ***
       Gatekeeper.DEC.COM is an unsupported service of DEC Corporate Research.
       <¡Kµ¥¤@·|¡K>
  220 gatekeeper.dec.com FTP server (Version 5.83 Sat ... 1992) ready.
  Name (gatekeeper.dec.com:<§Aªºµn¤J¦WºÙ>): ftp  <anonymous ¤]¥i>
  331 Guest login ok, send ident as password.
  Password: <Áä¤J§Aªº¹q¶l¦a§}>
  230 Guest login ok, access restrictions apply.
  Remote system type is UNIX.  <¤°»ò¤]¨S©Ò¿×>
  Using binary mode to transfer files.
  ftp> cd pub/standards/sql
  250 CWD command successful.
  ftp> dir
  200 PORT command successful.
  150 Opening ASCII mode data connection for /bin/ls.
  total 9529
  -r--r--r--  1 root     system     357782 Feb 25 10:18 x3h2-93-081.ps
  -r--r--r--  1 root     system     158782 Feb 25 10:19 x3h2-93-081.txt
  -r--r--r--  1 root     system     195202 Feb 25 10:20 x3h2-93-082.ps
  -r--r--r--  1 root     system      90900 Feb 25 10:20 x3h2-93-082.txt
  -r--r--r--  1 root     system    5856284 Feb 25 09:55 x3h2-93-091.ps
  -r--r--r--  1 root     system    3043687 Feb 25 09:57 x3h2-93-091.txt
  226 Transfer complete.
  ftp> type binary
  200 Type set to I.
  ftp> get x3h2-93-082.txt
  200 PORT command successful.
  150 Opening BINARY mode data connection for x3h2-93-082.txt (90900 bytes).
  226 Transfer complete.
  90900 bytes received in 0.53 seconds (166.11 Kbytes/s)
  ftp> quit
  % <³oÀÉ®×¤w¦¨¬°§Aªº¹q¸£¤¤ªº x3h2-93-082.txt>
\end{verbatim}
\end{tscreen}

¨S¦³ ftp ¤ä´©ªº±¡ªp¤U¨ú±oÀÉ®×

Digital Equipment Corporation ©M¼Æ¶¡¨ä¥L¤½¥q¬Û¦ü¡A´£¨Ñ ftp email 
ªA°È¡C¥¦¥i¯à»Ý­n¼Æ¤Ñ¤~¦³¦^À³¡A¦ý¥¦¬°¤£¯àª½±µ¤Wºôªº¤H´£¨Ñ¤Fµ¥¦P ftp 
ªºªA°È¡C¦øªA¾¹ªº¦a§}¬°¡J

ftpmail@decwrl.dec.com

¥H¤U©R¥O½Z·|¨ú±o³Ì·sª©¥»ªº SQL3 ¤å¥óªº PostScript ª©¡J
\begin{tscreen}
\begin{verbatim}
     reply joe.programmer@imaginary-corp.com
     connect gatekeeper.dec.com anonymous
     binary
     compress
     uuencode
     chdir /pub/standards/sql
     get x3h2-93-091.ps
     quit
\end{verbatim}
\end{tscreen}

²Ä¤@¥y«ü¥O§i¶D¦øªA¾¹­n§âÀÉ®×¶Çµ¹§A¡A§A»Ý­n§â
¡§joe.programmer@imaginary-corp.com¡¨´«¬°§Aªº¹q¶l¦a§}¡C³o¨Ò¤l¤¤ªºÀÉ®× 
x3h2-93-091.ps ·|¥H uuencode ¤Fªº compress ÀÉ®æ¦¡¡A¤À¦¨¤T¤Q¥|«Ê¹q¶l¦^ÂÐ¡C
¦pªG§AªºÀô¹Ò¨S¦³´£¨Ñ­«²ÕÀÉ®×ªº¤u¨ã¡A§A»Ý­n¥Î¤U¦C©R¥O½Z¥H¯Â¤å¦r¼Ò¦¡¨ú±oÀÉ®×¡J
\begin{tscreen}
\begin{verbatim}
     reply joe.programmer@imaginary-corp.com
     connect gatekeeper.dec.com anonymous
     chdir /pub/standards/sql
     get x3h2-93-091.ps
     quit
\end{verbatim}
\end{tscreen}

¦ý½Ðª`·N¡A³o .ps ÀÉ¤j·§·|³Q¤À¬°¶W¹L¤C¤Q¥÷¨Ó¦^ÂÐ¡I

­n¨ú±o¥ô¦ó¤£¬O x3h2-93-091.ps ªºÀÉ®×¡A¥u»Ý§â¡§x3h2-93-091.ps¡¨
´«¬°§A·Q­nªºÀÉ®×ªº¦WºÙ¡C­n¨ú±o©Ò¦³ÀÉ®×ªº¦W³æ¡A§â¡§x3h2-93-091.ps¡¨´«¬°
¡§dir¡¨¡C


\subsection{²Ä¤@³¡¤À¡XISO/ANSI SQL ·í«e±¡ªp}

³o³¹¬O¦³Ãö SQL ¼Ð·Ç©M¨ä·í«e±¡ªpªº¸ê®Æ¨Ó·½¡C

·í«e±¡ªp¡J

¥Ø«e¥¿¦b¶i¦æ¶}µo¤u§@¡A¥H§ï¶i SQL ¬°¬°­pºâ¤W§¹¾ãªº»y¨¥ (computationally 
complete language)¡A¥H¥i¥Î©ó«ù¤[¡B½ÆÂøªºª«¥ó¡C³o¥]¬A¡J¤@¯ë¤Æ©M±Mªù¤Æµ¥¯Å 
(generalization and specialization hierarchies)¡B¦h¯ÅÄ~©Ó (multiple 
inheritance)¡B¦Û­q¸ê®Æ§ÎºA¡B¿Eµo (triggers) ©M§PÂ_ 
(assertions)¡Bª¾ÃÑ®w¨t²Î¤ä´© (support for knowledge based systems)¡B°j»¼¬d¸ß¦¡ 
(recursive query expression) ©Mªþ¥[¸ê®ÆºÞ²z¤u¨ã¡C¥¦¤]¥]¬A©â¶H¸ê®Æ«¬ºA 
(ADTs)¡Bª«¥óÃÑ§O¦r (object identifiers)¡B¤èªk (methods)¡BÄ~©Ó 
(inheritance)¡B¦h«¬ (polymorphism)¡B¥]¸Ë (encapsulation)¡B
©M©Ò¦³¨ä¥L»Pª«¥ó¸ê®ÆºÞ²z¦³Ãöªº¥\¯àªº³W®æ¡C

¤@¤E¤E¤»¦~¬î©u¡ASQL3 ¼Æ­Ó³¡¤À¶i¦æ¤F¤@¦¸ ISO CD ¤£°O¦W§ë²¼¡C³o¼Æ³¡¤À¬O 
SQL/Framework¡BSQL/Foundation ©M SQL/Bindings¡C¤@¦p©Ò®Æ¡A
§ë²¼µ²ªG¬O¦b¦¬¨ì¬ù¤E¦Ê­Óµû½×¤U¾D§_¨M¡C¤@¤ë¤U¦¯Á|¦æ¤F¤@¦¸ ISO DBL ½s¿è·|Ä³ 
(editing meeting)¡A³B²z¤F¤j¶q¦bµû½×¤¤´£¤Î©Î¥t¥~´£¥æªº°ÝÃD¸Ñ¨M¤èªk¡C
¥Ñ©ó¸Ó¦¸·|Ä³¥¼¯à³B²z©Ò¦³µû½×¡A·|Ä³±N·|©µªø¡C
½s¿è·|Ä³©w©ó¤@¤E¤E¤C¦~¤C¤ë¦b­Û´°§¹¦¨¡C

¾Ú¦ô­p¡A¦b¤C¤ëªº½s¿è·|Ä³¤§«á¡A·|¦A´£¥X¹ï¦³Ãö¨º¨Ç³¡¤Àªº SQL ¶i¦æ³Ì«áªº CD 
§ë²¼¡C³Ì«á CD ¹Lµ{·|ªá¤j¬ù¤»­Ó¤ë¡A¤§«á·|¦³ DBL ½s¿è·|Ä³¡BDIS §ë²¼©M§Ö±¶ªº 
IS §ë²¼¡C

ISO ªºµ{§Ç¦b SQL/92 ¤§«á§ïÅÜ¤F¡A©Ò¥H SQL ©e­û·|¤´¦bºN¯Á³o¹Lµ{ªº¸Ô±¡¡C

¦pªG¨Æ¨Æ¶¶§Q¡ASQL3 ªº³o¨Ç³¡¤À·|¦b 1998 ¦~«á´Á¦¨¬°©x¤è ISO/IEC 
¼Ð·Ç¡A¤£¹L®É¶¡«D±`ºò­¢¡C

¦b¤@¤E¤E¤T¦~¡AANSI ©M ISO ¶}µo©e­û·|¨M©w§â¤§«áªº SQL 
µo®i¤À¬°¦h³¡¤Àªº¼Ð·Ç¡C³o¨Ç³¡¤À¥]¬A¡J

\begin{itemize}
\item    Part 1: Framework A non-technical description of how the document is
structured.
\item    Part 2: Foundation The core specification, including all of the new ADT
features.
\item    Part 3: SQL/CLI The Call Level Interface.
\item    Part 4: SQL/PSM The stored procedures specification, including
computational completeness.
\item    Part 5: SQL/Bindings The Dynamic SQL and Embedded SQL bindings taken
from SQL-92.
\item    Part 6: SQL/XA An SQL specialization of the popular XA Interface
developed by X/Open
\item    Part 7:SQL/TemporalAdds time related capabilities to the SQL standards.
\end{itemize}


¦b¬ü°ê¡ASQL3 ªº¾ãÅé¦P®É·í§@ ANSI ¥»¤g (Domestic, "D") ±M®×©M ISO 
±M®×³B²z¡C¥Ø«e¦ô­p§¹¦¨®É¶¡¬O¤@¤E¤E¤E¦~¡C

SQL/CLI ©M SQL/PSM ²{¥¿¥H³Ì°ª³t«×³B²z¡A¥H§@¬° SQL-92 ªº­×­q¡C¦b¬ü°ê¡A
¥¦­Ì¥u³Q·í§@°ê»Ú (International, "I") ±M®×³B²z¡C SQL/CLI 
¦b¤@¤E¤E¤­¦~§¹¦¨¤F¡CSQL/PSM À³¸Ó·|¦b 1996 ¦~¥¼¬q§¹¦¨¡C

°£¤F SQL3 ¥~¡AÁÙ¦³¤@¨Çªþ¥[ªº­p¹º¡J

\begin{itemize}
\item    SQL/MM An ongoing effort to define standard multi-media packages using
the SQL3 ADT capabilities.
\item    Remote Data Access (RDA)
\end{itemize}


¼Ð·Ç©e­û·|©M¹Lµ{ (Standards Committee and Process)

¨Æ¹ê¤W¡A¥@¤W¦³¦h­Ó SQL ¼Ð·Ç©e­û·|¡CISO ¦³¤@³¡¤À¬O¤@­Ó°ê»Ú SQL 
¼Ð·Ç¤p²Õ¡C¦h­Ó°ê®a³£¦³¥H SQL ¬°­«ÂIªº©e­û·|¡C³o¨Ç°ê®a¡]³q±`¡^¬£¥X¥Nªí°Ñ»P 
ISO/IEC JTC1/SC 21/WG3 DBL ·|Ä³¡C¥D°Ê°Ñ»P ISO SQL ¼Ð·Ç¨î©wªº°ê®a¬O¡J

\begin{itemize}
\item    ¿D¬w
\item    ¤Ú¦è
\item    ¥[®³¤j
\item    ªk°ê
\item    ¼w°ê
\item    ¤é¥»
\item    Áú°ê
\item    ²üÄõ
\item    ­^°ê
\item    ¬ü°ê
\end{itemize}


NIST ½T»{ (NIST Validation)

¦b¬ü°ê¡ASQL ¹ê½îªº½T»{¤u§@¥Ñ National Institute of Standards and Training 
(NIST) ¶i¦æ¡CNIST ¥Ø«e¦³¤@®M¤Jªù¯Å (entry level) SQL-92 ªº´ú¸Õ®M¥ó¡CNIST 
½T»{­n¨Dªº¸Ô±¡³Q©w¸q¬°¤@¶µ Federal Information Processing Standard 
(FIPS)¡C¥Ø«e¹ï SQL ªº­n¨D©w¸q©ó FIPS 127-2¡C¥»¤å¥óªº Postscript ©M¤å¦r¼Ò¦¡¥i±q 
NIST ¨ú±o¡C¥Ø«e³q¹L SQL ½T»{ªº²£«~¦W³æ¤]¥i¦b NIST ¨ú±o¡C

¼Ð·Ç SQL ¥Zª«©M¤å¥ó (Standard SQL Publications and Articles)

SQL ¼Ð·Ç¦³¨â­Óª©¥»¡C¨â­Ó³£¥i±q ANSI ¨ú±o¡J

\begin{itemize}
\item    ISO/IEC 9075:1992, "Information Technology --- Database Languages ---
SQL"
\item    ANSI X3.135-1992, "Database Language SQL"
\end{itemize}


°£«Ê­±©M¹ï¨ä¥L¼Ð·Çªº°Ñ¦Ò¥~¡ASQL ¼Ð·Çªº¨â­Óª©¥»§¹¥þ¤@¼Ë¡C
¨â­Óª©¥»³£¥i±q¥H¤U¦a¤è¨ú±o¡J
\begin{tscreen}
\begin{verbatim}
     American National Standards Institute
     1430 Broadway
     New York, NY 10018
     USA
     Phone (sales): +1.212.642.4900
\end{verbatim}
\end{tscreen}

°£ SQL-92 ¼Ð·Ç¥~¡A²{¦bÁÙ¦³¤@¥÷§Þ³N¥¿»~ªí (Technical Corrigendum) ¡]°£¿ù¡^¡J
\begin{tscreen}
\begin{verbatim}
   * Technical Corrigendum 1:1994 to ISO/IEC 9075:1992
\end{verbatim}
\end{tscreen}

TC 1 À³¸Ó¥i±q ANSI ¨ú±o¡CTC 1 ¥u¦³ ISO ª©¥»¡X¡X¥¦¾A¥Î©ó ISO ©M ANSI ª©¥»ªº 
SQL-92¡C

°£¼Ð·Ç¥~¡A¤]¦³Ãö©ó 1992 SQL ¼Ð·Çªº®Ñ¡C³o¨Ç®Ñ´£¨Ñ¤@­Ó¤ñ¹ê»Ú¼Ð·Ç©ö²z¸Ñªº´y­z¡C

¦³Ãöªº¼Ð·Ç

SQL ªÀ¸s¤]¹ï¦h­Ó¨ä¥L¼Ð·Ç¦³¿³½ì¡C³o¸`¥]¬A¤@¨Ç¦³Ãö³o¨Ç§V¤Oªº«ü°w¡C
·í§ó¦h¸ê®Æ¦bºô¤W¥X²{«á¡A³o­Ó¦W³æ¤]·|§óªø¡C

\begin{itemize}
\item   SQL Environments (FIPS 193)
\item    Next Generation Repository Systems (X3H4) - ¤@¥÷©IÆ~°Ñ»P "Developing 
Standards for the Next Generation Repository Systems" ªº·s»D½Z¡C
\end{itemize}



\subsection{²Ä¤G³¡¤À¡XISO/ANSI SQL °òª÷ (ISO/ANSI SQL Foundation)}

SQL3 §V¤Oªº¤@­Ó­«­n³¡¤À¦b SQL °òª÷¤å¥ó¤¤¡J

\begin{itemize}
\item    °ò¥»ªº SQL/PSM ¯à¤O¡]¨Ó¦Û SQL/PSM-92¡^
\item    ·sªº¸ê®Æ«¬ºA
\item    ¿Eµo (Triggers)
\item    ¤lªí®æ (Subtables)
\item    ©â¹³¸ê®Æ«¬ºA (Abstract Data Types, ADT)
\item    ª«¥ó¾É¦V¯à¤O
\end{itemize}


¹ïª«¥ó¾É¦V¯à¤O¦³¼Æ­Ó¥ý¨M­n¨D¡J

\begin{itemize}
\item    ©w¸q½ÆÂø¹B§@ªº¯à¤O
\item    §â½ÆÂøªº¹B§@Àx¦s¦b¸ê®Æ®w¤¤
\item    ©I¥s¥~³¡µ{§Ç¡A¦³¨Ç¤£¯à¥Î SQL °µ¨ìªº¹B§@¡A©Î»Ý­n©M¥~­±·¾³q
\end{itemize}


³o¨Ç¯à¤O¤w©w¸q¬° SQL/PSM ªº¤@³¡¤À

²{¦b¦³¤j¶q¤u§@©ó·Ò»s SQL-3 ª«¥ó¼Ò«¬¡A¨Ï¥¦©M ODMG ´£¥Xªºª«¥ó¼Ò«¬¬Ý»ô¡C³o§V¤O¦b 
X3H2 ©M ISO DBL ¤å³¹¤¤´y­z¹L¡J®e¯Ç SQL3 ©M ODMG¡C¦b SQL3/OQL Merger 
³Ìªñªº§ó·sª©¤]¥i±o¨ì¡C

SQL3 ®É¶¡ªí

¦³Ãö SQL3 ªº¤u§@¥¿¦b¶i¦æ¡A¦ý³Ì²×¼Ð·ÇÁÙ¦³«Ý¼Æ¦~«á¤~¥X²{¡C

\begin{itemize}
\item   °ê»Ú©Ê§ë²¼§â SQL3 °òÂ¦±q¯ó®×´£¤É¬°©e­û¯ó®× (Committee Draft, CD)
¦b¤@¤E¤E¤»¤é¬î©u¶i¦æ¡C
\item   ¦ô­p§ë²¼·|±a¨Ó¤j¶qµû½×
\item   ±N·|»Ý­n²Ä¤G¦¸ CD §ë²¼
\item   Draft International Standard §ë²¼¦h¥b·|¦b 1998 ¦~¤¤¶i¦æ
\item   °ê»Ú¼Ð·Ç¥i¦b¤@¤E¤E¤E¦~¤¤§¹¦¨
\end{itemize}


ANSI ª©ªº¼Ð·Çªº½s±Æ¤]®t¤£¦h¡C


\subsection{²Ä¤T³¡¤À¡XISO/ANSI SQL ©I¥s¯Å¤¶­± (Call Level Interface)}

SQL/CLI ¬O¤@ºØ¹ï SQL ¸ê®Æ®wªº©I¥s¯Å¤¶­±¡C¥¦³]­p¬°¤ä´©¥]»q (shrink-wrapped) 
ªºÀ³¥Îµ{¦¡¡CCLI ­ì¥»¥Ñ SQL Access Group (SAG) ªº¤@­Ó¤p²Õ©e­û·|³Ð³y¡C SAG/CLI 
³W®æ¦b 1992 ¦~¥H·L³n Open DataBase Connectivity (ODBC) ³W®æ¤½§G¡C¤@¤E¤E¤T¦~¡A
SAG §â CLI ´£¥æ¨ì ANSI ©M ISO SQL ©e­û·|¤¤¡C(SQL Access Group ²{¤wµ²¦X¨ì 
X/Open consortium ¤¤¡C)

SQL/CLI ´£¨Ñ¤F¥H¤U¨Æ¶µªº°ê»Ú¼Ð·Ç¡J



\begin{itemize}
\item    ¿W¥ß©ó¹ê½î¤èªkªº CLI ¨Ó¦s¨ú SQL ¸ê®Æ®w
\item    ¥D±q¤u¨ã (Client-server tools) ¥i»´©öÄy°ÊºAÃìµ²¨ç¦¡®w¦s¨ú¸ê®Æ®w
\item    ¤ä´©¤Î¹ªÀyÂ×´Iªº¥D±q¤u¨ã
\end{itemize}


SQL/CLI ®É¶¡ªí

¹ï¼Ð·Çªº¶}µo¹Lµ{¡ASQL/CLI ¥¿¥HÅå¤Hªº³t«×³B²z¤¤¡C

\begin{itemize}
\item    SQL/CLI ¬O¹ï 1992 SQL ¼Ð·Ç¡]SQL-92¡^ªº¸É¿ò
\item    ¤@¤E¤E¤­¦~§¹¦¨¡A¦¨¬° ISO ¼Ð·Ç
\item    ISO/IEC 9075-3:1995 Information technology -- Database languages -- SQL
-- Part 3: Call-Level Interface (SQL/CLI)
\item    ¥Ø«e SQL/CLI ¥¿§V¤O¥[¤W SQL3 ¥\¯à
\end{itemize}



\subsection{²Ä¥|³¡¤À¡X ISO/ANSI SQL «ù¤[Àx¦s¼Ò²Õ (Persistent Stored Modules)}

SQL/PSM Äy¥H¤U¥\¯àÂX¥R SQL¡J

\begin{itemize}
\item    µ{§Ç»y¨¥ (Procedural language) ©µ¦ù
\item    ½Æ¥y (Multi-statement) ©MÀx¦sµ{§Ç
\item    ¥~³¡¨ç¼Æ»Pµ{§Ç©I¥s (External function and procedure calls)
\end{itemize}


°£§@¬°¦³»ù­ÈªºÀ³¥Îµ{¦¡¶}µo¤u¨ã¡ASQL/PSM ¬° SQL3 ´£¨Ñ¤Fª«¥ó¾É¦V¯à¤Oªº°òÂ¦¤ä´©¡C

½Æ¥y©M¤º¦sµ{§Ç

½Æ¥y©M¤º¦sµ{§Ç¬°¥D±qÀô¹Ò´£¨Ñ¦hºØ¦n³B¡J

\begin{itemize}
\item    ªí²{¡X¥Ñ©ó¤º¦sµ{§Ç¥i°õ¦æ¦h¥y SQL »y¥y¡A»P«È¤á¸gºôµ¸ªº·¾³q¥i´î¤Ö¡C
\item    «O¦w¡X¥ÎªÌ¥i¥H¦³Åv§Q¸g¤º¦sµ{§Ç§ó·s¤@­Ó©Î¦h­Óªí®æ¡A¦ý¨SÅvª½±µ§ó·s¡C
\item    ¤À¨Éµ{¦¡½X¡X¤£»Ý¨C­Ó¦s¨ú¸ê®Æ®w«È¤á¤u¨ã³£­«¼g©M­«¸Õ¤º¦sµ{§Çªºµ{¦¡½X¡C
\item    ±±¨î¡X¬°À³¥Îµ{¦¡ªº°õ¦æ´£¨Ñ³æ¤@ªº©w¸q©M±±¨î¡C
\end{itemize}


µ{§Ç»y¨¥©µ¦ù

µ{§Ç»y¨¥Äy¬y¦V±±¨î©M¨ä¥L½sµ{§Þ¥©¬° SQL ¥[¤W¶Ç²Îµ{¦¡»y¨¥ªº¥\¯à¡C

¬y¦V±±¨î»y¥y

\begin{itemize}
\item    If-then-else
\item    °j°éµ²ºc (Looping constructs)
\item    ¨Ò¥~³B²z (Exception handling)
\item    Case »y¥y
\item    Begin-End °Ï¶ô
\end{itemize}


µ{§Ç»y¨¥©µ¦ùÁÙ¥]¬A¨ä¥L½sµ{§Þ¥©¡J

\begin{itemize}
\item    ÅÜ¼Æ«Å§i
\item    Set »y¥y¡A¥Î©ó½á­È (assignment)
\item    ¨ú±o¦æµ{ (process) ©Mª¬ºAªº¸ê®Æ
\end{itemize}


¦¹¥~¡A©Ò¦³¶Ç²Î SQL »y¨¥³£¥i¥]§t¦b¦h¥yªºµ{§Ç¤¤¡C

¥~³¡¨ç¼Æ»Pµ{§Ç©I¥s

¤@­Ó¸g±`¦b¤j¶q¸ê®Æ®w²£«~ªº wish lists ¤¤¥X²{¡A¦Ó¦³³¡¤À¹ê½î¨ìªº¯S¦â¡A
¬O©I¥s¥ÎªÌ©Ò¼g¡A¦b¸ê®Æ®w³n¥ó¥~ªºµ{§Ç¡C

\begin{itemize}
\item    ®e³\¬Y­Ó¹q¸£©ÎÀ³¥Îµ{¦¡¥[¤W¦Û¤vªº¸ê®Æ®w¨ç¼Æ
\item    ¥i¦b¾ã­Ó¸ê®Æ®wÀ³¥Îµ{¦¡¨Ï¥Î
\end{itemize}


³o¥\¯àªº¦n³B¬O¥¦Åý¸ê®Æ®w¡]¦]¦¹¥]¬A¸ê®Æ®wÀ³¥Îµ{¦¡¡^¨Ï¥ÎÂ×´Iªºµ{§Ç©M¨ç¼Æ¡A
Â×´I±o¤£¯à¥Ñ¤@­Ó¼Ð·Ç²ÕÂ´©w¥X¡C

SQL/PSM ®É¶¡ªí

SQL/PSM µo®i¨³³t¡J

\begin{itemize}
\item    SQL/PSM ¬O SQL-92 ªº¸É¿ò
\item    ¦³Ãö§â SQL/PSM 
±q°ê»Ú¼Ð·Çªº¯ó®×ÅÜ¬°°ê»Ú¼Ð·Çªº°ê»Ú§ë²¼¦b¤@¤E¤E¤»¦~¤@¤ë§¹¦¨¡C
\item    ¤@¤E¤E¤»¦~¤­¤ëªº½s¿è·|Ä³¥¼¯à¸Ñ¨M©Ò¦³µû½×
\item    PSM ½s¿è·|Ä³¦w±Æ©ó¤@¤E¤E¤»¦~¤E¤ë¤T¤Q¤é¦Ü¤Q¤ë¥|¤é´Á¶¡­«¶}
\item    ¦w±Æºò­¢¡A¦ý PSM ¦³¥i¯à¦b¤@¤E¤E¤»¦~¶¡¥Xª©
\item    ©x¤è¥ô©R¬°¡J
ISO/IEC DIS 9075-4:199? Information technology -- Database languages --
SQL -- Part 4: SQL Persistent Stored Modules (SQL/PSM)
\item    ²{¥¿¬° SQL3 ¥[¤W SQL/PSM ¤ä´©¤u§@¡C
\end{itemize}



\subsection{²Ä¤­³¡¤À¡X ISO/ANSI SQL/µ²¦X (Bindings)}

¬°¤è«K°Ñ¦Ò¡Aµ{¦¡»y¨¥ªºµ²¦X³Q©â¥X¦¨¿W¥ßªº¤å¥ó¡C¥Ø«eªºª©¥»§Y¬O SQL-92 
ªº°ÊºA©M´O¤Jµ²¦X (dynamic and embedded bindings) ªº¸`¿ý¡C

µ{¦¡»y¨¥µ²¦X¤´¦³¤£¦Pªº°ÝÃD¦³«Ý¸Ñ¨M¡C

¹ï¶Ç²Îµ{¦¡»y¨¥¨Ó»¡¡A¸ê®Æ«¬ºA©M SQL-92 ªº¥i¥H¤¬¬Û¹ïÀ³¡C¤£¹L¡A SQL 
ª«¥ó©Mµ{¦¡»y¨¥ÅÜ¼Æ¤§¶¡ªº¹ïÀ³¥²¶·©w¸q¡C

¹ïª«¥ó¾É¦V»y¨¥¨Ó»¡¡A¥Ø«eªº SQL ¸ê®Æ«¬ºA¡BSQL 
ª«¥ó¼Ò«¬©Mª«¥ó¾É¦Vµ{¦¡»y¨¥¤§¶¡ªº¹ïÀ³Ãö«Y¥²¶·©w¸q¡C

ª«¥ó¼Ò«¬»Ý¦b¤½¶}³o¨Ç¤§«eÃ­©w¤U¨Ó¡C

»y¨¥µ²¦X§¹¦¨®É·|¦¨¬° SQL3 ªº¤@³¡¤À¡C


\subsection{²Ä¤»³¡¤À¡XISO/ANSI SQL XA ¤¶­±±Mªù¤Æ ¡]SQL/XA¡^}

³o³W®æ·|¬°Á`¥æ©öºÞ²z­û (global Transaction Manager) ©M SQL ¸ê·½ºÞ²z­û 
(SQL Resource Manager) ¤§¶¡À³¥Îµ{¦¡¤¶­± (API) ´£¨Ñ¼Ð·Ç¡C¥¦·|®Ú¾Ú ISO/IEC 
10026 ªº¤º®e¡A¡§¤À´²¥æ©ö³B²z (Distributed Transaction Processing¡^¡¨
¼Ð·Ç¤Æ¨ç¼Æ©I¥s¡ASQL ¸ê·½ºÞ²z­û·|¥Î¥H¤ä´©¤À¤G¶¥¬qªº½T©w (two-phase 
commit)¡C°òÂ¦ªº¤å¥ó¬O¦Û¸g X/Open §å·Ç¦Ó¨Ó¦Û¤@¥÷ X/Open ¥Xª©ª«¡A¥¦²M·¡ªº«ü©ú 
xa\_close, xa\_commit, xa\_complete, xa\_end, xa\_forget, xa\_open, xa\_prepare, 
xa\_recover, xa\_rollback ©M xa\_start µ¥¦h­Ó¨ç¼Æ¡A¥H SQL 
¸ê®Æ«¬ºAªº¿é¤J©M¿é¥X°Ñ¼Æªº»yªk¡C

ISO ¥Ø«e¥¿¹Á¸ÕºÉ§Ö°l¤W (fast-tract) X/Open XA ³W®æ¡C
³o­Ó¹Lµ{­ì«Ê¤£°Ê±Ä¥Î¤@­Ó¥Ø«eªº·~¬É³W®æ¡C¥H ISO SC21¡AJTC 1 µ¥¯Åªº XA 
ºÉ§Ö°l¤W§ë²¼¦b¤@¤E¤E¤­¦~¥|¤ë¤G¤Q¤C¤é¶}©l¡A¤@¤E¤E¤­¦~¤Q¤ë¤G¤Q¤C¤éµ²§ô¡C¦pªG XA 
³W®æ¸g 75\% ²¼¼Æ©M 2/3 ªº JTC 1 p-members §å·Ç¡A¥¦·|¦¨¬°¤@­Ó°ê»Ú¼Ð·Ç¡C
¦pªG¸gºÉ§Ö°l¤W§ë²¼§å·Ç¡ASQL/XA ¥i¦b 1996 ¦~¦¨¬°¼Ð·Ç¡C


\subsection{²Ä¤C³¡¤À¡X®ÉºA ISO/ANSI SQL }

®ÉºA SQL ³B²z©M®É¶¡¦³Ãöªº¸ê®Æ¡C¨ä·§©À¬O¦b¬d¸ß¸ê®Æ®É§Q¥Î¥¦¦b¤@­Ó¯S©w®É¶¡ªº±¡ªp¡C
®ÉºA SQL ¬O¤@¥÷¥Ñ Rick Snodgrass ¦b¤@¤E¤E¥|¦~¤Q¤G¤ë©Ò¼g¡A´y­z³o·§©Àªº¤å¥ó¡C

X3 «Å§G½T»{¤@­Ó·s­p¹º¡AISO/IEC 9075 Part 7:
SQL/Temporal ¬O¤@¥÷Ãö©ó SQL/Temporal ªº·s»D½Z
\begin{tscreen}
\begin{verbatim}
----------------------------------------------------------------------------
                                Temporal SQL
                                ************
Rick Snodgrass¡]TSQL2 ©e­û·|¥D®u¡^
31-Dec-1994
\end{verbatim}
\end{tscreen}

¦³¤H½èºÃ¹L SQL 3 ¹ïªþ¥[®É¶¡¤ä´©ªº°ÝÃD¡]¦p¦b DBL R10-75 ´£Ä³¡A­n¨D SQL 
¦³·sªº³¡¤À¨Ó³B²z®É¶¡©Êªº¸ê®Æ®w¡^¡C¨ä½×ÂI¬O©â¶H¸ê®Æ§ÎºA (ADT's) ¨¬¥H¤ä´©®ÉºA¡C
¦b³o¸ê°T©Êªº¶µ¥Ø¡A§Ú¨Ï¥Î¨ãÅé¨Ò¤l¨Ó½×ÃÒ¾Ö¦³©â¶H¸ê®Æ§ÎºAªºÄæ¦ì¤£¯à³B²z®ÉºA¬d¸ß¡C
¯S§O¨Ó»¡¡A«Ü¦h®É¶¡©Êªº¬d¸ß¤£¬O«ÜÃø¥Î SQL ¼ÒÀÀ¡A´N¬O»Ý¦b¹Lµ{»y¨¥¤¤¨Ï¥Î´O¤J¦¡ 
SQL¡C¨ä¥L¿ï¾Ü¦b TSQL2¡A¤@­Ó¹ï SQL-92 ªº®ÉºA©µ¦ù¤¤´£¥X¤F¡C


\subsubsection{¾É¨¥}

¦³®Ä®É¶¡ (Valid-time) ªº¤ä´©¶W¥X¤@­Ó®ÉºA ADT ªº¯à¤O¡C¨Ï¥Î«áªÌ¡A
¤@­ÓÄæ¦ì³Q«ü©w¬°®ÉºA»â°ì¡A¦p DATE ©Î INTERVAL¡]µy«á·|¦³¨Ò¤l¡^¡CÄyµÛ¦³®Ä®É¶¡¡A
ªí®æªº¨C¦æÀHµÛ®É¶¡§ïÅÜ¡A¦]¬°²{¹ê§ïÅÜ¤F¡CÁpÃ´¨ì¤@­Ó¦³®Ä®É¶¡ªí®æªº¬Y¦æªº®É¶¡ÂW°O 
(timestamp)¡A·|³Q¬d¸ß»y¨¥²z¸Ñ¬°¸Ó¦æ¤¤¦UÄæ¼Æ­Èªº²Õ¦X¦³®Äªº®É¶¡¡C
³o­ÓµL¶·¨¥©úªº®É¶¡ÂW°O¨Ï±o¬d¸ß¥i¥HÂ²³æ©ö©ú¦aªí¹F¥X¨Ó¡C


\subsubsection{­Ó®×¬ã¨s¡XÀx¦s²{®É¸ê®Æ}

The University of Arizona ªº Office of Appointed Personnel 
¦b¸ê®Æ®w¤¤¦³¨Ç¸ê®Æ¡A¥]¬A¹µ­û¦W¦r¡B¥Ø«eÁ~ª÷©M¥Ø«eÂ¾¦ì¡C
³o¨Ç¥i¥Î¤@­ÓÂ²³æªºªí®æªí¹F¥X¨Ó¡C
\begin{tscreen}
\begin{verbatim}
        Employee(Name, Salary, Title)
\end{verbatim}
\end{tscreen}

¨Ï¥Î³o­Óªí®æ´M§ä¤@­Ó¹µ­ûªºÁ~ª÷¤Q¤ÀÂ²³æ¡C
\begin{tscreen}
\begin{verbatim}
        SELECT Salary
        FROM Employee
        WHERE Name = 'Bob'
\end{verbatim}
\end{tscreen}

²{¦b OAP ·Q¦A°O¿ý¥X¥Í¤é´Á¡C¬°¨Ç¡A¦bªí®æ¤¤¥[¤F¤@Äæ¡A²£¥Í¥H¤Uºõ¥Ø (schema)¡J
\begin{tscreen}
\begin{verbatim}
        Employee(Name, Salary, Title, DateofBirth DATE)
\end{verbatim}
\end{tscreen}

§ä´M¤@¦W¹µ­ûªº¥X¥Í¤é´Á­Ó´M§äÁ~ª÷Ãþ¦ü¡C
\begin{tscreen}
\begin{verbatim}
        SELECT DateofBirth
        FROM Employee
        WHERE Name = 'Bob'
\end{verbatim}
\end{tscreen}



\subsubsection{­Ó®×¬ã¨s¡XÀx¦s¾ú¥v¸ê®Æ}

OAP ·Q§â¨ü¹µ¾ú¥v¹q¸£¤Æ¡C¬°¦¹¡A¥L­Ì¥[¤W¨âÄæ¡A
¤@Äæ«ü¥Xªí¥Ü¦¹¦æªº¸ê®Æ¦ó®É¶}©l¦³®Ä¡A¥t¤@«ü¥X¸ê®Æ¦ó®É¥¢®Ä¡C

Employee (Name, Salary, Title, DateofBirth, Start DATE, Stop DATE)

¥H¸ê®Æ¼Ò«¬ (data model) »¡¡A³o¨Ç·sÄæ¦ì©M DateofBirth ²@µL¤À§O¡C¤£¹L¡A
¥¦­Ìªº¦s¦b²£¥Í¦hºØµ²ªG¡C


\subsubsection{­Ó®×¬ã¨s¡X§ë¬M (Projection)}

­n§ä¥X¹µ­û¥Ø«eªºÁ~ª÷·|¸û¬°§xÃø¡C
\begin{tscreen}
\begin{verbatim}
        SELECT Salary
        FROM Employee
        WHERE Name = 'Bob' AND Start <= CURRENT_DATE AND CURRENT_DATE <= Stop
\end{verbatim}
\end{tscreen}

³o¥y¬d¸ß¤ñ¤§«eªº½ÆÂø¡C¤¸¤¿«Ü©úÅã¬O·s¼Wªº¨âÄæ¡COAP ·Qµo¥XÁ~ª÷¾ú¥vµ¹¦U­û¤u¡C
¯S§O¦a¡A¦³»Ý­n§ä¥X¨C¤@¦W¹µ­û¦b¦¬¨ü¤@­ÓÁ~¹Sªº³Ìªø®É¶¡¡C¤£©¯¦a¡A¥Î SQL 
¤£¯à°µ¨ì¡C¤@¦W¹µ­û¦bÁ~¹S½Õ¾ã´Á¶¡Â¾»Î¥i¦³¦h¦¸ÅÜ§ó¡C
\begin{tscreen}
\begin{verbatim}
Name    Salary  Title             DateofBirth   Start           Stop
----    ------  -----             -----------   -----           ----
Bob     60000   Assistant Provost 1945-04-09    1993-01-01      1993-05-30
Bob     70000   Assistant Provost 1945-04-09    1993-06-01      1993-09-30
Bob     70000   Provost           1945-04-09    1993-10-01      1994-01-31
Bob     70000   Professor         1945-04-09    1994-02-01      1994-12-31

                               ¹Ï 1
\end{verbatim}
\end{tscreen}

­nª`·N¦³¤T¦æ Bob ªºÁ~ª÷°±¯d¦b \$70,000¡C©Ò¥H¡Aµ²ªGÀ³¸Ó¬O Bob ¦³¨â¦æ¡C
\begin{tscreen}
\begin{verbatim}
Name    Salary  Start           Stop
----    ------  -----           ----
Bob     60000   1993-01-01      1993-05-30
Bob     70000   1993-06-01      1994-12-31
\end{verbatim}
\end{tscreen}

¥t¤@¤èªk¬O§âÁ~ª÷©MÂ¾¯Å¸ê®Æ¦Lµ¹¥ÎªÌ¡A¦Ó¥Ñ¥ÎªÌ§ä¥X¥LªºÁ~¹S¦ó®ÉÅÜ§ó¡C
³o¤èªk¬J¤£§l¤Þ¡A¥ç¤£¹ê»Ú¡C¥t¤@¤èªk¬OºÉ¶q¨Ï¥Î SQL¡C
\begin{tscreen}
\begin{verbatim}
CREATE TABLE Temp(Salary, Start, Stop)
AS      SELECT Salary, Start, Stop
        FROM Employee;
\end{verbatim}
\end{tscreen}

repeat
\begin{tscreen}
\begin{verbatim}
        UPDATE Temp T1
        SET (T1.Stop) = (SELECT MAX(T2.Stop)
                         FROM Temp AS T2
                         WHERE T1.Salary = T2.Salary AND T1.Start < T2.Start
                                AND T1.Stop >= T2.Start AND T1.Stop < T2.Stop)
        WHERE EXISTS (SELECT *
                      FROM Temp AS T2
                      WHERE T1.Salary = T2.Salary AND T1.Start < T2.Start
                                AND T1.Stop >= T2.Start AND T1.Stop < T2.Stop)
        until no rows updated;

DELETE FROM Temp T1

WHERE EXISTS (SELECT *
              FROM Temp AS T2
              WHERE T1.Salary = T2.Salary
                        AND ((T1.Start > T2.Start AND T1.Stop <= T2.Stop)
                        OR (T1.Start >= T2.Start AND T1.Stop < T2.Stop))
\end{verbatim}
\end{tscreen}

°j°é¤¤§ä¥X­«Å|©Î¬Û¾F¦Ó»Ý­n¦X¨Öªº®É¬q¡C¦b³ÌÃaªº±¡ªp¡A°j°é·|°õ¦æ log N ¦¸¡AN 
«ü¤@³s¦ê­«Å|©Î¬Û¾Fªº¦PÁ~ª÷¬ö¿ýªº¼Æ¶q¡CÅªªÌ¥i¦Û¦æ¼ÒÀÀ¬d¸ß¦b¥H¤W¨Ò¤lªº°õ¦æ¡A
¥HÅçÃÒ¥¦ªº¥¿½T©Ê¡C

²Ä¤TºØ¤èªk¬O¨Ï¥Î SQL ¬°ªí®æ¶}±Ò¤@­Ó´å¼Ð 
(cursor)¡C¬°¨C­ÓÁ~ª÷ºÞ²z¤@­Ó¦U¬q¸¨ªºÃìªí (linked list)¡C³oÃìªí¶}©l®É»Ý¬°ªÅ¥Õ¡C
\begin{tscreen}
\begin{verbatim}
DECLARE emp_cursor CURSOR FOR
        SELECT Salary, Title, Start, Stop
        FROM Employee;
OPEN emp_cursor;
loop:
        FETCH emp_cursor INTO :salary, :start, :stop;
        if no-data returned then goto finished;
        find position in linked list to insert this information;
        goto loop;
finished:
CLOSE emp_cursor;
\end{verbatim}
\end{tscreen}

­«ÂÐ¦ÜÃìªíµ²§ô¡A¦L¥X¤é´Á©MÁ~ª÷¡C

¦pªG´å¼Ð¬O ORDER BY Start¡AÃìªí¨Ã«D¥²­n¡C

µL½×¦p¦ó¡A¤@¥yÂ²³æªº¬d¸ß¬O¤£©ö¥Î SQL-92 ªº¥\¯àªí¹F¥X³o¥Øªº¡C¨Ï¥Î TSQL2 
ªº¸Ü³o¬d¸ß·|«ÜÂ²³æ¡C
\begin{tscreen}
\begin{verbatim}
        SELECT Salary
        FROM Employee
\end{verbatim}
\end{tscreen}



\subsubsection{®×¨Ò¬ã¨s¡X³sµ² (JOIN)}

¤@­Ó§ó¿E¶iªº¤èªk¬O§âºõ¥Ø­«¾ã¡A§âÁ~ª÷¡BÂ¾¯Å¡B¥X¥Í¤é´Á¸ê®Æ¤À¶}¡A
±q¦ÓÁ×¶}©â¨úÁ~¹S¾ú¥v®É¹J¨ìªº°ÝÃD¡C¡]¬°¤è«K­p¡A§Ú­Ì¥H«áªº°Q½×¤¤¤£¦A¦Ò¼{¥X¥Í¤é´Á¡C¡^
\begin{tscreen}
\begin{verbatim}
        Employee1 (Name, Salary, Start DATE, Stop DATE)
        Employee2 (Name, Title, Start DATE, Stop DATE)
\end{verbatim}
\end{tscreen}

Employee1 ªí®æ¦p¤U¡J
\begin{tscreen}
\begin{verbatim}
Name    Salary  Start           Stop
----    ------  -----           ----
Bob     60000   1993-01-01      1993-05-30
Bob     70000   1993-06-01      1993-12-31
\end{verbatim}
\end{tscreen}

³o¬O Employee2 ªí®æ¡C
\begin{tscreen}
\begin{verbatim}
Name    Title                   Start           Stop
----    ------                  -----           ----
Bob     Assistant Provost       1993-01-01      1993-09-30
Bob     Provost                 1993-10-01      1994-01-31
Bob     Professor               1994-02-01      1994-12-31
\end{verbatim}
\end{tscreen}


§ïÅÜ¤§«á¡A¨ú±o¹µ­ûÁ~ª÷¸ê®ÆÅÜ±oÂ²³æ¡C
\begin{tscreen}
\begin{verbatim}
        SELECT Salary, Start, Stop
        FROM Employee1
        WHERE Name = 'Bob'
\end{verbatim}
\end{tscreen}

¦ý¦pªG OAP ·Q¤@­Óªí®æ¤¤¥]¬AÁ~ª÷¡BÂ¾¦ìªº®É¬q¡]§Y OAP ·Q¤@­Ó¹³¹Ï 1 
§Î¦¡ªºªí®æ¡^¡H¤@­Ó¤èªk¬O¦L¥X¨â­Óªí®æ¡A¦ÓÅý¥ÎªÌ§ä¥X¦³Ãö²Õ¦X¡C¥t¤@¤èªk¬O§¹¥þ¨Ï¥Î 
SQL¡C¤£©¯¦a¡A³o¬d¸ß­n¤ÀªR Employee1 ¨C¦æ©M Employee2 
ªº­«Å|±¡ªp¡A¦³¥|ºØ¥i¯à¥X²{¡C
\begin{tscreen}
\begin{verbatim}
SELECT Employee1.Name, Salary, Dept, Employee1.Start, Employee1.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name
     AND Employee2.Start <= Employee1.Start AND Employee1.Stop < Employee2.Stop
UNION
SELECT Employee1.Name, Salary, Dept, Employee1.Start, Employee2.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name
     AND Employee1.Start >= Employee2.Start AND Employee2.Stop < Employee1.Stop
        AND Employee1.Start < Employee2.Stop
UNION
SELECT Employee1.Name, Salary, Dept, Employee2.Start, Employee1.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name
     AND Employee2.Start > Employee1.Start AND Employee1.Stop < Employee2.Stop
        AND Employee2.Start < Employee1.Stop
UNION
SELECT Employee1.Name, Salary, Dept, Employee2.Start, Employee2.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name
     AND Employee2.Start > Employee1.Start AND Employee2.Stop < Employee1.Stop
\end{verbatim}
\end{tscreen}

¥¿½T§ä¥X©Ò¦³±¡§Î¬O¤@¥ó¨ã¬D¾Ô©Êªº¤u§@¡C¨Ï¥Î 
TSQL2¡A¶i¦æ¤@­Ó¨ã®ÉºAªº³sµ²´N¦p¤H­Ì©Ò´Á±æ¡C
\begin{tscreen}
\begin{verbatim}
        SELECT Employee1.Name, Salary, Dept
        FROM Employee1, Employee2
        WHERE Employee1.Name = Employee2.Name
\end{verbatim}
\end{tscreen}



\subsubsection{­Ó®×¬ã¨s¡X»E¶° (AGGREGATES)}

²{¦b OAP ³Q°Ý¤Î³Ì°ªÁ~¹S¬O¤°»ò¡H¥[¤W®É¶¡«e¡A³o«ÜÂ²³æ¡C
\begin{tscreen}
\begin{verbatim}
        SELECT MAX(Salary)
        FROM Employee
\end{verbatim}
\end{tscreen}

²{¦b¥[¤W¤FÁ~ª÷¾ú¥v¡A§Ú­Ì­n§ä¥X¤£¦P®É¶¡³Ì°ªÁ~ª÷ªº¾ú¥v¡C°ÝÃD·íµM¬O SQL 
¨Ã¤£´£¨Ñ¨ã®ÉºAªº»E¶°¡CÂ²³æªº¤èªk¬O¦L¥X¦³Ãö¸ê®Æ¡A¥Î¤H¤â§ä¥X³Ì¤j­È¡C
¥t¤@­Ó¤èªk¬O¨ú¥©¡A§â¤@­Ó·í®Éªº (snapshot) »E¶°¬d¸ßÂà¤Æ¬°¤£¨Ï¥Î»E¶°ªº¬d¸ß¡A
¦AÂà¤Æ¬°®ÉºA»E¶°¡C¨º­Ó¤£¨Ï¥Î»E¶°ªº¬d¸ß¥Î©ó§ä¥X¤£¤j©ó¥¦¥»¨­¼Æ­ÈªºÁ~ª÷¡C
\begin{tscreen}
\begin{verbatim}
        SELECT Salary
        FROM Employee AS E1
        WHERE NOT EXISTS (SELECT *
                          FROM Employee AS E2
                          WHERE E2.Salary > E1.Salary)
\end{verbatim}
\end{tscreen}

§â³o­Ó¬d¸ßÅÜ¬°®ÉºA¬d¸ß¨Ã¤£Åã²L¡C¥H¤U¬O¤@ºØ¤èªk¡C
\begin{tscreen}
\begin{verbatim}
CREATE TABLE Temp (Salary, Start, Stop)
AS      SELECT Salary, Start, Stop
        FROM Employee;
INSERT INTO Temp
        SELECT T.Salary, T.Start, E.Start
        FROM Temp AS T, Employee AS E
        WHERE E.Start >= T.Start AND E.Start < T.Stop AND E.Salary > T.Salary;

INSERT INTO Temp
        SELECT T.Salary, T.Stop, E.Stop
        FROM Temp AS T, Employee AS E
        WHERE E.Stop > T.Start AND E.Stop <= T.Stop AND E.Salary > T.Salary;
DELETE FROM Temp T
WHERE EXISTS (SELECT *
              FROM Employee AS E
              WHERE ((T.Start => E.Start AND T.Start < E.Stop)
                        OR (E.Start >= T.Start AND E.Start < T.Stop))
                    AND E.Salary > T.Salary;
\end{verbatim}
\end{tscreen}

³o¤èªk«Ø¥ß»²§Uªí®æ¡C§Ú­Ì¦b³o­Óªí®æ¤¤¥[¤W¨â­Ó®É¬q¤¤­«Å|³¡¤Àªº¤W¡B¤U³¡¤À¡C
¤§«á§Ú­Ì§â©Ò¦³¤l¬d¸ß¤¤§ä¥Xªº¬ö¿ý§R°£¡A¦]¦¹¼vÅT¨ì NOT 
EXISTS¡C³Ì«á§Ú­Ì±q»²§Uªí®æ¤¤§ä¥X³Ìªøªº®É¬q¡A¹³¤§«e§Ú­Ì§ä¥XÁ~ª÷¸ê°T¯ë¡C
¦p¤j®a©Ò®Æ¡A³o¼Ëªº SQL ¥y¤l°õ¦æ®É®Ä²v«D±`§C¡A¦]¬°¨º¨Ç½ÆÂøªº±_ª¬¤£µ¥¬d¸ß¡C

²Ä¤T­Ó¤èªk¬OºÉ¶q¤Ö¥Î SQL¡A¦Ó¦b¥D¾÷¤W©Ò¥Îªº»y¨¥¤¤¥Î´å¼Ð§ä¥X³Ìªøªº¾ú¥v¡C

¨Ï¥Î TSQL2 ¦A¦¸Â²³æª½±µ¡C
\begin{tscreen}
\begin{verbatim}
        SELECT MAX(Salary)
        FROM Employee
\end{verbatim}
\end{tscreen}



\subsubsection{ºK­n}

¤j³¡¤À¸ê®Æ®wÀ³¥Îµ{¦¡³£»Ý­n³B²zÀH®É¶¡§ïÅÜªº¸ê®Æ¡C¦³®Ä®É¶¡¦b SQL 
¨Ã¤£¤ä´©¡C«Ü¦h®ÉºA¬d¸ß¤£¬O«ÜÃø¥H SQL ¼ÒÀÀ¡A´N¬O»Ý­n§â SQL 
´O¤J¨ìµ{§Ç»y¨¥¤¤¡A¦]¬° SQL ¦b¸ê®Æ¼Ò«¬©M¬d¸ß»y¨¥µ²ºc¤¤¯Ê¥F¹ï¦³®Ä®É¶¡ªº¤ä´©¡C

¥t¤@¤è­±¡A§Ú­Ì¥Ü½d¥X¥[¤W¦³®Ä®É¶¡¤ä´©»Ý­n¹ï DBMS ¬I¦æ§@¥X¤@¨Ç§ïÅÜ¡A
¦ý¯àÀ¸¼@©Ê¦aÂ²¤Æ¤@¨Ç¬d¸ß¡A¨Ã¨Ï¨ä¥L¬d¸ßÅÜ±o¦³¥i¯à¡C±N¨Ó¤]¥i©óÀx¦sµ²ºc¡B
¯Á¤Þ¤èªkªº³Ì¨Î¤Æ (optimization)¡C¦Ó³Ì¨Î¤Æªºµ¦²¤¥i¾É­Pªí²{¤j´T´£¤É¡C

ÀHµÛ SQL3 ªº¤@­Ó·s³¡¤À¤ä´©ÀH®É¶¡§ïÅÜªº¸ê®Æ¡A§Ú­Ì¥i¥H¶}Öí³B²z³oÃþÀ³¥Î¡A§ï¨} 
SQL3 ³B²z®ÉºA¸ê®Æªº¯à¤O¡C
\begin{tscreen}
\begin{verbatim}
----------------------------------------------------------------------------
           Accredited Standards Committee* X3, Information Technology
NEWS RELEASE

¤å¥ó½s¸¹¡J       PR/96-0002

¦^ÂÐ¡J       Barbara Bennett at bbennett@itic.nw.dc.us

             X3 «Å§G»{¥i¤@­Ó³o±M®×, ISO/IEC 9075 Part 7:  SQL/Temporal

Washington D.C., 1996 ¦~¤@¤ë
----------------------------------------------------------------------------
\end{verbatim}
\end{tscreen}

-- Accredited Standards Committee X3, Information Technology «Å§G»{¥i¤@­Ó¦³Ãö 
SQL/Temporal ¤ä´©ªº·s±M®×¡AISO/IEC 9075 Part 7¡A¨Ã§â¦³Ãö¤u§@¥æ¤© Technical 
Committee X3H2, Database¡C³o­Ó«ØÄ³¤¤ªº¼Ð·Ç­q©ú±N¥X²{ªº SQL3 
¼Ð·Çªº¤@­Ó·s³¡¤À¡A¦p²Ä¤C³¡¤À Temporal SQL ¬° SQL ªº¤@­Ó©µ¦ù¡A¦b SQL 
¸ê®Æ®wÀô¹Ò¤ä´©¦s¨ú©M³B²z¨ã®ÉºAªº¸ê®Æ¡C¤U¦¸ X3H2 
·|Ä³©w©ó¤@¤E¤E¤»¦~¤T¤ë¤Q¤@¦Ü¤Q¥|¤é¦b³ôÂÄ´µ (Kansas) Á|¦æ¡C

¦p¦³¬d¸ß¡A¥i¶l±H©¹¡J
\begin{tscreen}
\begin{verbatim}
        Chairman of X3H2,
        Dr. Donald R. Deutsch,
        Sybase, Inc., Suite 800,
        6550 Rock Spring
        Drive, Bethesda, MD  20817.
        Email: deutsch@sybase.com.
\end{verbatim}
\end{tscreen}

²{¥¿´M¨D¥i¯àªº±M§Q©M¨ä¥L«ê·íªº¨Æ¶µ¡]ª©Åv¡B°Ó¼Ð¡^¡C³o§â¦³Ãö¸ê®Æ±H¥æ¡J
\begin{tscreen}
\begin{verbatim}
        X3 Secretariat at
        1250 Eye Street
        NW, Suite 200,
        Washington DC  20005.
        Email: x3sec@itic.nw.dc.us
        FAX:  (202)638-4922.
\end{verbatim}
\end{tscreen}



\subsection{²Ä¤K³¡¤À¡XISO/ANSI SQL ¦h´CÅé (SQL/MM)}

¤@­Ó¬°«Ø¥ß¥Î©ó¦h´CÅéÀ³¥Îµ{¦¡ªº SQL ª«¥ó¨ç¦¡®wªº·s ISO/IEC 
°ê»Ú¼Ð·Ç¤Æ­p¹º¦b¤@¤E¤E¤T¦~ªì´ÁÀò§å·Ç¶i¦æ¡C³o­Ó·s¼Ð·Ç¤Æ¦æ°Ê¦W¬° SQL Multimedia 
(SQL/MM)¡A¥¦·|¥Î¯óÀÀ¤¤ªº SQL3 ³W®æ¤¤ªº©â¶H¸ê®Æ«¬ºA¡]ADT¡^³W®æ©M¥Ø¼Ð«ü©w SQL 
ADT ©w¸q®M¥ó¡C

SQL/MM ¥Ø¼Ð¬°¼Ð·Ç¤Æ¬ì¾Ç©M¤uµ{¡B¥þ¤å©M¤å¥ó³B²z¡BºÞ²z¦h´CÅéª«¥ó¡A¦p¼v¹³¡BÁn­µ¡B
°Êµe¡B­µ¼Ö©M¿ý¹³ªºª«¥ó¨ç¼Æ®w¡C¥¦¦h¼Æ·|´£¥X¤@ºØ¥Î©ó¨ä¥L JTC1 
¼Ð·Ç²ÕÂ´¡]¦p¦³Ãö¤å¥óªº SC18¡B¼v¹³ªº SC24¡B·Ó¤ù©M°Ê§@¹Ï¹³ªº SC29¡^©w¸qªºª«¥óªº 
SQL »y¨¥µ²¦X (binding)¡C

SQL/MM ªº±M®×­p¹º«ü¥X¥¦·|¦¨¬°¤@¥÷¦h³¡¤À¼Ð·Ç¡A¥]§t¤£©w¼Æ¶qªº³¡¤À¡C
²Ä¤@³¡¤À·|¬O¨ä¥L³¡¤À¦p¦ó«Ø¦¨ªº®Ø¬[¡C¨ä¥L¨C­Ó³¡¤À·|±Mª`©ó¤@­Ó¯S©wªº SQL 
À³¥Îµ{¦¡®M¥ó¡C¥H¤U¬°¤@¤E¤E¥|¦~¤K¤ë¦s¦bªº SQL/MM ³¡¤À¡J

\begin{itemize}
\item    Part 1: Framework A non-technical description of how the document is
structured.
\item    Part 2: Full Text Methods and ADTs for text data processing. About 45
pages.
\item    Part 3: Spatial Methods and ADTs for spatial data management. About 200
pages with active contributions from Spatial Data experts from 3
national bodies.
\item    Part 4: General Purpose Methods and ADTs for complex numbers,
Facilities include trig and exponential functions, vectors, sets, etc.
Currently about 90 pages.
\end{itemize}


¦³¦h­Ó¦³ÃöªÅ¶¡©M¦a²z¸ê®Æªº¼Ð·Ç¤Æªº¤u§@¦b¶i¦æ¤¤¡J

\begin{itemize}
\item    ANSI X3L1 - Geographic Information Systems.
Unisys ªº Mark Ashworth of Unisys ¬O X3L1 ©M ANSI X3H2 ¶¡ªºÁpµ¸¤H¡C
¥L¤]¬O SQL/MM ¯ó½Z²Ä¤@¡B¤T©M¥|³¡¤Àªº½s¿è¡C
\item    ISO TC 211 - Geographic information/Geomatics
\end{itemize}



\section{PostgreSQL ªº§Þ³N¤ä´©}

¦pªG§A¦³¥ô¦ó§Þ³N¤Wªº°ÝÃD¦¡¹J¨ì§xÃø¡A§A¥i¹q¶l¦Ü¡J
\begin{itemize}
\item   \onlynameurl{pgsql-questions@postgresql.org}
\item  ·s»D²Õ \nameurl{comp.databases.postgresql.general}{}
\item  ·s»D²Õ \nameurl{comp.databases.postgresql.hackers}{}
\item  ·s»D²Õ \nameurl{comp.databases.postgresql.doc}{}
\item  ·s»D²Õ \nameurl{comp.databases.postgresql.bugs}{}
\item  ·s»D²Õ \nameurl{linux.postgres}{}
\item  ¨ä¥L³q«H½×¾Â \nameurl{http://www.postgresql.org}{}
\end{itemize}

¤Î¹w´Á¦b¤@¤é¤º¦¬¨ì¦^ÂÐ¡C¦]¬°¤¬Ápºô²£«~ªº¥Î¤á½d³ò«Ü¼s¡A¥Î¤á¤S¤¬¬ÛÀ°§U¡A
¤¬Ápºô¥i»´©ö¬°¼Æ¥H¦Ê¸U­p¥Î¤á´£¨Ñ§Þ³N¤ä´©¡C¹q¶l¤ä´©¤ñ¹q¸Ü¤ä´©¤è«K±o¦h¡A
¦]¬°§A¥i°Å¤U©M¶K¤W¿ù»~°T®§¡Bµ{¦¡¿é¥Xµ¥µ¥¡A¤S¥i»´©ö¶Ç°e¨ì³q«H½×¾Â / ·s»D²Õ¡C




\subsection{°Ó·~¤ä´©}



PostgreSQL ²ÕÂ´¤]·|¦V¤½¥q¥X°â§Þ³N¤ä´©¡A©Ò±o¦¬¯q·|¥Î©óºûÅ@¥@¬É¦U¦aªº¦h­Ó¬M®g¯¸¥x
¡]¸Uºûºô©M ftp¡^¡C¤]·|¥Î¨Ó¦L»s¤å¥ó¡B«ü¤Þ©M®ÑÄy¥HÀ°§UÅU«È¡C¥L­Ìªººô§}¬° \nameurl{http://www.postresql.org}{}¡C

¥t¤@¶¡¦W¬°¡¥Great Bridge Corporation¡¦¥¿¶i¦æ PostgreSQL
ªº¶}µo¡B¾P°â©M¤ä´©¡C¥L­Ìªººô­¶¬° \nameurl{http://www.greatbridge.com}{}¡C¥¦¬O¤@¶¡¥Ñ¡¥Landmark Communications 
corp¡¦©M¨ä¥L§ë¸ê¤½¥q³]¥ßªº¤½¦@¤½¥q¡A±Mªù¦V¥@¬É¤j¥ø·~¤j¤½¥q©M°â½æ©M¤ä´© 
PostgreSQL¡C 

§A¤]¥i¦b Redhat¡BAnderson¡BWGS¡]Work Group Solutions¡^µ¥±M·~ÅU°Ý¦æ±o¨ìÀ°§U¡C
§A¥i§ä¥L­ÌÀ°§U¡A¦]¬°¥L­Ì¦³«Ü¦nªº C¡BC++ ±M®a¡] PostgreSQL ¥H C ¼g¦¨¡^¡C
\begin{itemize}
\item  Redhat ¤½¥q¡X¸ê®Æ®wÅU°Ý³¡ \nameurl{http://www.redhat.com}{}
\item  Work Group Solutions \nameurl{http://www.wgs.com}{}
\item  Anderson Consulting \nameurl{http://www.ac.com}{}
\end{itemize}



\section{¸gÀÙ©M°Ó·~¤è­±}

°Ó·~¸ê®Æ®wÃº¥æ«Ü¦hµ|¶µ¦pÁp¨¹¡B¦{¡B¾P°â¡B¹µ¥Î¡BªÀ·|«O»Ù¡BÂåÀø«OÀIµ|¡B
­û¤u°·±d«O»Ù¡B¨ä¥L¦Uµ{­û¤uºÖ§Q¡B¥«³õ±À¼s©M¼s§i¶O¡C
©Ò¦³³o¨Ç¶O¥Î³£¤£ª½±µ¥Î©ó¸ê®Æ®wªº¶}µo¡A¤£¥Î©ó§ïµ½¸ê®Æ®wªº«~½è©M§Þ³N¡C
·í§AÁÊ¶R¤@­Ó°Ó·~¸ê®Æ®w¡A¤@³¡¤Àªºª÷ÃB®ö¶O©óµ|´Ú¡B¬ã¨s¶}µo¦¨¥»µ¥¦a¤è¡C

¦Ó¥B¡A°Ó·~¸ê®Æ®w»Ý¤ä¥I¯²ª÷©MÁÊ¶R Unix ¾÷¾¹¡A¤è¸Ë©MºûÅ@¡C
©Ò¦³³o¨Ç¦¨¥»³£Âà¶ùµ¹¥Î¤á¡C

©M°Ó·~¸ê®Æ®w¬Û¤ñ¡APostgreSQL ¾Ö¦³µL»Ýª½±µµ|¶µªºÀuÂI¡A¦]¬°¥¦¬O¤¬Ápºô»s³y¡C
¤@¤j¸s¤H¬° PostgreSQL ªº¶}µo§@¥X­¶Äm¡C¨Ò¦p¡A¥H¤@­Ó°²³]ªº¨Ò¤l¡A
¦pªG¦b¬ü°ê¦³¤@¦Ê¸U¶¡¤½¥q¡A¦Ó¨C¶¡³£®½¤Q¬ü¤¸¡]¹ï PostgreSQL 
¨Ó»¡ª«¶W©Ò­È¡^¡A¨C¶¡«K±o¨ì¤@¤d¸U¤¸¡I¡I³o´N¬O¤¬Ápºô¤W³n¥ó¶}µoªº{\bfseries Å]³N}¡C

¥Ø«e¡APostgreSQL ·½µ{¦¡¦³¤j¬ù 250,000 ¦æ C¡BC++ µ{¦¡¡C¦pªG¨C¦æ C 
µ{¦¡½X­È¤G¬ü¤¸¡A¤µ¤Ñ¾ã­Ó PostgreSQL «K­È¤­¤Q¸U¬ü¤¸¡I

«Ü¦h¤½¥q¤w¶}µo¤j¶q C¡BC++ µ{¦¡¥H§@¦Û¥Î¡C¦]¦¹¡A¤Þ¤J PostgreSQL 
·½µ{¦¡½X©M»P¤¬Ápºô¤W¨ä¥L¤½¥q¦X§@·|¹ï¤½¥q±a¨Ó¤j¶q§Q¯q¡A¸`¬Ù®É¶¡©M¤H¤O¡C


\section{¨ä¥L¸ê®Æ®wªº¦W³æ}

¥H¤U¦C¥X¨ä¥L Unix¡BLinux ªº SQL ¸ê®Æ®w¡C
\begin{itemize}
\item  ÂI¿ï¤Î¨ì¹F Applications-{$>$}databases.
\nameurl{http://www.caldera.com/tech-ref/linuxapps/linapps.html}{}
\item  ÂI¿ï¤Î¨ì¹F Applications-{$>$}databases.
\nameurl{http://www.xnet.com/~blatura/linapps.shtml}{}
\item  ¸ê®Æ®w¸ê·½ \nameurl{http://linas.org/linux/db.html}{}
³o¬O¥Ñ Linas Vepstas ¼g¦¨ªº¡C
\onlynameurl{linas@fc.net}
\item  ¦Û¥Ñ¸ê®Æ®w¦W³æ
\nameurl{http://cuiwww.unige.ch:80/~scg/FreeDB/FreeDB.list.html}{}
\item  Browne ªº RDBMS ¦W³æ
\nameurl{http://www.hex.net/~cbbrowne/rdbms.html}{}
¥Ñ Christopher B. Browne ¼g¦¨¡C
\onlynameurl{cbbrowne@hex.net}
\item  SAL ÃöÁp¦¡ RDBMS ¦W³æ
\nameurl{http://SAL.KachinaTech.COM/H/1/}{}
\item  SAL ªºª«¥ó¾É¦V DBMS ¦W³æ
\nameurl{http://SAL.KachinaTech.COM/H/2/}{}
\item  SAL's ªº¤u¨ã©M¨ä¥L¸ê®Æ®w¦W³æ
\nameurl{http://SAL.KachinaTech.COM/H/3/}{}
\item  ACM SIGMOD ¤½²³¥i¨ú±oªº¸ê®Æ®w³n¥ó¯Á¤Þ
\nameurl{http://bunny.cs.uiuc.edu/sigmod/databaseSoftware/}{}
\end{itemize}



\section{¸Uºûºô·j´M´£¥Ü}

¤¬Ápºô«D±`¼sÁï¡A¾Ö¦³¤j¶q³n¥ó©M¤U¤è¦³¤@­Ó¸ê°T®ü¬v¡C
¥¦¦b¥þ¥@¬É¥H¨C¦~¦Ê¤À¤§¤T¦Êªº³t«×¼Wªø¡C¾Ú¦ô­p¡A¥þ²y¦³¤j¬ù¤@¤d¸U­Óºô¯¸¡I

­n·j´M¸ê®Æ¡A§A»Ý­n¶®ªê¡Bºô´º¡BLycos µ¥·j´M¤ÞÀº¡C¥h¨ì¶®ªê¡AÂI¿ï 
search¡C¨Ï¥Î¹LÂo¿ï¶µ (filtering options) ¨Ó¦¬¯¶§Aªº·j´M­n¨D¡C¹w³]ªº·j´M°Ê¥ó¬O
¡§Intelligent search¡¨¡A³o¤ñ¸û¤@¯ë¤Æ¤Î¦C¥X©Ò¦³¥i¯à©Ê¡CÂI¿ï¡§Options¡¨¿ï¾Ü
¡§EXACT phrase¡¨·j´M¡B¡§AND¡¨·j´M¡B¡§OR¡¨·j´Mµ¥µ¥¡C
³o¼Ë§A¥i§ó§Ö§ä¨ì§A·Q­nªº°T®§¡C¦¹¥~¡A¦b search ¥Ø¿ý¤U¡A¦³ radio buttons 
¥Î¥H¿ï¾Ü·j´M·s»D²Õ¡B¤¬Ápºô¯¸©Î¶®ªêºô¯¸¡C


\section{µ²½×}

¦b¬ã¨s¹L©Ò¦³{\bfseries ¦Û¥Ñ}©M¥i¨ú±o·½µ{¦¡½Xªº¸ê®Æ®w«á¡Aµo²{¨ì¥u¦³ PostgreSQL 
¬O¥@¤W³Ì¦¨¼ô¡B³Ì¦h¤H¨Ï¥Î©M¥þ­±ªº¦Û¥Ñ SQL RDMS¡]ª«¥óÃöÁp¦¡¡^¡C

PostgreSQL «D±`§l¤Þ¡A¦]¬°¦³«Ü¦h¤u§@¤w§¹¦¨¡C¥¦¦³ ODBC ©M JDBC 
ÅX°Êµ{¦¡¡AÄyµÛ³o¨Ç¡A¥i¥H½s¼g¿W¥ß©ó¸ê®Æ®wªºÀ³¥Îµ{¦¡¡C¥Î ODBC ©Î JDBC 
ÅX°Êµ{¦¡¼gªº PostgreSQL À³¥Îµ{¦¡«Ü®e©ö²¾´Ó¨ì¨ä¥L¸ê®Æ®w¡A¦p Oracle¡BSybase ©M 
Informix¡A¤Ï¤§¥çµM¡C

§A¥i¯à·|°Ý¡u¬°¤°»ò¥Î PostgreSQL¡H¡vµª®×¬O¦]¬°¥Ñ¹s¶}©l¡A
¶}µo¤@­Ó¸ê®Æ®w®ø¯Ó¤j¶q®É¶¡¡A¿ï¾Ü¤@­Óº¡¨¬¥H¤U±ø¥óªº¸ê®Æ®w¨t²Î¦X¥G±`ÃÑ¡J

¤@­Ó
\begin{itemize}
\item  ¥i¨ú±o­ìµ{¦¡½X¡X¥²¶·¬O¶}©ñµ{¦¡½X¨t²Î
\item  ¨S¦³ªþ¥[±ÂÅv¦r¥y (license string)¡B¨S¦³¾Ö¦³Åv¦r¥y¡]Ä¶«ö¡JPostgreSQL ¬O 
GPL¡A¨Ã«DµL±ÂÅv¨óÄ³¡C¦pªG¨S¦³±ÂÅv¦r¥y¡A¨Ï¥Î¥¦«K¹Hªk¤F¡I¡^
\item  ¥i¦b¤¬Ápºô´²§G
\item  ¤w¶}µo¦h¦~
\item  º¡¨¬ ISO/ANSI SQL 92¡]©M SQL 89¡^µ¥¼Ð·Ç
\item  ¥iº¡¨¬¥¼¨Óªº»Ý­n¡A¦p SQL 3¡]SQL 98¡^
\item  ¾Ö¦³¥ý¶i¥\¯à
\end{itemize}

ªº¸ê®Æ®w¨t²Î¡A¦Ó¥u¦³ PostgreSQL º¡¨¬©Ò¦³³o¨Ç±ø¥ó¡A¦b³o±¡ªp¤U¬O¤@®M¾A·íªº³n¥ó¡C
§A¥i¯à·|»¡¡¥PostgreSQL¡¦¬O¤@­Ó©Ç¦W¡C¦ý§Úªº¬Ýªk¬O¡X¬°¦ó§ï¦W¡H³o¥@¬É·|¥Ã»·¨Ï¥Î
¡§PostgreSQL¡¨¡I¡I


\section{FAQ¡X¦³Ãö PostgreSQL ªº°ÝÃD}

½Ð°Ñ¾\¤@¯ë©Ê¡BLinux ©M Irix ªº³Ì·sª© FAQ¡J
\begin{itemize}
\item  \nameurl{http://www.postgresql.org/docs/faq-english.shtml}{}
\end{itemize}



\section{¥»¤å¥óªº¨ä¥L®æ¦¡}

¥»¤å¥ó¥H¤Q¤@ºØ¤£¦Pªº®æ¦¡¥Xª©¡X¡XDVI¡BPostscript¡BLaTeX¡BLyX¡BGNU-info¡BHTML¡BRTF
¡]Rich Text Format¡^¡B¯Â¤å¦r¡BUnix man pages ©M SGML¡C
\begin{itemize}
\item §A¥i¦b \nameurl{ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/other-formats/}{} 
¨ú±o¥H HTML¡BDVI¡BPostscript ©Î SGML ®æ¦¡¼g¦¨ªº³æ¤@ tar.gz ÀÉ¡C
¡]Ä¶«ö¡Jsunsite.unc.edu ¦­¤w§ï¦W¬° metalab.unc.edu¡C¡^
\item ¯Â¤å¦rÀÉ¦b¡J\nameurl{ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO}{}
\item ¨ä¥L»y¨¥ªºÂ½Ä¶¡A¦pªk¤å¡B¼w¤å¡B¦è¯Z¤ú¤å¡B¤¤¤å¡B¤é¤å¦ì©ó 
\nameurl{ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO}{}
§Ú¹ïÂ½Ä¶¨ì¥ô¦ó¨ä¥L»y¨¥ªºÀ°§UµL¥ôÅwªï¡C
\end{itemize}


¥»¤å¥ó¥H¤@­Ó¦W¬°¡§SGML-Tools¡¨ªº¤u¨ã¼g¦¨¡A¥¦¥i¦b¥H¤U¦a¤è§ä¨ì¡J
\nameurl{http://www.sgmltools.org}{}
½sÄ¶µ{¦¡«á§A·|±o¨ìÃþ¦ü¥H¤Uªº«ü¥O¡J
\begin{itemize}
\item sgml2html databasehowto.sgml     ¡]²£¥Í HTML ÀÉ¡^
\item sgml2rtf  databasehowto.sgml     ¡]²£¥Í RTF ÀÉ¡^
\item sgml2latex databasehowto.sgml    ¡]²£¥Í LaTeX ÀÉ¡^
\end{itemize}


LaTeX ¤å¥ó¥iÂà´«¬° PHP ÀÉ¡A¥u»Ý¨Ï¥Î {\bfseries sgml2latex}¡]©M dvips¡^²£¥Í
Postscript ¿é¥X¡A¤Î¥Î Acrobat {\bfseries distill}¡]\nameurl{http://www.adobe.com}{}¡^³B²z¸Ó¿é¥X¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash$ man sgml2latex
bash$ sgml2latex filename.sgml
bash$ man dvips
bash$ dvips -o filename.ps filename.dvi
bash$ distill filename.ps
bash$ man ghostscript
bash$ man ps2pdf
bash$ ps2pdf input.ps output.pdf
bash$ acroread output.pdf &
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}

§A¤]¥i¥Î Ghostscript «ü¥O {\bfseries ps2pdf}¡Cps2pdf ´£¨Ñ¤F Adobe ©M Acrobat
Distiller ²£«~ªº´X¥G©Ò¦³¥\¯à¡J¥¦§â PostScript ÀÉÂà¬° Portable Document Format
(PDF) ÀÉ¡C{\bfseries ps2pdf} ¨Ï¥Î¤F¤@­Ó²Ó¤pªº©R¥O½Z¡]§å¦¸ÀÉ¡^¡A¥¦±Ò°Ê
Ghostscript¡A¬D¿ï¤@­Ó¦W¬° {\bfseries pdfwrite} ªº¯S®í¡§¿é¥X³]³Æ¡¨¡C­n¨Ï¥Î
ps2pdf¡Apdfwrite ³]³Æ»Ý¦b½sÄ¶ Ghostscript ®É¦b makefile ¤¤«ü©w¡F¸Ô±¡½Ð°Ñ¾\
Ghostscript ½sÄ¶ªº¤å¥ó¡C

¥»¤å¥ó¦ì©ó¡J
\begin{itemize}
\item  \nameurl{http://sunsite.unc.edu/LDP/HOWTO/PostgreSQL-HOWTO.html}{}
\end{itemize}


§A¤]¥i¦b¥H¤U¬M®g¯¸¥x§ä¨ì¥»¤å¥ó¡J
\begin{itemize}
\item  \nameurl{http://www.caldera.com/LDP/HOWTO/PostgreSQL-HOWTO.html}{}
\item  \nameurl{http://www.WGS.com/LDP/HOWTO/PostgreSQL-HOWTO.html}{}
\item  \nameurl{http://www.cc.gatech.edu/linux/LDP/HOWTO/PostgreSQL-HOWTO.html}{}
\item  \nameurl{http://www.redhat.com/linux-info/ldp/HOWTO/PostgreSQL-HOWTO.html}{}
\item  ¨ä¥L¦b§Aªþªñ¡]¥Hºôµ¸¦ì§}¨Ó»¡¡^ªº¯¸¥x¥i¦b \nameurl{http://sunsite.unc.edu/LDP/hmirrors.html}{} §ä¨ì¡A¿ï¾Ü¤@­Óºô¯¸©M¨ì
/LDP/HOWTO/PostgreSQL-HOWTO.html ¥Ø¿ý¡C
\end{itemize}

¡]Ä¶«ö¡J¥»¤å¥óªº¤¤¤å¡e¤j¤­½X¡fª©¥i¦b\nameurl{http://www.linux.org.tw/CLDP/HOWTO/}{} §ä¨ì¡C¦Ó­n²£¥Í¤¤¤å¤å¥ó¡A§A»Ý­n 
bg5sgmltools¡A¥i¦b \nameurl{http://www.linux.org.tw/CLDP/}{} §ä¨ì¡C¡^

­nÆ[¬Ý dvi ®æ¦¡ªº¤å¥ó¡A¨Ï¥Î xdvi µ{¦¡¡C¦b Redhat Linux ¤¤¡A§A¥i³z¹L 
ControlPanel $|$ Applications $|$ Publishing $|$ TeX «ö¶s§ä¨ì tetex-xdvi*.rpm 
®M¥ó¡A·í¤¤§Y¬° xdvi µ{¦¡¡C

­n¾\Åª dvi ¤å¥ó¡A°õ¦æ«ü¥O¡J
\begin{tscreen}
\begin{verbatim}
        xdvi -geometry 80x90 howto.dvi
        man xdvi
\end{verbatim}
\end{tscreen}

©M¨Ï¥Î·Æ¹«½Õ¾ãµøµ¡¤j¤p¡CÂsÄý®É¨Ï¥Î½bÀYÁä¡BPage Up¡BPage Down Áä¡A§A¤]¥i¥Î
'f', 'd', 'u',  'c', 'l', 'r', 'p', 'n' ¦r¥À¨Ó²¾¤W¡B²¾¤U¡B¸m¤¤¡B¨ì«e«á­¶µ¥µ¥¡C
­nÃö±¼ expert menu¡A«ö 'x'¡C

§A¥i¥Îµ{¦¡ 'gv' (ghostview) ©Î 'ghostscript' ¨Ó¾\Åª postscript ÀÉ¡C¦b RedHat 
Linux ¤¤¡Aghostscript µ{¦¡¬O¦b ghostscript*.rpm ®M¥ó¡Agv «h¦b gv*.rpm¡C§A¥i³z¹L
ControlPanel $|$ Applications $|$ Graphics «ö¶s§ä¨ì¥¦­Ì¡Cgv µ{¦¡¤ñ ghostscript 
©ö¥Î±o¦h¡Cghostscript ©M gv ¤]¥i¦b¨ä¥L¥­¥x¡A¦p OS/2¡Bµøµ¡ 95 ¤Î NT 
±o¨ì¡A§A¤]¥i¦b³o¨Ç¥­¥x¾\Åª¥»¤å¥ó¡C

\begin{itemize}
\item ¦b \nameurl{http://www.cs.wisc.edu/~ghost}{} ¨ú±o ghostscript ªºµøµ¡
95¡BOS/2 ©M¨ä¥L§@·~¨t²Îªºª©¥»¡C
\end{itemize}


­n¾\Åª postscript ¤å¥ó¡A°õ¦æ«ü¥O¡X
\begin{tscreen}
\begin{verbatim}
                gv howto.ps
                ghostscript howto.ps
\end{verbatim}
\end{tscreen}

{\bfseries ª`·N¡J}¥»¤å¥ó«Üªø¡A¦pªG§A·Q¦L¥X³o postscript ÀÉ¡A¤j¬ù»Ý­n 113 ­¶¡C
¡]Ä¶«ö¡Jgv ¬O ghostscript ªº¤@­Ó«eºÝ¬É­±¡A©Ò¥H§Y¨Ï§A¥u¥´ºâ¥Î 
gv¡A§A¤]­n¦w¸Ë«áªÌ¡C¦¹¥~¡A¦b OS/2 ©Mµøµ¡¤¤¨Ã¨S¦³ gv¡A¥u¦³ GSView¡A¤@­Ó©M gv 
¥\¯à®t¤£¦hªºµ{¦¡¡C¸Ô±¡½Ð°ÑÃö \nameurl{http://www.cs.wisc.edu/~ghost}{}¡C¡^



§A¥i¨Ï¥Î Netscape Navigator¡AMicrosoft Internet Explorer¡ARedhat Baron Web 
Browser ©Î¥ô¦ó¨ä¥Lªº¸UºûºôÂsÄý¾¹¨Ó¾\Åª HTML ®æ¦¡ªº¤å¥ó¡C

§A¥i¥Î LyX¡ALaTeX ªº¤@­Ó X-Window «eºÝ¤¶­±¨Ó¾\Åª LaTeX ©M LyX ÀÉ¡C




\section{ª©Åv©M±ÂÅv}

Copyright Al Dev (Alavoor Vasudevan) 1997-2000.

Copyright policy is GNU/GPL as per LDP (Linux Documentation project).
LDP is a GNU/GPL project.
Additional restrictions are - you must retain the author's name, email address
and this copyright notice on all the copies. If you make any changes 
or additions to this document then you should 
intimate all the authors of this document.

NO LIABILITY FOR CONSEQUENTIAL DAMAGES. In no event 
shall the author/authors of this document be liable for any 
damages whatsoever (including without limitation,
special, incidental, consequential, or direct/indirect damages for personal
injury, loss of business profits, business
interruption, loss of business information, or any other pecuniary loss)
arising out of the use of this document. 

Author/authors offers no warranties or guarantees on fitness, usability, 
merchantability of this document. Brands, companies and product names 
mentioned in this document are 
trademarks or registered trademarks of their respective holders.
Please refer to individual copyright notices of brands, companies and
products mentioned in this document. It is your responsibility to read and 
understand the copyright notices of the organisations/companies/products/authors
mentioned in this document before using their respective information.


 \appendix 

\section{ªþ¿ý¥Ò¡XANSI/ISO SQL 1992 »yªk \label{Appendix A}}

³oÀÉ®×¤¤¥]¬A³o»y¨¥ªº BNF ¥H²`«×¬°¥ýªº¾ðª¬¼Ò±½ (depth-first tree 
traversal)¡A¤j¬ù¦b 27-AUG-1992 11:03:41.64 §¹¦¨¡C³o­Ó¯S©wª©¥»©Ò¥Îªº BNF 
¬O¥u¥Î ANSI ©M SQL2 ªº¡C
\begin{tscreen}
\begin{verbatim}


<SQL terminal character> ::=
      <SQL language character>
    | <SQL embedded language character>

<SQL language character> ::=
      <simple Latin letter>
    | <digit>
    | <SQL special character>

<simple Latin letter> ::=
      <simple Latin upper case letter>
    | <simple Latin lower case letter>

<simple Latin upper case letter> ::=
          A | B | C | D | E | F | G | H | I | J | K | L | M | N | O
    | P | Q | R | S | T | U | V | W | X | Y | Z

<simple Latin lower case letter> ::=
          a | b | c | d | e | f | g | h | i | j | k | l | m | n | o
    | p | q | r | s | t | u | v | w | x | y | z

<digit> ::=
    0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

<SQL special character> ::=
      <space>
    | <double quote>
    | <percent>
    | <ampersand>
    | <quote>
    | <left paren>
    | <right paren>
    | <asterisk>
    | <plus sign>
    | <comma>
    | <minus sign>
    | <period>
    | <solidus>
    | <colon>
    | <semicolon>
    | <less than operator>
    | <equals operator>
    | <greater than operator>
    | <question mark>
    | <underscore>
    | <vertical bar>

<space> ::= !! <EMPHASIS>¡]¨Ï¥Î¤¤ªº¦r¶°©Ò¥ÎªºªÅ¥Õ¦r¤¸¡^

<double quote> ::= "

<percent> ::= %

<ampersand> ::= &

<quote> ::= '

<left paren> ::= (

<right paren> ::= )

<asterisk> ::= *

<plus sign> ::= +

<comma> ::= ,

<minus sign> ::= -

<period> ::= .

<solidus> ::= /

<colon> ::= :

<semicolon> ::= ;

<less than operator> ::= <

<equals operator> ::= =

<greater than operator> ::= >

<question mark> ::= ?

<underscore> ::= _

<vertical bar> ::= |

<SQL embedded language character> ::=
      <left bracket>
    | <right bracket>

<left bracket> ::= [

<right bracket> ::= ]

<token> ::=
      <nondelimiter token>
    | <delimiter token>

<nondelimiter token> ::=
      <regular identifier>
    | <key word>
    | <unsigned numeric literal>
    | <national character string literal>
    | <bit string literal>
    | <hex string literal>

<regular identifier> ::= <identifier body>

<identifier body> ::=
    <identifier start> [ ( <underscore> | <identifier part> )... ]

<identifier start> ::= <EMPHASIS>¡]!! °Ñ¬Ý¤åªk³W«h¡^

<identifier part> ::=
      <identifier start>
    | <digit>

<key word> ::=
      <reserved word>
    | <non-reserved word>

<reserved word> ::=
      ABSOLUTE | ACTION | ADD | ALL
    | ALLOCATE | ALTER | AND
    | ANY | ARE
    | AS | ASC
    | ASSERTION | AT
    | AUTHORIZATION | AVG
    | BEGIN | BETWEEN | BIT | BIT_LENGTH
    | BOTH | BY
    | CASCADE | CASCADED | CASE | CAST
    | CATALOG
    | CHAR | CHARACTER | CHAR_LENGTH
    | CHARACTER_LENGTH | CHECK | CLOSE | COALESCE
    | COLLATE | COLLATION
    | COLUMN | COMMIT
    | CONNECT
    | CONNECTION | CONSTRAINT
    | CONSTRAINTS | CONTINUE
    | CONVERT | CORRESPONDING | COUNT | CREATE | CROSS
    | CURRENT
    | CURRENT_DATE | CURRENT_TIME
    | CURRENT_TIMESTAMP | CURRENT_USER | CURSOR
    | DATE | DAY | DEALLOCATE | DEC
    | DECIMAL | DECLARE | DEFAULT | DEFERRABLE
    | DEFERRED | DELETE | DESC | DESCRIBE | DESCRIPTOR
    | DIAGNOSTICS
    | DISCONNECT | DISTINCT | DOMAIN | DOUBLE | DROP
    | ELSE | END | END-EXEC | ESCAPE
    | EXCEPT | EXCEPTION
    | EXEC | EXECUTE | EXISTS
    | EXTERNAL | EXTRACT
    | FALSE | FETCH | FIRST | FLOAT | FOR
    | FOREIGN | FOUND | FROM | FULL
    | GET | GLOBAL | GO | GOTO
    | GRANT | GROUP
    | HAVING | HOUR
    | IDENTITY | IMMEDIATE | IN | INDICATOR
    | INITIALLY | INNER | INPUT
    | INSENSITIVE | INSERT | INT | INTEGER | INTERSECT
    | INTERVAL | INTO | IS
    | ISOLATION
    | JOIN
    | KEY
    | LANGUAGE | LAST | LEADING | LEFT
    | LEVEL | LIKE | LOCAL | LOWER
    | MATCH | MAX | MIN | MINUTE | MODULE
    | MONTH
    | NAMES | NATIONAL | NATURAL | NCHAR | NEXT | NO
    | NOT | NULL
    | NULLIF | NUMERIC
    | OCTET_LENGTH | OF
    | ON | ONLY | OPEN | OPTION | OR
    | ORDER | OUTER
    | OUTPUT | OVERLAPS
    | PAD | PARTIAL | POSITION | PRECISION | PREPARE
    | PRESERVE | PRIMARY
    | PRIOR | PRIVILEGES | PROCEDURE | PUBLIC
    | READ | REAL | REFERENCES | RELATIVE | RESTRICT
    | REVOKE | RIGHT
    | ROLLBACK | ROWS
    | SCHEMA | SCROLL | SECOND | SECTION
    | SELECT
    | SESSION | SESSION_USER | SET
    | SIZE | SMALLINT | SOME | SPACE | SQL | SQLCODE
    | SQLERROR | SQLSTATE
    | SUBSTRING | SUM | SYSTEM_USER
    | TABLE | TEMPORARY
    | THEN | TIME | TIMESTAMP
    | TIMEZONE_HOUR | TIMEZONE_MINUTE
    | TO | TRAILING | TRANSACTION
    | TRANSLATE | TRANSLATION | TRIM | TRUE
    | UNION | UNIQUE | UNKNOWN | UPDATE | UPPER | USAGE
    | USER | USING
    | VALUE | VALUES | VARCHAR | VARYING | VIEW
    | WHEN | WHENEVER | WHERE | WITH | WORK | WRITE
    | YEAR
    | ZONE

<non-reserved word> ::=

      ADA
    | C | CATALOG_NAME
    | CHARACTER_SET_CATALOG | CHARACTER_SET_NAME
    | CHARACTER_SET_SCHEMA | CLASS_ORIGIN | COBOL | COLLATION_CATALOG
    | COLLATION_NAME | COLLATION_SCHEMA | COLUMN_NAME | COMMAND_FUNCTION
    | COMMITTED
    | CONDITION_NUMBER | CONNECTION_NAME | CONSTRAINT_CATALOG | CONSTRAINT_NAME
    | CONSTRAINT_SCHEMA | CURSOR_NAME
    | DATA | DATETIME_INTERVAL_CODE
    | DATETIME_INTERVAL_PRECISION | DYNAMIC_FUNCTION
    | FORTRAN
    | LENGTH
    | MESSAGE_LENGTH | MESSAGE_OCTET_LENGTH | MESSAGE_TEXT | MORE | MUMPS
    | NAME | NULLABLE | NUMBER
    | PASCAL | PLI
    | REPEATABLE | RETURNED_LENGTH | RETURNED_OCTET_LENGTH | RETURNED_SQLSTATE
    | ROW_COUNT
    | SCALE | SCHEMA_NAME | SERIALIZABLE | SERVER_NAME | SUBCLASS_ORIGIN
    | TABLE_NAME | TYPE
    | UNCOMMITTED | UNNAMED

<unsigned numeric literal> ::=
      <exact numeric literal>
    | <approximate numeric literal>

<exact numeric literal> ::=
      <unsigned integer> [ <period> [ <unsigned integer> ] ]
    | <period> <unsigned integer>

<unsigned integer> ::= <digit>...

<approximate numeric literal> ::= <mantissa> E <exponent>

<mantissa> ::= <exact numeric literal>

<exponent> ::= <signed integer>

<signed integer> ::= [ <sign> ] <unsigned integer>

<sign> ::= <plus sign> | <minus sign>

<national character string literal> ::=
    N <quote> [ <character representation>... ] <quote>
      [ ( <separator>... <quote> [ <character representation>... ] <quote> )... ]

<character representation> ::=
      <nonquote character>
    | <quote symbol>

<nonquote character> ::= !! <EMPHASIS>¡]!! °Ñ¬Ý¤åªk³W«h¡^
   
<quote symbol> ::= <quote><quote>

<separator> ::= ( <comment> | <space> | <newline> )...

<comment> ::=
    <comment introducer> [ <comment character>... ] <newline>

<comment introducer> ::= <minus sign><minus sign>[<minus sign>...]

<comment character> ::=
      <nonquote character>
    | <quote>

<newline> ::= !! <EMPHASIS>¡]¹ê½î¤èªk©w¸qªº¦æ¥½«ü¥Ü¡^


<bit string literal> ::=
    B <quote> [ <bit>... ] <quote>
      [ ( <separator>... <quote> [ <bit>... ] <quote> )... ]

<bit> ::= 0 | 1

<hex string literal> ::=
    X <quote> [ <hexit>... ] <quote>
      [ ( <separator>... <quote> [ <hexit>... ] <quote> )... ]

<hexit> ::= <digit> | A | B | C | D | E | F | a | b | c | d | e | f

<delimiter token> ::=
      <character string literal>
    | <date string>
    | <time string>
    | <timestamp string>
    | <interval string>
    | <delimited identifier>
    | <SQL special character>
    | <not equals operator>
    | <greater than or equals operator>
    | <less than or equals operator>
    | <concatenation operator>
    | <double period>
    | <left bracket>
    | <right bracket>

<character string literal> ::=
    [ <introducer><character set specification> ]
    <quote> [ <character representation>... ] <quote>
      [ ( <separator>... <quote> [ <character representation>... ] <quote> )... ]

<introducer> ::= <underscore>

<character set specification> ::=
      <standard character repertoire name>
    | <implementation-defined character repertoire name>
    | <user-defined character repertoire name>
    | <standard universal character form-of-use name>
    | <implementation-defined universal character form-of-use name>

<standard character repertoire name> ::= <character set name>

<character set name> ::= [ <schema name> <period> ]
      <SQL language identifier>

<schema name> ::=
    [ <catalog name> <period> ] <unqualified schema name>

<catalog name> ::= <identifier>

<identifier> ::=
    [ <introducer><character set specification> ] <actual identifier>

<actual identifier> ::=
      <regular identifier>
    | <delimited identifier>

<delimited identifier> ::=
    <double quote> <delimited identifier body> <double quote>

<delimited identifier body> ::= <delimited identifier part>...

<delimited identifier part> ::=
      <nondoublequote character>
    | <doublequote symbol>

<nondoublequote character> ::= <EMPHASIS>¡]!! °Ñ¬Ý¤åªk³W«h¡^

<doublequote symbol> ::= <double quote><double quote>

<unqualified schema name> ::= <identifier>

<SQL language identifier> ::=
    <SQL language identifier start>
       [ ( <underscore> | <SQL language identifier part> )... ]

<SQL language identifier start> ::= <simple Latin letter>

<SQL language identifier part> ::=
      <simple Latin letter>
    | <digit>

<implementation-defined character repertoire name> ::=
    <character set name>

<user-defined character repertoire name> ::= <character set name>

<standard universal character form-of-use name> ::=
    <character set name>

<implementation-defined universal character form-of-use name> ::=
    <character set name>

<date string> ::=
    <quote> <date value> <quote>

<date value> ::=
    <years value> <minus sign> <months value>
        <minus sign> <days value>

<years value> ::= <datetime value>

<datetime value> ::= <unsigned integer>

<months value> ::= <datetime value>

<days value> ::= <datetime value>

<time string> ::=
    <quote> <time value> [ <time zone interval> ] <quote>

<time value> ::=
    <hours value> <colon> <minutes value> <colon> <seconds value>

<hours value> ::= <datetime value>

<minutes value> ::= <datetime value>

<seconds value> ::=
      <seconds integer value> [ <period> [ <seconds fraction> ] ]

<seconds integer value> ::= <unsigned integer>

<seconds fraction> ::= <unsigned integer>

<time zone interval> ::=
    <sign> <hours value> <colon> <minutes value>

<timestamp string> ::=
    <quote> <date value> <space> <time value>
        [ <time zone interval> ] <quote>

<interval string> ::=
    <quote> ( <year-month literal> | <day-time literal> ) <quote>

<year-month literal> ::=
      <years value>
    | [ <years value> <minus sign> ] <months value>

<day-time literal> ::=
      <day-time interval>
    | <time interval>

<day-time interval> ::=
    <days value>
      [ <space> <hours value> [ <colon> <minutes value>
        [ <colon> <seconds value> ] ] ]

<time interval> ::=
      <hours value> [ <colon> <minutes value> [ <colon> <seconds value> ] ]
    | <minutes value> [ <colon> <seconds value> ]
    | <seconds value>

<not equals operator> ::= <>

<greater than or equals operator> ::= >=

<less than or equals operator> ::= <=

<concatenation operator> ::= ||

<double period> ::= ..

<module> ::=
    <module name clause>
    <language clause>
    <module authorization clause>
    [ <temporary table declaration>... ]
    <module contents>...

<module name clause> ::=
    MODULE [ <module name> ]
      [ <module character set specification> ]

<module name> ::= <identifier>

<module character set specification> ::=
    NAMES ARE <character set specification>

<language clause> ::=
    LANGUAGE <language name>

<language name> ::=
    ADA | C | COBOL | FORTRAN | MUMPS | PASCAL | PLI

<module authorization clause> ::=
      SCHEMA <schema name>
    | AUTHORIZATION <module authorization identifier>
    | SCHEMA <schema name>
          AUTHORIZATION <module authorization identifier>

<module authorization identifier> ::=
    <authorization identifier>

<authorization identifier> ::= <identifier>

<temporary table declaration> ::=
    DECLARE LOCAL TEMPORARY TABLE
        <qualified local table name>
      <table element list>
      [ ON COMMIT ( PRESERVE | DELETE ) ROWS ]

<qualified local table name> ::=
    MODULE <period> <local table name>

<local table name> ::= <qualified identifier>

<qualified identifier> ::= <identifier>

<table element list> ::=
      <left paren> <table element> [ ( <comma> <table element> )... ] <right paren>

<table element> ::=
      <column definition>
    | <table constraint definition>

<column definition> ::=
    <column name> ( <data type> | <domain name> )
    [ <default clause> ]
    [ <column constraint definition>... ]
    [ <collate clause> ]

<column name> ::= <identifier>

<data type> ::=
      <character string type>
           [ CHARACTER SET <character set specification> ]
    | <national character string type>
    | <bit string type>
    | <numeric type>
    | <datetime type>
    | <interval type>

<character string type> ::=
      CHARACTER [ <left paren> <length> <right paren> ]
    | CHAR [ <left paren> <length> <right paren> ]
    | CHARACTER VARYING <left paren> <length> <right paren>
    | CHAR VARYING <left paren> <length> <right paren>
    | VARCHAR <left paren> <length> <right paren>

<length> ::= <unsigned integer>

<national character string type> ::=
      NATIONAL CHARACTER [ <left paren> <length> <right paren> ]
    | NATIONAL CHAR [ <left paren> <length> <right paren> ]
    | NCHAR [ <left paren> <length> <right paren> ]
    | NATIONAL CHARACTER VARYING <left paren> <length> <right paren>
    | NATIONAL CHAR VARYING <left paren> <length> <right paren>
    | NCHAR VARYING <left paren> <length> <right paren>

<bit string type> ::=
      BIT [ <left paren> <length> <right paren> ]
    | BIT VARYING <left paren> <length> <right paren>

<numeric type> ::=
      <exact numeric type>
    | <approximate numeric type>

<exact numeric type> ::=
      NUMERIC [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
    | DECIMAL [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
    | DEC [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
    | INTEGER
    | INT
    | SMALLINT

<precision> ::= <unsigned integer>

<scale> ::= <unsigned integer>

<approximate numeric type> ::=
      FLOAT [ <left paren> <precision> <right paren> ]
    | REAL
    | DOUBLE PRECISION

<datetime type> ::=
      DATE
    | TIME [ <left paren> <time precision> <right paren> ]
          [ WITH TIME ZONE ]
    | TIMESTAMP [ <left paren> <timestamp precision> <right paren> ]
          [ WITH TIME ZONE ]

<time precision> ::= <time fractional seconds precision>

<time fractional seconds precision> ::= <unsigned integer>

<timestamp precision> ::= <time fractional seconds precision>

<interval type> ::= INTERVAL <interval qualifier>

<interval qualifier> ::=
      <start field> TO <end field>
    | <single datetime field>

<start field> ::=
    <non-second datetime field>
        [ <left paren> <interval leading field precision> <right paren> ]

<non-second datetime field> ::= YEAR | MONTH | DAY | HOUR
    | MINUTE

<interval leading field precision> ::= <unsigned integer>

<end field> ::=
      <non-second datetime field>
    | SECOND [ <left paren> <interval fractional seconds precision> <right paren> ]

<interval fractional seconds precision> ::= <unsigned integer>

<single datetime field> ::=
      <non-second datetime field>
          [ <left paren> <interval leading field precision> <right paren> ]
    | SECOND [ <left paren> <interval leading field precision>
          [ <comma> <interval fractional seconds precision> ] <right paren> ]

<domain name> ::= <qualified name>

<qualified name> ::=
    [ <schema name> <period> ] <qualified identifier>

<default clause> ::=
      DEFAULT <default option>

<default option> ::=
      <literal>
    | <datetime value function>
    | USER
    | CURRENT_USER
    | SESSION_USER
    | SYSTEM_USER
    | NULL

<literal> ::=
      <signed numeric literal>
    | <general literal>

<signed numeric literal> ::=
    [ <sign> ] <unsigned numeric literal>

<general literal> ::=
      <character string literal>
    | <national character string literal>
    | <bit string literal>
    | <hex string literal>
    | <datetime literal>
    | <interval literal>

<datetime literal> ::=
      <date literal>
    | <time literal>
    | <timestamp literal>

<date literal> ::=
    DATE <date string>

<time literal> ::=
    TIME <time string>

<timestamp literal> ::=
    TIMESTAMP <timestamp string>

<interval literal> ::=
    INTERVAL [ <sign> ] <interval string> <interval qualifier>

<datetime value function> ::=
      <current date value function>
    | <current time value function>
    | <current timestamp value function>

<current date value function> ::= CURRENT_DATE

<current time value function> ::=
      CURRENT_TIME [ <left paren> <time precision> <right paren> ]

<current timestamp value function> ::=
      CURRENT_TIMESTAMP [ <left paren> <timestamp precision> <right paren> ]

<column constraint definition> ::=
    [ <constraint name definition> ]
    <column constraint>
      [ <constraint attributes> ]

<constraint name definition> ::= CONSTRAINT <constraint name>

<constraint name> ::= <qualified name>

<column constraint> ::=
      NOT NULL
    | <unique specification>
    | <references specification>
    | <check constraint definition>

<unique specification> ::=
    UNIQUE | PRIMARY KEY

<references specification> ::=
    REFERENCES <referenced table and columns>
      [ MATCH <match type> ]
      [ <referential triggered action> ]

<referenced table and columns> ::=
     <table name> [ <left paren> <reference column list> <right paren> ]

<table name> ::=
      <qualified name>
    | <qualified local table name>

<reference column list> ::= <column name list>

<column name list> ::=
    <column name> [ ( <comma> <column name> )... ]

<match type> ::=
      FULL
    | PARTIAL

<referential triggered action> ::=
      <update rule> [ <delete rule> ]
    | <delete rule> [ <update rule> ]

<update rule> ::= ON UPDATE <referential action>

<referential action> ::=
      CASCADE
    | SET NULL
    | SET DEFAULT
    | NO ACTION

<delete rule> ::= ON DELETE <referential action>

<check constraint definition> ::=
    CHECK
        <left paren> <search condition> <right paren>

<search condition> ::=
      <boolean term>
    | <search condition> OR <boolean term>

<boolean term> ::=
      <boolean factor>
    | <boolean term> AND <boolean factor>

<boolean factor> ::=
    [ NOT ] <boolean test>

<boolean test> ::=
    <boolean primary> [ IS [ NOT ]
          <truth value> ]

<boolean primary> ::=
      <predicate>
    | <left paren> <search condition> <right paren>

<predicate> ::=
      <comparison predicate>
    | <between predicate>
    | <in predicate>
    | <like predicate>
    | <null predicate>
    | <quantified comparison predicate>
    | <exists predicate>
    | <unique predicate>
    | <match predicate>
    | <overlaps predicate>

<comparison predicate> ::=
    <row value constructor> <comp op>
        <row value constructor>

<row value constructor> ::=
       <row value constructor element>
    | <left paren> <row value constructor list> <right paren>
    | <row subquery>

<row value constructor element> ::=
      <value expression>
    | <null specification>
    | <default specification>

<value expression> ::=
      <numeric value expression>
    | <string value expression>
    | <datetime value expression>
    | <interval value expression>

<numeric value expression> ::=
      <term>
    | <numeric value expression> <plus sign> <term>
    | <numeric value expression> <minus sign> <term>

<term> ::=
      <factor>
    | <term> <asterisk> <factor>
    | <term> <solidus> <factor>

<factor> ::=
    [ <sign> ] <numeric primary>

<numeric primary> ::=
      <value expression primary>
    | <numeric value function>

<value expression primary> ::=
      <unsigned value specification>
    | <column reference>
    | <set function specification>
    | <scalar subquery>
    | <case expression>
    | <left paren> <value expression> <right paren>
    | <cast specification>

<unsigned value specification> ::=
      <unsigned literal>
    | <general value specification>

<unsigned literal> ::=
      <unsigned numeric literal>
    | <general literal>

<general value specification> ::=
      <parameter specification>
    | <dynamic parameter specification>
    | <variable specification>
    | USER
    | CURRENT_USER
    | SESSION_USER
    | SYSTEM_USER
    | VALUE

<parameter specification> ::=
    <parameter name> [ <indicator parameter> ]

<parameter name> ::= <colon> <identifier>

<indicator parameter> ::=
    [ INDICATOR ] <parameter name>

<dynamic parameter specification> ::= <question mark>

<variable specification> ::=
    <embedded variable name> [ <indicator variable> ]

<embedded variable name> ::=
    <colon><host identifier>

<host identifier> ::=
      <Ada host identifier>
    | <C host identifier>
    | <COBOL host identifier>
    | <Fortran host identifier>
    | <MUMPS host identifier>
    | <Pascal host identifier>
    | <PL/I host identifier>

<Ada host identifier> ::= !! <EMPHASIS>¡]°Ñ¬Ý¤åªk³W«h¡^

<C host identifier> ::=
    !! <EMPHASIS>¡]°Ñ¬Ý¤åªk³W«h¡^

<COBOL host identifier> ::= !! <EMPHASIS>¡]°Ñ¬Ý¤åªk³W«h¡^

<Fortran host identifier> ::= !! <EMPHASIS>¡]°Ñ¬Ý¤åªk³W«h¡^

<MUMPS host identifier> ::= !! <EMPHASIS>¡]°Ñ¬Ý¤åªk³W«h¡^

<Pascal host identifier> ::= !! <EMPHASIS>¡]°Ñ¬Ý¤åªk³W«h¡^

<PL/I host identifier> ::= !! <EMPHASIS>¡]°Ñ¬Ý¤åªk³W«h¡^

<indicator variable> ::=
    [ INDICATOR ] <embedded variable name>

<column reference> ::= [ <qualifier> <period> ] <column name>

<qualifier> ::=
      <table name>
    | <correlation name>

<correlation name> ::= <identifier>

<set function specification> ::=
      COUNT <left paren> <asterisk> <right paren>
    | <general set function>

<general set function> ::=
      <set function type>
          <left paren> [ <set quantifier> ] <value expression> <right paren>

<set function type> ::=
    AVG | MAX | MIN | SUM | COUNT

<set quantifier> ::= DISTINCT | ALL

<scalar subquery> ::= <subquery>

<subquery> ::= <left paren> <query expression> <right paren>

<query expression> ::=
      <non-join query expression>
    | <joined table>

<non-join query expression> ::=
      <non-join query term>
    | <query expression> UNION  [ ALL ]
          [ <corresponding spec> ] <query term>
    | <query expression> EXCEPT [ ALL ]
          [ <corresponding spec> ] <query term>

<non-join query term> ::=
      <non-join query primary>
    | <query term> INTERSECT [ ALL ]
          [ <corresponding spec> ] <query primary>

<non-join query primary> ::=
      <simple table>
    | <left paren> <non-join query expression> <right paren>

<simple table> ::=
      <query specification>
    | <table value constructor>
    | <explicit table>

<query specification> ::=
    SELECT [ <set quantifier> ] <select list> <table expression>

<select list> ::=
      <asterisk>
    | <select sublist> [ ( <comma> <select sublist> )... ]

<select sublist> ::=
      <derived column>
    | <qualifier> <period> <asterisk>

<derived column> ::= <value expression> [ <as clause> ]

<as clause> ::= [ AS ] <column name>

<table expression> ::=
    <from clause>
    [ <where clause> ]
    [ <group by clause> ]
    [ <having clause> ]

<from clause> ::= FROM <table reference>
    [ ( <comma> <table reference> )... ]

<table reference> ::=
      <table name> [ [ AS ] <correlation name>
          [ <left paren> <derived column list> <right paren> ] ]
    | <derived table> [ AS ] <correlation name>
          [ <left paren> <derived column list> <right paren> ]
    | <joined table>

<derived column list> ::= <column name list>

<derived table> ::= <table subquery>

<table subquery> ::= <subquery>

<joined table> ::=
      <cross join>
    | <qualified join>
    | <left paren> <joined table> <right paren>

<cross join> ::=
    <table reference> CROSS JOIN <table reference>

<qualified join> ::=
    <table reference> [ NATURAL ] [ <join type> ] JOIN
      <table reference> [ <join specification> ]

<join type> ::=
      INNER
    | <outer join type> [ OUTER ]
    | UNION

<outer join type> ::=
      LEFT
    | RIGHT
    | FULL

<join specification> ::=
      <join condition>
    | <named columns join>

<join condition> ::= ON <search condition>

<named columns join> ::=
    USING <left paren> <join column list> <right paren>

<join column list> ::= <column name list>

<where clause> ::= WHERE <search condition>

<group by clause> ::=
    GROUP BY <grouping column reference list>

<grouping column reference list> ::=
    <grouping column reference>
        [ ( <comma> <grouping column reference> )... ]

<grouping column reference> ::=
    <column reference> [ <collate clause> ]

<collate clause> ::= COLLATE <collation name>

<collation name> ::= <qualified name>

<having clause> ::= HAVING <search condition>

<table value constructor> ::=
    VALUES <table value constructor list>

<table value constructor list> ::=
    <row value constructor> [ ( <comma> <row value constructor> )... ]

<explicit table> ::= TABLE <table name>

<query term> ::=
      <non-join query term>
    | <joined table>

<corresponding spec> ::=
    CORRESPONDING [ BY <left paren> <corresponding column list> <right paren> ]

<corresponding column list> ::= <column name list>

<query primary> ::=
      <non-join query primary>
    | <joined table>

<case expression> ::=
      <case abbreviation>
    | <case specification>

<case abbreviation> ::=
      NULLIF <left paren> <value expression> <comma>
            <value expression> <right paren>
    | COALESCE <left paren> <value expression>
            ( <comma> <value expression> )... <right paren>

<case specification> ::=
      <simple case>
    | <searched case>

<simple case> ::=
    CASE <case operand>
      <simple when clause>...
      [ <else clause> ]
    END

<case operand> ::= <value expression>

<simple when clause> ::= WHEN <when operand> THEN <result>

<when operand> ::= <value expression>

<result> ::= <result expression> | NULL

<result expression> ::= <value expression>

<else clause> ::= ELSE <result>

<searched case> ::=
    CASE
      <searched when clause>...
      [ <else clause> ]
    END

<searched when clause> ::= WHEN <search condition> THEN <result>

<cast specification> ::=
    CAST <left paren> <cast operand> AS
        <cast target> <right paren>

<cast operand> ::=
      <value expression>
    | NULL

<cast target> ::=
      <domain name>
    | <data type>

<numeric value function> ::=
      <position expression>
    | <extract expression>
    | <length expression>

<position expression> ::=
    POSITION <left paren> <character value expression>
        IN <character value expression> <right paren>

<character value expression> ::=
      <concatenation>
    | <character factor>

<concatenation> ::=
    <character value expression> <concatenation operator>
        <character factor>

<character factor> ::=
    <character primary> [ <collate clause> ]

<character primary> ::=
      <value expression primary>
    | <string value function>

<string value function> ::=
      <character value function>
    | <bit value function>

<character value function> ::=
      <character substring function>
    | <fold>
    | <form-of-use conversion>
    | <character translation>
    | <trim function>

<character substring function> ::=
    SUBSTRING <left paren> <character value expression> FROM <start position>
                [ FOR <string length> ] <right paren>

<start position> ::= <numeric value expression>

<string length> ::= <numeric value expression>

<fold> ::= ( UPPER | LOWER )
     <left paren> <character value expression> <right paren>

<form-of-use conversion> ::=
    CONVERT <left paren> <character value expression>
        USING <form-of-use conversion name> <right paren>

<form-of-use conversion name> ::= <qualified name>

<character translation> ::=
    TRANSLATE <left paren> <character value expression>
        USING <translation name> <right paren>

<translation name> ::= <qualified name>

<trim function> ::=
    TRIM <left paren> <trim operands> <right paren>

<trim operands> ::=
    [ [ <trim specification> ] [ <trim character> ] FROM ] <trim source>

<trim specification> ::=
      LEADING
    | TRAILING
    | BOTH

<trim character> ::= <character value expression>

<trim source> ::= <character value expression>

<bit value function> ::=
    <bit substring function>

<bit substring function> ::=
    SUBSTRING <left paren> <bit value expression> FROM <start position>
        [ FOR <string length> ] <right paren>

<bit value expression> ::=
      <bit concatenation>
    | <bit factor>

<bit concatenation> ::=
    <bit value expression> <concatenation operator> <bit factor>

<bit factor> ::= <bit primary>

<bit primary> ::=
      <value expression primary>
    | <string value function>

<extract expression> ::=
    EXTRACT <left paren> <extract field>
        FROM <extract source> <right paren>

<extract field> ::=
      <datetime field>
    | <time zone field>

<datetime field> ::=
      <non-second datetime field>
    | SECOND

<time zone field> ::=
      TIMEZONE_HOUR
    | TIMEZONE_MINUTE

<extract source> ::=
      <datetime value expression>
    | <interval value expression>

<datetime value expression> ::=
      <datetime term>
    | <interval value expression> <plus sign> <datetime term>
    | <datetime value expression> <plus sign> <interval term>
    | <datetime value expression> <minus sign> <interval term>

<interval term> ::=
      <interval factor>
    | <interval term 2> <asterisk> <factor>
    | <interval term 2> <solidus> <factor>
    | <term> <asterisk> <interval factor>

<interval factor> ::=
    [ <sign> ] <interval primary>

<interval primary> ::=
      <value expression primary> [ <interval qualifier> ]

<interval term 2> ::= <interval term>

<interval value expression> ::=
      <interval term>
    | <interval value expression 1> <plus sign> <interval term 1>
    | <interval value expression 1> <minus sign> <interval term 1>
    | <left paren> <datetime value expression> <minus sign>
          <datetime term> <right paren> <interval qualifier>

<interval value expression 1> ::= <interval value expression>

<interval term 1> ::= <interval term>

<datetime term> ::=
      <datetime factor>

<datetime factor> ::=
      <datetime primary> [ <time zone> ]

<datetime primary> ::=
      <value expression primary>
    | <datetime value function>

<time zone> ::=
    AT <time zone specifier>

<time zone specifier> ::=
      LOCAL
    | TIME ZONE <interval value expression>

<length expression> ::=
      <char length expression>
    | <octet length expression>
    | <bit length expression>

<char length expression> ::=
    ( CHAR_LENGTH | CHARACTER_LENGTH )
        <left paren> <string value expression> <right paren>

<string value expression> ::=
      <character value expression>
    | <bit value expression>

<octet length expression> ::=
    OCTET_LENGTH <left paren> <string value expression> <right paren>

<bit length expression> ::=
    BIT_LENGTH <left paren> <string value expression> <right paren>

<null specification> ::=
    NULL

<default specification> ::=
    DEFAULT

<row value constructor list> ::=
    <row value constructor element>
        [ ( <comma> <row value constructor element> )... ]

<row subquery> ::= <subquery>

<comp op> ::=
      <equals operator>
    | <not equals operator>
    | <less than operator>
    | <greater than operator>
    | <less than or equals operator>
    | <greater than or equals operator>

<between predicate> ::=
    <row value constructor> [ NOT ] BETWEEN
      <row value constructor> AND <row value constructor>

<in predicate> ::=
    <row value constructor>
      [ NOT ] IN <in predicate value>

<in predicate value> ::=
      <table subquery>
    | <left paren> <in value list> <right paren>

<in value list> ::=
    <value expression> ( <comma> <value expression> )...

<like predicate> ::=
    <match value> [ NOT ] LIKE <pattern>
      [ ESCAPE <escape character> ]

<match value> ::= <character value expression>

<pattern> ::= <character value expression>

<escape character> ::= <character value expression>

<null predicate> ::= <row value constructor>
    IS [ NOT ] NULL

<quantified comparison predicate> ::=
    <row value constructor> <comp op> <quantifier> <table subquery>

<quantifier> ::= <all> | <some>

<all> ::= ALL

<some> ::= SOME | ANY

<exists predicate> ::= EXISTS <table subquery>

<unique predicate> ::= UNIQUE <table subquery>

<match predicate> ::=
    <row value constructor> MATCH [ UNIQUE ]
        [ PARTIAL | FULL ] <table subquery>

<overlaps predicate> ::=
    <row value constructor 1> OVERLAPS <row value constructor 2>

<row value constructor 1> ::= <row value constructor>

<row value constructor 2> ::= <row value constructor>

<truth value> ::=
      TRUE
    | FALSE
    | UNKNOWN

<constraint attributes> ::=
      <constraint check time> [ [ NOT ] DEFERRABLE ]
    | [ NOT ] DEFERRABLE [ <constraint check time> ]

<constraint check time> ::=
      INITIALLY DEFERRED
    | INITIALLY IMMEDIATE

<table constraint definition> ::=
    [ <constraint name definition> ]
    <table constraint> [ <constraint attributes> ]

<table constraint> ::=
      <unique constraint definition>
    | <referential constraint definition>
    | <check constraint definition>

<unique constraint definition> ::=
            <unique specification> even in SQL3)
    <unique specification>
      <left paren> <unique column list> <right paren>

<unique column list> ::= <column name list>

<referential constraint definition> ::=
    FOREIGN KEY
        <left paren> <referencing columns> <right paren>
      <references specification>

<referencing columns> ::=
    <reference column list>

<module contents> ::=
      <declare cursor>
    | <dynamic declare cursor>
    | <procedure>

<declare cursor> ::=
    DECLARE <cursor name> [ INSENSITIVE ] [ SCROLL ] CURSOR
      FOR <cursor specification>

<cursor name> ::= <identifier>

<cursor specification> ::=
    <query expression> [ <order by clause> ]
      [ <updatability clause> ]

<order by clause> ::=
    ORDER BY <sort specification list>

<sort specification list> ::=
    <sort specification> [ ( <comma> <sort specification> )... ]

<sort specification> ::=
    <sort key> [ <collate clause> ] [ <ordering specification> ]

<sort key> ::=
      <column name>
    | <unsigned integer>

<ordering specification> ::= ASC | DESC

<updatability clause> ::=
    FOR
        ( READ ONLY |
          UPDATE [ OF <column name list> ] )

<dynamic declare cursor> ::=
    DECLARE <cursor name> [ INSENSITIVE ] [ SCROLL ] CURSOR
        FOR <statement name>

<statement name> ::= <identifier>

<procedure> ::=
    PROCEDURE <procedure name>
        <parameter declaration list> <semicolon>
      <SQL procedure statement> <semicolon>

<procedure name> ::= <identifier>

<parameter declaration list> ::=
      <left paren> <parameter declaration>
          [ ( <comma> <parameter declaration> )... ] <right paren>
    | <parameter declaration>...

<parameter declaration> ::=
      <parameter name> <data type>
    | <status parameter>

<status parameter> ::=
    SQLCODE | SQLSTATE

<SQL procedure statement> ::=
      <SQL schema statement>
    | <SQL data statement>
    | <SQL transaction statement>
    | <SQL connection statement>
    | <SQL session statement>
    | <SQL dynamic statement>
    | <SQL diagnostics statement>

<SQL schema statement> ::=
      <SQL schema definition statement>
    | <SQL schema manipulation statement>

<SQL schema definition statement> ::=
      <schema definition>
    | <table definition>
    | <view definition>
    | <grant statement>
    | <domain definition>
    | <character set definition>
    | <collation definition>
    | <translation definition>
    | <assertion definition>

<schema definition> ::=
    CREATE SCHEMA <schema name clause>
      [ <schema character set specification> ]
      [ <schema element>... ]

<schema name clause> ::=
      <schema name>
    | AUTHORIZATION <schema authorization identifier>
    | <schema name> AUTHORIZATION
          <schema authorization identifier>

<schema authorization identifier> ::=
    <authorization identifier>

<schema character set specification> ::=
    DEFAULT CHARACTER
        SET <character set specification>

<schema element> ::=
      <domain definition>
    | <table definition>
    | <view definition>
    | <grant statement>
    | <assertion definition>
    | <character set definition>
    | <collation definition>
    | <translation definition>

<domain definition> ::=
    CREATE DOMAIN <domain name>
        [ AS ] <data type>
      [ <default clause> ]
      [ <domain constraint>... ]
      [ <collate clause> ]

<domain constraint> ::=
    [ <constraint name definition> ]
    <check constraint definition> [ <constraint attributes> ]

<table definition> ::=
    CREATE [ ( GLOBAL | LOCAL ) TEMPORARY ] TABLE
        <table name>
      <table element list>
      [ ON COMMIT ( DELETE | PRESERVE ) ROWS ]

<view definition> ::=
    CREATE VIEW <table name> [ <left paren> <view column list>
                                  <right paren> ]
      AS <query expression>
      [ WITH [ <levels clause> ] CHECK OPTION ]

<view column list> ::= <column name list>

<levels clause> ::=
    CASCADED | LOCAL

<grant statement> ::=
   GRANT <privileges> ON <object name>
     TO <grantee> [ ( <comma> <grantee> )... ]
       [ WITH GRANT OPTION ]

<privileges> ::=
      ALL PRIVILEGES
    | <action list>

<action list> ::= <action> [ ( <comma> <action> )... ]

<action> ::=
      SELECT
    | DELETE
    | INSERT [ <left paren> <privilege column list> <right paren> ]
    | UPDATE [ <left paren> <privilege column list> <right paren> ]
    | REFERENCES [ <left paren> <privilege column list> <right paren> ]
    | USAGE

<privilege column list> ::= <column name list>

<object name> ::=
      [ TABLE ] <table name>
    | DOMAIN <domain name>
    | COLLATION <collation name>
    | CHARACTER SET <character set name>
    | TRANSLATION <translation name>

<grantee> ::=
      PUBLIC
    | <authorization identifier>

<assertion definition> ::=
    CREATE ASSERTION <constraint name> <assertion check>
      [ <constraint attributes> ]

<assertion check> ::=
    CHECK
        <left paren> <search condition> <right paren>

<character set definition> ::=
    CREATE CHARACTER SET <character set name>
        [ AS ]
      <character set source>
      [ <collate clause> | <limited collation definition> ]

<character set source> ::=
      GET <existing character set name>

<existing character set name> ::=
      <standard character repertoire name>
    | <implementation-defined character repertoire name>
    | <schema character set name>

<schema character set name> ::= <character set name>

<limited collation definition> ::=
    COLLATION FROM <collation source>

<collation source> ::=
      <collating sequence definition>
    | <translation collation>

<collating sequence definition> ::=
      <external collation>
    | <schema collation name>
    | DESC <left paren> <collation name> <right paren>
    | DEFAULT

<external collation> ::=
    EXTERNAL <left paren> <quote> <external collation name> <quote> <right paren>

<external collation name> ::=
      <standard collation name>
    | <implementation-defined collation name>

<standard collation name> ::= <collation name>

<implementation-defined collation name> ::= <collation name>

<schema collation name> ::= <collation name>

<translation collation> ::=
    TRANSLATION <translation name>
        [ THEN COLLATION <collation name> ]

<collation definition> ::=
    CREATE COLLATION <collation name> FOR
        <character set specification>
      FROM <collation source>
        [ <pad attribute> ]

<pad attribute> ::=
      NO PAD
    | PAD SPACE

<translation definition> ::=
    CREATE TRANSLATION <translation name>
      FOR <source character set specification>
        TO <target character set specification>
      FROM <translation source>

<source character set specification> ::= <character set specification>

<target character set specification> ::= <character set specification>

<translation source> ::=
      <translation specification>

<translation specification> ::=
      <external translation>
    | IDENTITY
    | <schema translation name>

<external translation> ::=
    EXTERNAL <left paren> <quote> <external translation name> <quote> <right paren>

<external translation name> ::=
      <standard translation name>
    | <implementation-defined translation name>

<standard translation name> ::= <translation name>

<implementation-defined translation name> ::= <translation name>

<schema translation name> ::= <translation name>

<SQL schema manipulation statement> ::=
      <drop schema statement>
    | <alter table statement>
    | <drop table statement>
    | <drop view statement>
    | <revoke statement>
    | <alter domain statement>
    | <drop domain statement>
    | <drop character set statement>
    | <drop collation statement>
    | <drop translation statement>
    | <drop assertion statement>

<drop schema statement> ::=
    DROP SCHEMA <schema name> <drop behavior>

<drop behavior> ::= CASCADE | RESTRICT

<alter table statement> ::=
    ALTER TABLE <table name> <alter table action>

<alter table action> ::=
      <add column definition>
    | <alter column definition>
    | <drop column definition>
    | <add table constraint definition>
    | <drop table constraint definition>

<add column definition> ::=
    ADD [ COLUMN ] <column definition>

<alter column definition> ::=
    ALTER [ COLUMN ] <column name> <alter column action>

<alter column action> ::=
      <set column default clause>
    | <drop column default clause>

<set column default clause> ::=
    SET <default clause>

<drop column default clause> ::=
    DROP DEFAULT

<drop column definition> ::=
    DROP [ COLUMN ] <column name> <drop behavior>

<add table constraint definition> ::=
    ADD <table constraint definition>

<drop table constraint definition> ::=
    DROP CONSTRAINT <constraint name> <drop behavior>

<drop table statement> ::=
    DROP TABLE <table name> <drop behavior>

<drop view statement> ::=
    DROP VIEW <table name> <drop behavior>

<revoke statement> ::=
    REVOKE [ GRANT OPTION FOR ]
        <privileges>
        ON <object name>
      FROM <grantee> [ ( <comma> <grantee> )... ] <drop behavior>

<alter domain statement> ::=
    ALTER DOMAIN <domain name> <alter domain action>

<alter domain action> ::=
      <set domain default clause>
    | <drop domain default clause>
    | <add domain constraint definition>
    | <drop domain constraint definition>

<set domain default clause> ::= SET <default clause>

<drop domain default clause> ::= DROP DEFAULT

<add domain constraint definition> ::=
    ADD <domain constraint>

<drop domain constraint definition> ::=
    DROP CONSTRAINT <constraint name>

<drop domain statement> ::=
    DROP DOMAIN <domain name> <drop behavior>

<drop character set statement> ::=
    DROP CHARACTER SET <character set name>

<drop collation statement> ::=
    DROP COLLATION <collation name>

<drop translation statement> ::=
    DROP TRANSLATION <translation name>

<drop assertion statement> ::=
    DROP ASSERTION <constraint name>

<SQL data statement> ::=
      <open statement>
    | <fetch statement>
    | <close statement>
    | <select statement: single row>
    | <SQL data change statement>

<open statement> ::=
    OPEN <cursor name>

<fetch statement> ::=
    FETCH [ [ <fetch orientation> ] FROM ]
      <cursor name> INTO <fetch target list>

<fetch orientation> ::=
      NEXT
    | PRIOR
    | FIRST
    | LAST
    | ( ABSOLUTE | RELATIVE ) <simple value specification>

<simple value specification> ::=
      <parameter name>
    | <embedded variable name>
    | <literal>

<fetch target list> ::=
    <target specification> [ ( <comma> <target specification> )... ]

<target specification> ::=
      <parameter specification>
    | <variable specification>

<close statement> ::=
    CLOSE <cursor name>

<select statement: single row> ::=
    SELECT [ <set quantifier> ] <select list>
      INTO <select target list>
        <table expression>

<select target list> ::=
    <target specification> [ ( <comma> <target specification> )... ]

<SQL data change statement> ::=
      <delete statement: positioned>
    | <delete statement: searched>
    | <insert statement>
    | <update statement: positioned>
    | <update statement: searched>

<delete statement: positioned> ::=
    DELETE FROM <table name>
      WHERE CURRENT OF <cursor name>

<delete statement: searched> ::=
    DELETE FROM <table name>
      [ WHERE <search condition> ]

<insert statement> ::=
    INSERT INTO <table name>
      <insert columns and source>

<insert columns and source> ::=
      [ <left paren> <insert column list> <right paren> ]
            <query expression>
    | DEFAULT VALUES

<insert column list> ::= <column name list>

<update statement: positioned> ::=
    UPDATE <table name>
      SET <set clause list>
        WHERE CURRENT OF <cursor name>

<set clause list> ::=
    <set clause> [ ( <comma> <set clause> )... ]

<set clause> ::=
    <object column> <equals operator> <update source>

<object column> ::= <column name>

<update source> ::=
      <value expression>
    | <null specification>
    | DEFAULT

<update statement: searched> ::=
    UPDATE <table name>
      SET <set clause list>
      [ WHERE <search condition> ]

<SQL transaction statement> ::=
      <set transaction statement>
    | <set constraints mode statement>
    | <commit statement>
    | <rollback statement>

<set transaction statement> ::=
    SET TRANSACTION <transaction mode>
        [ ( <comma> <transaction mode> )... ]

<transaction mode> ::=
      <isolation level>
    | <transaction access mode>
    | <diagnostics size>

<isolation level> ::=
    ISOLATION LEVEL <level of isolation>

<level of isolation> ::=
      READ UNCOMMITTED
    | READ COMMITTED
    | REPEATABLE READ
    | SERIALIZABLE

<transaction access mode> ::=
      READ ONLY
    | READ WRITE

<diagnostics size> ::=
    DIAGNOSTICS SIZE <number of conditions>

<number of conditions> ::= <simple value specification>

<set constraints mode statement> ::=
    SET CONSTRAINTS <constraint name list>
        ( DEFERRED | IMMEDIATE )

<constraint name list> ::=
      ALL
    | <constraint name> [ ( <comma> <constraint name> )... ]

<commit statement> ::=
    COMMIT [ WORK ]

<rollback statement> ::=
    ROLLBACK [ WORK ]

<SQL connection statement> ::=
      <connect statement>
    | <set connection statement>
    | <disconnect statement>

<connect statement> ::=
    CONNECT TO <connection target>

<connection target> ::=
      <SQL-server name>
        [ AS <connection name> ]
          correspondence with Tony Gordon)
        [ USER <user name> ]
    | DEFAULT

<SQL-server name> ::= <simple value specification>

<connection name> ::= <simple value specification>

<user name> ::= <simple value specification>

<set connection statement> ::=
    SET CONNECTION <connection object>

<connection object> ::=
      DEFAULT
    | <connection name>

<disconnect statement> ::=
    DISCONNECT <disconnect object>

<disconnect object> ::=
      <connection object>
    | ALL
    | CURRENT

<SQL session statement> ::=
      <set catalog statement>
    | <set schema statement>
    | <set names statement>
    | <set session authorization identifier statement>
    | <set local time zone statement>

<set catalog statement> ::=
    SET CATALOG <value specification>

<value specification> ::=
      <literal>
    | <general value specification>

<set schema statement> ::=
    SET SCHEMA <value specification>

<set names statement> ::=
    SET NAMES <value specification>

<set session authorization identifier statement> ::=
    SET SESSION AUTHORIZATION
        <value specification>

<set local time zone statement> ::=
    SET TIME ZONE
        <set time zone value>

<set time zone value> ::=
      <interval value expression>
    | LOCAL

<SQL dynamic statement> ::=
      <system descriptor statement>
    | <prepare statement>
    | <deallocate prepared statement>
    | <describe statement>
    | <execute statement>
    | <execute immediate statement>
    | <SQL dynamic data statement>

<system descriptor statement> ::=
      <allocate descriptor statement>
    | <deallocate descriptor statement>
    | <set descriptor statement>
    | <get descriptor statement>

<allocate descriptor statement> ::=
    ALLOCATE DESCRIPTOR <descriptor name>
       [ WITH MAX <occurrences> ]

<descriptor name> ::=
    [ <scope option> ] <simple value specification>

<scope option> ::=
      GLOBAL
    | LOCAL

<occurrences> ::= <simple value specification>

<deallocate descriptor statement> ::=
    DEALLOCATE DESCRIPTOR <descriptor name>

<set descriptor statement> ::=
    SET DESCRIPTOR <descriptor name>
        <set descriptor information>

<set descriptor information> ::=
      <set count>
    | VALUE <item number>
        <set item information> [ ( <comma> <set item information> )... ]

<set count> ::=
    COUNT <equals operator> <simple value specification 1>

<simple value specification 1> ::= <simple value specification>

<item number> ::= <simple value specification>

<set item information> ::=
    <descriptor item name> <equals operator> <simple value specification 2>

<descriptor item name> ::=
      TYPE
    | LENGTH
    | OCTET_LENGTH
    | RETURNED_LENGTH
    | RETURNED_OCTET_LENGTH
    | PRECISION
    | SCALE
    | DATETIME_INTERVAL_CODE
    | DATETIME_INTERVAL_PRECISION
    | NULLABLE
    | INDICATOR
    | DATA
    | NAME
    | UNNAMED
    | COLLATION_CATALOG
    | COLLATION_SCHEMA
    | COLLATION_NAME
    | CHARACTER_SET_CATALOG
    | CHARACTER_SET_SCHEMA
    | CHARACTER_SET_NAME

<simple value specification 2> ::= <simple value specification>

<item number> ::= <simple value specification>

<get descriptor statement> ::=
    GET DESCRIPTOR <descriptor name> <get descriptor information>

<get descriptor information> ::=
      <get count>
    | VALUE <item number>
        <get item information> [ ( <comma> <get item information> )... ]

<get count> ::=
    <simple target specification 1> <equals operator>
         COUNT

<simple target specification 1> ::= <simple target specification>

<simple target specification> ::=
      <parameter name>
    | <embedded variable name>

<get item information> ::=
    <simple target specification 2> <equals operator> <descriptor item name>>

<simple target specification 2> ::= <simple target specification>

<prepare statement> ::=
    PREPARE <SQL statement name> FROM <SQL statement variable>

<SQL statement name> ::=
      <statement name>
    | <extended statement name>

<extended statement name> ::=
    [ <scope option> ] <simple value specification>

<SQL statement variable> ::= <simple value specification>

<deallocate prepared statement> ::=
    DEALLOCATE PREPARE <SQL statement name>

<describe statement> ::=
      <describe input statement>
    | <describe output statement>

<describe input statement> ::=
    DESCRIBE INPUT <SQL statement name> <using descriptor>

<using descriptor> ::=
    ( USING | INTO ) SQL DESCRIPTOR <descriptor name>

<describe output statement> ::=
    DESCRIBE [ OUTPUT ] <SQL statement name> <using descriptor>

<execute statement> ::=
    EXECUTE <SQL statement name>
      [ <result using clause> ]
      [ <parameter using clause> ]

<result using clause> ::= <using clause>

<using clause> ::=
      <using arguments>
    | <using descriptor>

<using arguments> ::=
    ( USING | INTO ) <argument> [ ( <comma> <argument> )... ]

<argument> ::= <target specification>

<parameter using clause> ::= <using clause>

<execute immediate statement> ::=
    EXECUTE IMMEDIATE <SQL statement variable>

<SQL dynamic data statement> ::=
      <allocate cursor statement>
    | <dynamic open statement>
    | <dynamic fetch statement>
    | <dynamic close statement>
    | <dynamic delete statement: positioned>
    | <dynamic update statement: positioned>

<allocate cursor statement> ::=
    ALLOCATE <extended cursor name> [ INSENSITIVE ]
        [ SCROLL ] CURSOR
      FOR <extended statement name>

<extended cursor name> ::=
    [ <scope option> ] <simple value specification>

<dynamic open statement> ::=
    OPEN <dynamic cursor name> [ <using clause> ]

<dynamic cursor name> ::=
      <cursor name>
    | <extended cursor name>

<dynamic fetch statement> ::=
    FETCH [ [ <fetch orientation> ] FROM ] <dynamic cursor name>
        <using clause>

<dynamic close statement> ::=
    CLOSE <dynamic cursor name>

<dynamic delete statement: positioned> ::=
    DELETE FROM <table name>
      WHERE CURRENT OF
          <dynamic cursor name>

<dynamic update statement: positioned> ::=
    UPDATE <table name>
      SET <set clause>
          [ ( <comma> <set clause> )... ]
        WHERE CURRENT OF
            <dynamic cursor name>

<SQL diagnostics statement> ::=
    <get diagnostics statement>

<get diagnostics statement> ::=
    GET DIAGNOSTICS <sql diagnostics information>

<sql diagnostics information> ::=
      <statement information>
    | <condition information>

<statement information> ::=
    <statement information item> [ ( <comma> <statement information item> )... ]

<statement information item> ::=
    <simple target specification> <equals operator> <statement information item name>

<statement information item name> ::=
      NUMBER
    | MORE
    | COMMAND_FUNCTION
    | DYNAMIC_FUNCTION
    | ROW_COUNT

<condition information> ::=
    EXCEPTION <condition number>
      <condition information item> [ ( <comma> <condition information item> )... ]

<condition number> ::= <simple value specification>

<condition information item> ::=
    <simple target specification> <equals operator> <condition information item name>

<condition information item name> ::=
      CONDITION_NUMBER
    | RETURNED_SQLSTATE
    | CLASS_ORIGIN
    | SUBCLASS_ORIGIN
    | SERVER_NAME
    | CONNECTION_NAME
    | CONSTRAINT_CATALOG
    | CONSTRAINT_SCHEMA
    | CONSTRAINT_NAME
    | CATALOG_NAME
    | SCHEMA_NAME
    | TABLE_NAME
    | COLUMN_NAME
    | CURSOR_NAME
    | MESSAGE_TEXT
    | MESSAGE_LENGTH
    | MESSAGE_OCTET_LENGTH

<embedded SQL host program> ::=
      <embedded SQL Ada program>
    | <embedded SQL C program>
    | <embedded SQL COBOL program>
    | <embedded SQL Fortran program>
    | <embedded SQL MUMPS program>
    | <embedded SQL Pascal program>
    | <embedded SQL PL/I program>

<embedded SQL Ada program> ::= !! <EMPHASIS>(See the Syntax Rules.)

<embedded SQL C program> ::=
      !! <EMPHASIS>(See the Syntax Rules.)

<embedded SQL COBOL program> ::= !! <EMPHASIS>(See the Syntax Rules.)

<embedded SQL Fortran program> ::=
    !! <EMPHASIS>(See the Syntax Rules.)

<embedded SQL MUMPS program> ::= !! <EMPHASIS>(See the Syntax Rules.)

<embedded SQL Pascal program> ::=
    !! <EMPHASIS>(See the Syntax Rules.)

<embedded SQL PL/I program> ::= !! <EMPHASIS>(See the Syntax Rules.)

<embedded SQL declare section> ::=
      <embedded SQL begin declare>
        [ <embedded character set declaration> ]
        [ <host variable definition>... ]
      <embedded SQL end declare>
    | <embedded SQL MUMPS declare>

<embedded SQL begin declare> ::=
    <SQL prefix> BEGIN DECLARE SECTION
        [ <SQL terminator> ]

<SQL prefix> ::=
      EXEC SQL
    | <ampersand>SQL<left paren>

<SQL terminator> ::=
      END-EXEC
    | <semicolon>
    | <right paren>

<embedded character set declaration> ::=
    SQL NAMES ARE <character set specification>

<host variable definition> ::=
      <Ada variable definition>
    | <C variable definition>
    | <COBOL variable definition>
    | <Fortran variable definition>
    | <MUMPS variable definition>
    | <Pascal variable definition>
    | <PL/I variable definition>

<Ada variable definition> ::=
    <Ada host identifier> [ ( <comma> <Ada host identifier> )... ] :
    <Ada type specification> [ <Ada initial value> ]

<Ada type specification> ::=
      <Ada qualified type specification>
    | <Ada unqualified type specification>

<Ada qualified type specification> ::=
      SQL_STANDARD.CHAR [ CHARACTER SET
         [ IS ] <character set specification> ]
          <left paren> 1 <double period> <length> <right paren>
    | SQL_STANDARD.BIT
          <left paren> 1 <double period> <length> <right paren>
    | SQL_STANDARD.SMALLINT
    | SQL_STANDARD.INT
    | SQL_STANDARD.REAL
    | SQL_STANDARD.DOUBLE_PRECISION
    | SQL_STANDARD.SQLCODE_TYPE
    | SQL_STANDARD.SQLSTATE_TYPE
    | SQL_STANDARD.INDICATOR_TYPE

<Ada unqualified type specification> ::=
      CHAR
          <left paren> 1 <double period> <length> <right paren>
    | BIT
          <left paren> 1 <double period> <length> <right paren>
    | SMALLINT
    | INT
    | REAL
    | DOUBLE_PRECISION
    | SQLCODE_TYPE
    | SQLSTATE_TYPE
    | INDICATOR_TYPE

<Ada initial value> ::=
    <Ada assignment operator> <character representation>...

<Ada assignment operator> ::= <colon><equals operator>

<C variable definition> ::=
      [ <C storage class> ]
      [ <C class modifier> ]
      <C variable specification>
    <semicolon>

<C storage class> ::=
      auto
    | extern
    | static

<C class modifier> ::= const | volatile

<C variable specification> ::=
      <C numeric variable>
    | <C character variable>
    | <C derived variable>

<C numeric variable> ::=
    ( long | short | float | double )
      <C host identifier> [ <C initial value> ]
            [ ( <comma> <C host identifier> [ <C initial value> ] )... ]

<C initial value> ::=
    <equals operator> <character representation>...

<C character variable> ::=
    char [ CHARACTER SET
             [ IS ] <character set specification> ]
      <C host identifier>
        <C array specification> [ <C initial value> ]
        [ ( <comma> <C host identifier>
          <C array specification>
                 [ <C initial value> ] )... ]

<C array specification> ::=
    <left bracket> <length> <right bracket>

<C derived variable> ::=
      <C VARCHAR variable>
    | <C bit variable>

<C VARCHAR variable> ::=
    VARCHAR [ CHARACTER SET [ IS ]
        <character set specification> ]
        <C host identifier>
            <C array specification> [ <C initial value> ]
          [ ( <comma> <C host identifier>
              <C array specification>
                      [ <C initial value> ] )... ]

<C bit variable> ::=
    BIT <C host identifier>
        <C array specification> [ <C initial value> ]
      [ ( <comma> <C host identifier>
        <C array specification>
                   [ <C initial value> ] )... ]

<COBOL variable definition> ::=
    (01|77) <COBOL host identifier> <COBOL type specification>
      [ <character representation>... ] <period>

<COBOL type specification> ::=
      <COBOL character type>
    | <COBOL bit type>
    | <COBOL numeric type>
    | <COBOL integer type>

<COBOL character type> ::=
    [ CHARACTER SET [ IS ]
          <character set specification> ]
    ( PIC | PICTURE ) [ IS ] ( X [ <left paren> <length> <right paren> ] )...

<COBOL bit type> ::=
    ( PIC | PICTURE ) [ IS ]
        ( B [ <left paren> <length> <right paren> ] )...

<COBOL numeric type> ::=
    ( PIC | PICTURE ) [ IS ]
      S <COBOL nines specification>
    [ USAGE [ IS ] ] DISPLAY SIGN LEADING SEPARATE

<COBOL nines specification> ::=
      <COBOL nines> [ V [ <COBOL nines> ] ]
    | V <COBOL nines>

<COBOL nines> ::= ( 9 [ <left paren> <length> <right paren> ] )...

<COBOL integer type> ::=
      <COBOL computational integer>
    | <COBOL binary integer>

<COBOL computational integer> ::=
    ( PIC | PICTURE ) [ IS ] S<COBOL nines>
      [ USAGE [ IS ] ] ( COMP | COMPUTATIONAL )

<COBOL binary integer> ::=
    ( PIC | PICTURE ) [ IS ] S<COBOL nines>
      [ USAGE [ IS ] ] BINARY

<Fortran variable definition> ::=
    <Fortran type specification>
    <Fortran host identifier>
        [ ( <comma> <Fortran host identifier> )... ]

<Fortran type specification> ::=
      CHARACTER [ <asterisk> <length> ]
          [ CHARACTER SET [ IS ]
                <character set specification> ]
    | BIT [ <asterisk> <length> ]
    | INTEGER
    | REAL
    | DOUBLE PRECISION

<MUMPS variable definition> ::=
    ( <MUMPS numeric variable> | <MUMPS character variable> )
        <semicolon>

<MUMPS numeric variable> ::=
    <MUMPS type specification>
      <MUMPS host identifier> [ ( <comma> <MUMPS host identifier> )... ]

<MUMPS type specification> ::=
      INT
    | DEC
          [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
    | REAL

<MUMPS character variable> ::=
    VARCHAR <MUMPS host identifier> <MUMPS length specification>
      [ ( <comma> <MUMPS host identifier> <MUMPS length specification> )... ]

<MUMPS length specification> ::=
    <left paren> <length> <right paren>

<Pascal variable definition> ::=
    <Pascal host identifier> [ ( <comma> <Pascal host identifier> )... ] <colon>
      <Pascal type specification> <semicolon>

<Pascal type specification> ::=
      PACKED ARRAY
          <left bracket> 1 <double period> <length> <right bracket>
        OF CHAR
          [ CHARACTER SET [ IS ]
                <character set specification> ]
    | PACKED ARRAY
          <left bracket> 1 <double period> <length> <right bracket>
        OF BIT
    | INTEGER
    | REAL
    | CHAR [ CHARACTER SET
                                [ IS ] <character set specification> ]
    | BIT

<PL/I variable definition> ::=
    (DCL | DECLARE)
        (   <PL/I host identifier>
          | <left paren> <PL/I host identifier>
                [ ( <comma> <PL/I host identifier> )... ] <right paren> )
    <PL/I type specification>
    [ <character representation>... ] <semicolon>

<PL/I type specification> ::=
      ( CHAR | CHARACTER ) [ VARYING ]
          <left paren><length><right paren>
          [ CHARACTER SET
                [ IS ] <character set specification> ]
    | BIT [ VARYING ] <left paren><length><right paren>
    | <PL/I type fixed decimal> <left paren> <precision>
          [ <comma> <scale> ] <right paren>
    | <PL/I type fixed binary> [ <left paren> <precision> <right paren> ]
    | <PL/I type float binary> <left paren> <precision> <right paren>

<PL/I type fixed decimal> ::=
      ( DEC | DECIMAL ) FIXED
    | FIXED ( DEC | DECIMAL )

<PL/I type fixed binary> ::=
      ( BIN | BINARY ) FIXED
    | FIXED ( BIN | BINARY )

<PL/I type float binary> ::=
      ( BIN | BINARY ) FLOAT
    | FLOAT ( BIN | BINARY )

<embedded SQL end declare> ::=
    <SQL prefix> END DECLARE SECTION
        [ <SQL terminator> ]

<embedded SQL MUMPS declare> ::=
    <SQL prefix>
      BEGIN DECLARE SECTION
        [ <embedded character set declaration> ]
        [ <host variable definition>... ]
      END DECLARE SECTION
    <SQL terminator>

<embedded SQL statement> ::=
    <SQL prefix>
      <statement or declaration>
    [ <SQL terminator> ]

<statement or declaration> ::=
      <declare cursor>
    | <dynamic declare cursor>
    | <temporary table declaration>
    | <embedded exception declaration>
    | <SQL procedure statement>

<embedded exception declaration> ::=
    WHENEVER <condition> <condition action>

<condition> ::=
    SQLERROR | NOT FOUND

<condition action> ::=
    CONTINUE | <go to>

<go to> ::=
    ( GOTO | GO TO ) <goto target>

<goto target> ::=
      <host label identifier>
    | <unsigned integer>
    | <host PL/I label variable>

<host label identifier> ::= !!<EMPHASIS>¡]°Ñ¬Ý¤åªk³W«h¡^

<host PL/I label variable> ::= !!<EMPHASIS>¡]°Ñ¬Ý¤åªk³W«h¡^

<preparable statement> ::=
      <preparable SQL data statement>
    | <preparable SQL schema statement>
    | <preparable SQL transaction statement>
    | <preparable SQL session statement>
    | <preparable implementation-defined statement>

<preparable SQL data statement> ::=
      <delete statement: searched>
    | <dynamic single row select statement>
    | <insert statement>
    | <dynamic select statement>
    | <update statement: searched>
    | <preparable dynamic delete statement: positioned>
    | <preparable dynamic update statement: positioned>

<dynamic single row select statement> ::= <query specification>

<dynamic select statement> ::= <cursor specification>

<preparable dynamic delete statement: positioned> ::=
   DELETE [ FROM <table name> ]
      WHERE CURRENT OF <cursor name>

<preparable dynamic update statement: positioned> ::=
   UPDATE [ <table name> ]
      SET <set clause list>
      WHERE CURRENT OF <cursor name>

<preparable SQL schema statement> ::=
      <SQL schema statement>

<preparable SQL transaction statement> ::=
      <SQL transaction statement>

<preparable SQL session statement> ::=
      <SQL session statement>

<preparable implementation-defined statement> ::=
    !! <EMPHASIS>(See the Syntax Rules.)

<direct SQL statement> ::=
    <directly executable statement> <semicolon>

<directly executable statement> ::=
      <direct SQL data statement>
    | <SQL schema statement>
    | <SQL transaction statement>
    | <SQL connection statement>
    | <SQL session statement>
    | <direct implementation-defined statement>

<direct SQL data statement> ::=
      <delete statement: searched>
    | <direct select statement: multiple rows>
    | <insert statement>
    | <update statement: searched>
    | <temporary table declaration>

<direct select statement: multiple rows> ::=
    <query expression> [ <order by clause> ]

<direct implementation-defined statement> ::=
    !!<EMPHASIS>(See the Syntax Rules)

<SQL object identifier> ::=
    <SQL provenance> <SQL variant>

<SQL provenance> ::= <arc1> <arc2> <arc3>

<arc1> ::= iso | 1 | iso <left paren> 1 <right paren>

<arc2> ::= standard | 0 | standard <left paren> 0 <right paren>

<arc3> ::= 9075

<SQL variant> ::= <SQL edition> <SQL conformance>

<SQL edition> ::= <1987> | <1989> | <1992>

<1987> ::= 0 | edition1987 <left paren> 0 <right paren>

<1989> ::= <1989 base> <1989 package>

<1989 base> ::= 1 | edition1989 <left paren> 1 <right paren>

<1989 package> ::= <integrity no> | <integrity yes>

<integrity no> ::= 0 | IntegrityNo <left paren> 0 <right paren>

<integrity yes> ::= 1 | IntegrityYes <left paren> 1 <right paren>

<1992> ::= 2 | edition1992 <left paren> 2 <right paren>

<SQL conformance> ::= <low> | <intermediate> | <high>

<low> ::= 0 | Low <left paren> 0 <right paren>

<intermediate> ::= 1 | Intermediate <left paren> 1 <right paren>

<high> ::= 2 | High <left paren> 2 <right paren>
\end{verbatim}
\end{tscreen}



\section{ªþ¿ý¤A¡Xªì¾ÇªÌ SQL ¾É¤Þ \label{Appendix B}}




\subsection{PostgreSQL ¾É¤Þ}

SQL ¾É¤Þ¤]¥]§t¦b PostgreSQL ¤¤´²§G¡CSQL ¾É¤Þ¤â½Z¦b src/tutorial ¥Ø¿ý¤¤¡C


\subsection{¤¬Ápºô URL «ü¼Ð}

ªì¾ÇªÌªº SQL ¾É¤Þ¥i¦b¥H¤U¦a¤è§ä¨ì
\begin{itemize}
\item  Jim Hoffman ªº«ü¾É \nameurl{http://w3.one.net/~jhoffman/sqltut.htm}{}
\item  Carnegie Mellon Univ \nameurl{http://www.heinz.cmu.edu/project/dbms}{}
¦b¦¹À»¿ï¡¥technical¡¦-{$>$}¡¥SQL\_examples.html¡¦©M¨ä¥L¡C
\item  Concord Univ \nameurl{http://www.cs.concordia.ca/Course_Notes/oracle/browser/node1.html}{}
\end{itemize}

¦³·N¨£©ÎºÃÃø¡H¹q¶l¦Ü
\begin{itemize}
\item  Jim Hoffman \onlynameurl{jhoffman@one.net}
\end{itemize}

John Hoffman ¤]±ÀÂË¥H¤Uºô§}¡J
\begin{itemize}
\item  SQL Reference \nameurl{http://www.contrib.andrew.cmu.edu/~shadow/sql.html}{}
\item  Ask the SQL Pro \nameurl{http://www.inquiry.com/techtips/thesqlpro/}{}
\item  SQL Pro's Relational DB Useful Sites \nameurl{http://www.inquiry.com/techtips/thesqlpro/usefulsites.html}{}
\item  Programmer's Source \nameurl{http://infoweb.magi.com/~steve/develop.html}{}
\item  DBMS Sites \nameurl{http://info.itu.ch/special/wwwfiles}{} ¨ì¦¹¨ú±o 
compdb.html ÀÉ
\item  DB Ingredients \nameurl{http://www.compapp.dcu.ie/databases/f017.html}{}
\item  Web Authoring \nameurl{http://www.stars.com/Tutorial/CGI/}{}
\item  Computing Dictionary \nameurl{http://wfn-shop.princeton.edu/cgi-bin/foldoc}{}
\item  DBMS Lab/Links \nameurl{http://www-ccs.cs.umass.edu/db.html}{}
\item  SQL FAQ \nameurl{http://epoch.CS.Berkeley.EDU:8000/sequoia/dba/montage/FAQ}{} Go here and 
see file SQL\_TOC.html
\item  SQL Databases \nameurl{http://chaos.mur.csu.edu.au/itc125/cgi/sqldb.html}{}
\item  RIT Database Design Page \nameurl{http://www.it.rit.edu/~wjs/IT/199602/icsa720/icsa720postings.html}{}
\item  Database Jump Site \nameurl{http://www.pcslink.com/~ej/dbweb.html}{}
\item  Programming Tutorials on the Web \nameurl{http://www.eng.uc.edu/~jtilley/tutorial.html}{}
\item  Development Resources \nameurl{http://www.ndev.com/ndc2/support/resources.htp}{}
\item  Query List \nameurl{http://ashok.pair.com/sql.htm}{}
\item  IMAGE SQL Miscellaneous \nameurl{http://jazz.external.hp.com/training/sqltables/main.html}{}
\item  Internet Resource List \nameurl{http://www.eit.com/web/netservices.html}{}
\end{itemize}



\subsection{½u¤W SQL «ü¾É}

¨ì¥H¤Uºô­¶¨ú±o½u¤W SQL «ü¾É
\begin{itemize}
\item  SQL ªì¾Ç½Òµ{ \nameurl{http://sqlcourse.com}{}
\item  SQL ¶i¶¥½Òµ{ \nameurl{http://sqlcourse2.com}{}
\end{itemize}





\section{ªþ¿ý¤þ¡XLinux §Ö³t¦w¸Ë«ü¤Þ \label{Appendix C}}

¦pªG§A­p¹º¦b Linux ¨Ï¥Î PostgreSQL¡A¦Ó¦b¦w¸Ë Linux 
®É»Ý­nÀ°§U¡A½Ð°Ñ¦Ò¦b³oªþ¿ý¤¤«ü¥Üªº¦a¤è¡C¥¦­Ì¥]§t¥H¤U¥DÃD¡J
\begin{itemize}
\item  Salient Features of Linux - Why Linux is better as a database server 
when compared with Windows 95/NT
\item  10 minutes Linux Quick Install Instructions
\item  Microsoft-Linux Analogy List
\item  Quick Steps to Recompile the Linux Kernel
\end{itemize}


\begin{itemize}
\item  ¥Dºô­¶ \nameurl{http://www.aldev.8m.com}{}
\item  ¬M®g¯¸¥x \nameurl{http://aldev.webjump.com}{}
\item  ¬M®g¯¸¥x \nameurl{http://www.homepages.infoseek.com/~aldev1/index.html}{}
\item  ¬M®g¯¸¥x \nameurl{http://www3.bcity.com/aldev/}{}
\item  ¬M®g¯¸¥x \nameurl{http://www.members.spree.com/technology/aldev/}{} 
\end{itemize}



\section{ªþ¿ý¤B¡X¦w¸Ë Midgard \label{midgardinstall}}

¨Ó¦Û \nameurl{http://www.midgard-project.org/download/binaries}{} ªº RPMS
¥Ø«e¤£¥]¬A PostgreSQL ¤ä´©¡A©Ò¥H§A­n±q­ì©l½X tar.gz ÀÉ¦w¸Ë¡C

¤U¸ü Midgard ­ì©l½X tar.gz ÀÉ¡A¾\Åª INSTALL.REDHAT ÀÉ¡X
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
bash# cd midgard-lib-1.4beta6
bash# ./configure --prefix=/usr/local --with-mysql=/usr/local --includedir=/usr/include/mysql --with-midgard=/usr/local --with-pgsql=/var/lib/pgsql --includedir=/usr/include/pgsql
bash# make
bash# make install
bash# ldconfig -v | grep -i midga
«þ¨©ìøÀYÀÉ¡A¥H¨¾ make install ¤£³o¼Ë°µ¡K
bash# cp *.h /usr/local/include
 
 
bash# cd ../mod_midgard-1.4beta5c
bash# ./configure --prefix=/usr/local --with-mysql=/usr/local --includedir=/usr/include/mysql --with-midgard=/usr --with-pgsql=/var/lib/pgsql --includedir=/usr/include/pgsql
bash# make
bash# make install
# ­×§ï apache ³]©w¬° /usr/¡K¡K
#modify apache line to correct /usr/.....
bash# vi /etc/httpd/conf/httpd.conf   ¡]©Î¦b  /etc/apache/httpd.conf¡^
bash# /etc/init.d/apache restart
# ­A­«·s±Ò°Ê apache¡I¡I¡I

bash# cd ../midgard-php-1.4beta6
bash# ./configure '--with-apxs' '--with-mysql' '--with-pgsql' '--with-midgard' --prefix=/usr/local --with-midgard=/usr/local
 
bash# gvim Makefile
¦b INCLUDE ÅÜ¼Æ¤¤¥[¤W -I/usr/include/pgsql¡C

¤]­n¦p¤U¦b $(APXS) «ü¥O¤¤¥[¤W $(INCLUDE)¡X
 
libphp3.so: mod_php3.c libmodphp3-so.a  pcrelib/libpcre.a midgard/libphpmidgard.a
    -@test -f ./mod_php3.c || test -L ./mod_php3.c || $(LN_S) $(srcdir)/mod_php3.c ./mod_php3.c
    -@test -f ./mod_php3.c || test -h ./mod_php3.c || $(LN_S) $(srcdir)/mod_php3.c ./mod_php3.c
    $(APXS) -c -o libphp3.so  -I$(srcdir) $(INCLUDE) -I. -I/usr/local/include -I/usr/lib/glib/include  -Wl,'-rpath /usr/local/lib' ./mod_php3.c libmodphp3-so.a
$(APXS_LDFLAGS)
 
bash# make
bash# make install
# ­×§ï apache ³]©w¬° /usr/¡K¡K
# ¥[¤W¦p¤U¼Æ¦æ¡X
    LoadModule php4_module        modules/libphp4.so
            AddModule mod_php4.c
    LoadModule php4_module        lib/apache/libphp4.so
 
    <IfModule mod_php4.c>
        AddType application/x-httpd-php4 .php4
        AddType application/x-httpd-php4 .php
        AddType application/x-httpd-php4-source .phps
        AddType application/x-httpd-php .php
    </IfModule>
 
bash# vi /etc/httpd/conf/httpd.conf   ¡]©Î¦b /etc/apache/httpd.conf¡^
 
bash# /etc/init.d/apache restart
# ­n­«·s±Ò°Ê apache¡I¡I¡I
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}



\subsection{´ú¸Õ Midgard PHP ¦øªA¾¹\label{testmidgard}}

­n´ú¸Õ¦w¸Ë¬O§_¦¨¥\½Ð³o¼Ë°µ¡X
¦b§Aªº¤å¥ó®Ú¥Ø¿ý¤¤«Ø¥ß¤@­ÓÀÉ®×¡C§Ú³q±`ºÙ¥¦¬° info.php¡A¨Ã¦b¨ä¶¡¥[¤W¤@¦æ¡J
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
<?phpinfo()?>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


¦b§AªºÂsÄý¾¹¤¤¸ü¤J¡Jhttp://localhost/info.php

§A·|¨£¨ì¤@­¶º}«GªºÕp­n¡A¦C¥X§Aªº³]©w¤¤©Ò¦³¸ê®Æ¡C
§A¤j·§¤£·|§â³oÀÉ®×©ñ¦b¦b¥Í²£¥Îªº¦øªA¾¹¤¤¡A¦ý¬°¤F¶}µo®É°£¿ù©M¤@¯ë¸ê®Æ¡A
¥¦·|«Ü¤è«K¡C


\subsection{«O¦w OpenSSL \label{openssl}}

§A¥i¯à­n¦b
\nameurl{ftp://ftp.deva.net/pub/sources/crypto/rsaref20.1996.tar.Z}{}
¨ú¦æ RSA ®M¸Ë³n¥ó¥H±Ò¥Î SSL ¥[±K¡C¤]½Ð¬Ý¬Ý Linux ¥úºÐªº OpenSSL
\nameurl{http://www.openssl.org}{}¡C

¦pªG§A¤£·Q±Ò°Ê SSL¡]©Î§A¹J¨ì§xÃø¡^¡A¤U¸ü­ì©l½X Apache-Midgard RPM ©M­×§ï *.spec
ÀÉ©M§R¥h SSL¡A¦A­«¨£ RPM¡C

\end{document}
