PostgreSQL 6.4.2 ¼³Ä¡ °¡À̵å(1999/01/10) - Á¤Á¾°©(hipon@kitel.co.kr) ------------------------------------------------------------------------- 1. µé¾î°¡±â Àü¿¡.. ----------------- % ÀÌ ¹®¼­´Â Postgres¿¡ ÀÖ´Â ¿µ¹® Install ¹®¼­¸¦ ¹ÙÅÁÀ¸·Î Á¦À۵Ǿú½À´Ï´Ù. % º¸´Ù ÀÚ¼¼ÇÑ »çÇ×Àº postgresȨÆäÀÌÁö¸¦ ¹æ¹®ÇϽðųª, ÇÁ·Î±×·¥ ¼Ò½ºÀÇ % docµð·ºÅ丮¸¦ ÂüÁ¶ÇϽñ⠹ٶø´Ï´Ù. % ÇÁ·Î±×·¥À» ¼³Ä¡Çϰųª ½ÇÇàÇÒ¶§ Áß¿äÇÑ°Ç ÇÁ·Î±×·¥À» ¸¸µç Á¦ÀÛÀÚ°¡ ÇÁ·Î±×·¥¿¡ ÇÔ²² ³Ö¾îÁØ ¹®¼­ Áï, READMEÆÄÀÏÀ» Àо´Â °ÍÀÔ´Ï´Ù. % ÀÌ ¹®¼­´Â PostgreSQLÀÇ ±âº»ÀûÀÎ ¼³Ä¡ ¹× Çѱۻç¿ë¹ý, ±×¸®°í ¸ÕÀú ¼³Ä¡Çغ» ÇÊÀÚ°¡ ÀüÇÏ°í ½ÍÀº ÆÁÀÌ ÁÖµÈ ³»¿ëÀ¸·Î ±¸¼ºµÇ¾î ÀÖ½À´Ï´Ù. % ±×·¯¹Ç·Î, ÀÌ ¹®¼­ º¸´Ù ÀÚ¼¼ÇÑ Á¤º¸¸¦ ¾Ë°í ½ÍÀ¸½Ã¸é ÇÔ²² Æ÷ÇԵǾî ÀÖ´Â REAME Á¾·ùÀÇ ÆÄÀÏÀ» ÇÔ²² ÀÐ¾î º¼°ÍÀ» Àû±Ø ±ÇÇÕ´Ï´Ù. % ÀÌ ¹®¼­´Â ÆíÀÇ»ó °æ¾î¸¦ »ý·«Çß½À´Ï´Ù. ÀÌÁ¡ ¾çÇعٶø´Ï´Ù. 1.1 ÇÊÀÚ ¼³Ä¡ Hardware Á¤º¸ (¾Æ·¡´Â ÇÊÀÚÀÇ °æ¿ìÀÌ°í, postgres´Â ¸®´ª½º°¡ ¼³Ä¡µÇ´Â 386ÀÌ»óÀÇ ÄÄÇ»ÅÍÀÌ¸é ¼³Ä¡°¡´ÉÇÏ´Ù.) Computer : SAMSUNG Magic Station M6000 CPU : Intel Pentium II 300 Mhz (512KB Internal Cache) RAM : SAMSUNG SDRAM 64MB VIDEO : ATI 3D Rage Pro (Korean) - AGP 4MB SOUND : ESS ES1689 AudioDrive at 0x220 irq 5 dma 1,5 MOUSE : SEJIN PS/2 type FDD : SAMSUNG 3.5" 1.44MB HDD : FUJITSU MPC3043AT, 4125MB, CHS=525/255/63, UDMA :... WINDOWS 98 SAMSUNG WN310820A (1.08GB), 1030MB, CHS=523/64/63, DMA :... LINUX CDROM : SAMSUNG CD-ROM SCR-3232 VM103, ATAPI 32X CDROM drive NETWORK : 3COM 3c900b TPO , IRQ 3 MODEM : SAMSUNG LTV90 (56Kbps) MONITOR : SAMSUNG 17" Magic Monitor, CKG7507L(D), :... Syncmaster 700M(s) 1.2 ÇÊÀÚ ¼³Ä¡ Software Á¤º¸ OS : ALzzA RedHat Linux 5.2 (Kernel 2.0.36) XFree86 : XFree86-3.3.2.3-25kr Netscape : Netscape-4.0.7-3kr glibc : glibc-2.0.7-29 Webserver : Apache-1.3.3-3kr PHP : PHP3-3.0.5-3 flex : flex-2.5.4a-4 Database : PostgreSQL-6.4.2 ; Âü°í·Î ÇÊÀÚ´Â Apache + PHP + PostgreSQL ¿¬µ¿Çؼ­ ÀÛ¾÷ÇÑ´Ù. ; ¾ËÂ¥ ·¹µåÇÞ 5.2 »ç¿ëÀÚ¶ó¸é Apache¿Í PHP ±×¸®°í PostgreSQL ÀÌ ±âº»À¸·Î ¼³Ä¡µÇ¾îÀÖ´Ù. ; ƯÈ÷ PHP´Â PostgreSQL¿Í mySQLÀ» ¿¬µ¿°¡´ÉÇÏ°Ô²û Aphache ¼­¹ö¿¡ ¸ðµâÈ­ µÇ¾îÀÖ´Ù. ; ±×·¯¹Ç·Î PostgreSQLÀ̳ª mySQLÀ» ÀÌ¿ëÇÏ¿© µ¥ÀÌÅͺ£À̽º¸¦ ±¸Ãà ÇÏ·Á´Â ÀÌ¿ëÀÚ´Â Apache³ª PHP¸¦ ´Ù½Ã ¼³Ä¡ÇÒ ÇÊ¿ä°¡ ¾øÀÌ ±×´ë·Î »ç¿ëÇÏ¸é µÇ°í, µ¥ÀÌŸº£À̽º(PostgreSQL)¸¸ ¾÷±×·¹À̵å ÇØÁØ´Ù. 1.3 ¼³Ä¡ ¿ä±¸»çÇ× ¼Ò½º¼³Ä¡ : 30MB ÀÌ»ó :... /usr/src/pgsql ¼³Ä¡Çϱâ : 20MB ÀÌ»ó (»ç¿ëÀÚÀÇ µ¥ÀÌŸº£À̽º Á¦¿Ü) :... /usr/local 1.4 ±âÁ¸ ÆÐÅ°Áö »èÁ¦ (RedHat ±âÁØ) X »ç¿ëÀÚ : Á¦¾îÆÇ¿¡¼­ ±âÁ¸ postgres¸¦ »èÁ¦ÇÏÀÚ. ÀϹݻç¿ëÀÚ : rpm -e postgresqlxx (¼³Ä¡µÈ ÆÐÅ°Áö À̸§) 1.5 ½©¸ð¾ç ¼³¸í # : root·Î ·Î±äÇßÀ» °æ¿ì (º»½©) $ : postgres·Î ·Î±äÇßÀ» °æ¿ì (º»½©) 2. ¼³Ä¡ ½ÃÀÛ ------------ 2.1 PostgreSQL ÃֽŹöÀü °¡Á®¿À±â ȨÆäÀÌÁö : http://www.postgresql.org FTP : ftp://ftp.postgresql.org/pub/INSTALL ÇöÀç±îÁö(1999/01/10) ÃֽŹöÀü : 6.4.2 2.2 Postgres ¼öÆÛÀ¯Àú °èÁ¤ ¹ß±Þ (ÀÌ¹Ì ÀÖÀ¸¸é °Ç³Ê¶Ü) ; root·Î ·Î±äÇÏ¿© groupadd command¸¦ ÀÌ¿ë "postgres" ±×·ì »ý¼º. Âü°í : groupadd [g gid [-o]] [-r] [-f] group # addgroup -g 233 postgres ; root À¯Àú»óÅ¿¡¼­ useradd command¸¦ ÀÌ¿ë "postgres" À¯Àú¸¦ »ý¼ºÇÑ´Ù. Âü°í : useradd [-u uid [-o]] [-g group] [-G group,...] [-d home] [-s shell] [-c comment] [-m [-k template]] [-f inactive] [-e expire mm/dd/yy] [-p passwd] [-n] [-r] name # useradd -u 200 -g postgres postgres 2.3 Postgres ¼öÆÛÀ¯Àú·Î ·Î±äÇÏÀÚ. ¾ÕÀ¸·Î ´ëºÎºÐÀÇ ÀÛ¾÷Àº ÀÌ °èÁ¤À» »ç¿ëÇÑ´Ù. # su - postgres 2.4 flex ¹öÀüÀ» È®ÀÎÇÏÀÚ. $ flex --version ; ¸¸¾à ¹öÀüÀÌ 2.5.2 ȤÀº 2.5.4 ÀÌ»óÀ̸é OK ; ¸¸¾à ¹öÀüÀÌ 2.5.3 À̳ª 2.5.2 ÀÌÇÏÀÌ¸é ¾÷±×·¹À̵å Çʼö! ; flex´Â ´ÙÀ½ »çÀÌÆ®¿¡ °¡¸é ÀÖ´Ù. ==> »çÀÌÆ® : ftp://prep.ai.mit.edu/pub/gnu ; flex ¼³Ä¡ # tar xvzf flex-2.5.4.tar.gz # cd flex-2.5.4 # make # make check # make install (·çÆ®±ÇÇÑÀ¸·Î..) 2.5 ±âÁ¸ postgres¸¦ ¾÷±×·¹À̵å ÇÏ´Â °æ¿ì (»õ·Î ¼³Ä¡ÇÏ´Â °æ¿ì´Â 2.8Àý·Î À̵¿) ; ±âÁ¸ µ¥ÀÌŸ¸¦ ¹é¾÷ÇÑ´Ù. $ pg_dumpall -z > db.out ; ÃֽŠ¹öÀüÀÇ pg_dumpall À» ÀÌ¿ëÇÏ·Á¸é.. ( \´Â ´ÙÀ½ÁÙ°ú ¿¬°áµÇ¾ú´Ù´Â Ç¥½Ã, \Ç¥½Ã´Â ÀÔ·ÂÇÏÁö ¸»°Í) $ gunzip -c postgresql-v6.4.2.tar.gz \ | tar xvf -src/bin/pg_dumpall <= ÇÑÁÙ¿¡ ÀÔ·Â $ chmod a+x src/bin/pg_dump/pg_dumpall $ src/bin/pg_dump/pg_dumpall -z > db.out $ rm -rf src ; db.out ÆÄÀÏÀ» È®ÀÎÇØ º¸ÀÚ. $ ls -l db.out 2.6 ¾÷±×·¹À̵带 ÇÏ·Á¸é ±âÁ¸ÀÇ postmaster¸¦ ÁßÁö½ÃŲ´Ù. $ ps -ax | grep postmaster $ kill pid (À§¿¡¼­ È®ÀÎµÈ ¹øÈ£) 2.7 ±âÁ¸ÀÇ µð·ºÅ丮¸¦ ¹é¾÷ÇÑ´Ù. # cd /usr/src # mv pgsql pgsql_6_0 # cd /usr/local # mv pgsql pgsql_6_0 2.8 ¼³Ä¡ÇÒ µð·ºÅ丮¸¦ ¸¸µç´Ù. # cd /usr/src # mkdir pgsql # chown postgres.postgres pgsql # cd /usr/local # mkdir pgsql # chown postgres.postgres pgsql 2.9 ¼Ò½ºÆÄÀÏÀÇ ¾ÐÃàÀ» Ǭ´Ù. (¾ÕÀ¸·ÎÀÇ °úÁ¤Àº ¼³Ä¡¸¦ ÆíÇÏ°Ô Çϱâ À§Çؼ­ root·Î ¼³Ä¡ÇÑÈÄ postgres ·Î ±ÇÇÑÀ» ÁÖ´Â ¹æ¹ýÀ¸·Î ÇÏ°Ú´Ù.) # cd /usr/src/pgsql # tar xzvf (¼Ò½º°¡ ÀÖ´Â µð·ºÅ丮)/postgresql-v6.4.2.tar.gz 2.10 ¼Ò½ºÄڵ带 ½Ã½ºÅÛ¿¡ ¸Â°Ô ¼³Á¤ÇÑ´Ù. # cd /usr/src/pgsql/src # ./configure [ options ] ; ÇÊ¿äÇÑ ¿É¼Ç ¹× ÆÁ ¼³¸í * pentium pro ±Þ¿¡¼­ ÃÖÀûÈ­ (»ç½Ç ¸®´ª½ºÄ¿³Î ¹× ´ë´Ù¼öÀÇ ÀÀ¿ëÇÁ·Î±×·¥Àº ´ëºÎºÐ 386±ÞÀ» ±âÁØ·Î ÆÐŰ¡ÀÛ¾÷À» ÇÑ´Ù. postgresaµµ ¿¹¿Ü´Â ¾Æ´Ï¾î¼­ ±âº»¼³Ä¡´Â 386±Þ¿¡ ÃÖÀûÈ­ µÇ¾îÀÖ´Ù. pentium±Þ ÀÌ»óÀ̶ó¸é ¾Æ·¡¿Í °°ÀÌ ÇØÁÖ¸éµÈ´Ù. - »ç½Ç 386À¸·Î ÃÖÀûÈ­µÇ³ª ±×ÀÌ»óÀ¸·ÎµÇ³ª ¼º´ÉÂ÷ÀÌ´Â º°·Î ¾ø´Ù.) # cd /usr/src/pgsql/src # vi Makefile.custom CFLAG+= -m486 <== ÀÌ ÇÑÁÙÀ» ÀÛ¼ºÇÏ°í ÀúÀåÇÑ´Ù. ±×·¯¸é pentitum pro ±Þ À̻󿡼­ ÃÖÀûÈ­°¡ µÈ´Ù. ** ÇÑ±Û »ç¿ë (¸ÖƼ¹ÙÀÌÆ® ¹®ÀÚ »ç¿ë) ; Å×ÀÌºí ¹× Çʵ忡 ÇѱÛÀ» »ç¿ëÇÏ·Á¸é configure¿¡ ¿É¼ÇÀ» ÁØ´Ù. ¿É¼Ç : --with-mb=EUC_KR Âü°í: ÇÊÀÚÀÇ configure ¼³Á¤ # cd /usr/src/pgsql/src # vi Makefile.custom CFLAG+= -m486 # ./configure --with-mb=EUC_KR 2.11 ¸Ç ÆäÀÌÁö ¹× HTML ¹®¼­È­ÀÏ ¼³Ä¡ # cd /usr/src/pgsql/doc # make install 2.12 ÇÁ·Î±×·¥ ÄÄÆÄÀÏ # cd /usr/src/pgsql/src # make all ; ¸¸¾à ÄÄÆÄÀÏÀÌ ½ÇÆÐÇß´Ù¸é # make clean À» ÇÑÈÄ ´Ù½Ã ¿É¼ÇµîÀ» Á¶Á¤Çؼ­ ÄÄÆÄÀÏ ÇÏ¸é µÈ´Ù. ; ÄÄÆÄÀÏÀÌ Á¦´ë·Î µÇ¾úÀ¸¸é ´ÙÀ½°ú °°Àº ¸Þ¼¼Áö°¡ º¸ÀδÙ. 'All of PostgreSQL is successfully made. Ready to install' 2.13 ÇÁ·Î±×·¥ ¼³Ä¡ ; ¼³Ä¡´Â postgres °èÁ¤À¸·Î ÇÑ´Ù. $ cd /usr/src/pgsql/src $ make install ; ¸¸¾à postgres °èÁ¤À¸·Î ¼³Ä¡°¡ Àß ¾ÈµÉ¶§, root·Î ¼³Ä¡¸¦ ÇÏ°í pgsqlµð·ºÅ丮ÀÇ ±ÇÇѸ¸ º¯°æÇØÁÖ¸é ¹®Á¦¾øÀÌ »ç¿ëÇÒ ¼ö ÀÖ´Ù. # chown -R postgres.postgres /usr/local/pgsql 2.14 ½Ã½ºÅÛÀÌ °øÀ¯¶óÀ̺귯¸®°¡ ÇÊ¿äÇÒ¶§, Àß Ã£À»¼ö ÀÖµµ·Ï ¾Æ·¡¿Í °°ÀÌ ¼öÁ¤ÇØ ÁØ´Ù. a. ¸®´ª½ºÀÇ °æ¿ì ¿ì¼± root·Î ·Î±äÇؼ­.. /etc/ld.so.conf ÆÄÀÏ¿¡ ´ÙÀ½ ÇÑÁÙÀ» Ãß°¡ÇÏÀÚ. /usr/local/pgsql/lib ±×¸®°í ³ª¼­ /sbin/ldconfig ¸¦ ½ÇÇàÇÑ´Ù. ; ¸®´ª½º ½Ã½ºÅÛÀ̶ó¸é a ¸¦ ½ÇÇàÇÏ¸é µÇ°í, ´Ù¸¥ unix½Ã½ºÅÛÀ̶ó¸é a ¸»°í b³ª c¸¦ ½ÇÇàÇÒ ÇÊ¿ä°¡ ÀÖÀ»Áö ¸ð¸¥´Ù. b. º»½©(bash) À̶ó¸é, ¾Æ·¡¿Í °°ÀÌ ½ÇÇàÇÏÀÚ. export LD_LIBRARY_PATH=/usr/local/pgsql/lib c. C½©(csh) À̶ó¸é, ¾Æ·¡¿Í °°ÀÌ ½ÇÇàÇÏÀÚ. setenv LD_LIBRART_PATH /usr/local/pgsql/lib ; µ¥ÀÌŸº£À̽º¸¦ »ý¼ºÇÒ¶§, ¾Æ·¡¿Í °°Àº ¸Þ¼¼Áö°¡ ³ª¿À¸é À§ °úÁ¤ÀÌ ÇÊ¿äÇÏ´Ù. pd_id: can't load library 'libpq.so' ±×¸®°í ´Ù½Ã µ¥ÀÌŸº£À̽º¸¦ »ý¼ºÇÑ´Ù. 2.15 ȯ°æº¯¼ö¸¦ ¼³Á¤ÇÑ´Ù. a. »ç¿ëÀÚÀÇ ·Î±×ÀΠȯ°æº¯¼ö¿¡ ´ÙÀ½ÁÙÀ» Ãß°¡ÇÑ´Ù. (bash »ç¿ë°æ¿ì) ~/.bash_profile PATH=$PATH:/usr/local/pgsql/bin MANPATH=$MANPATH:/usr/local/pgsql/man PGLIB=/usr/local/pgsql/lib PGDATA=/usr/local/pgsql/data export PATH MANPATH PGLIB PGDATA b. ȯ°æº¯¼ö¸¦ ¼³Á¤ÇÏ°í³­ÈÄ ´ÙÀ½°ú °°ÀÌ ½ÇÇàÇÏ¸é µÈ´Ù. $ source ~/.bash_profile % ȯ°æº¯¼ö ¼³Á¤ ÆÁ ; À§ÀÇ °æ¿ì´Â °³º°ÀûÀ¸·Î »ç¿ëÀÚ¿¡°Ô »ç¿ëÇÒ ¼ö ÀÖ°Ô ÇØÁÖ´Â °ÍÀÌ°í, ¸ðµç »ç¿ëÀÚ¿¡°Ô »ç¿ëÇÒ ¼ö ÀÖ°Ô ÇÏ·Á¸é ¾Æ·¡¿Í °°ÀÌ ÇÏ´Â ¹æ¹ýµµ ÀÖ´Ù. ; ·¹µåÇÞÀÇ °æ¿ì, /etc/profile.d ¿¡ postgresȯ°æº¯¼ö¸¦ ¸¸µç´Ù. ¿¹·Î postgres-environment.sh (bash ÀÇ °æ¿ì)ÆÄÀÏ·Î ¸¸µç´Ù. ÆÄÀÏ À̸§Àº »ó°ü ¾øÀ¸³ª bashÀÇ °æ¿ì´Â ²À .sh·Î ³¡³ª¾ßÇÏ°í cshÀ̳ª tcsh »ç¿ëÀÚ´Â ²À .csh ÆÄÀÏ¿¡ setenv¸¦ »ç¿ëÇÏ¿© ¾Æ·¡¿Í °°Àº ³»¿ëÀÇ È¯°æº¯¼ö¸¦ ¼³Á¤ÇÒ ¼ö ÀÖ´Ù. ¿¹) /etc/profile.d/postgres-environment.sh PATH=$PATH:/usr/local/pgsql/bin MANPATH=$MANPATH:/usr/local/pgsql/man PGLIB=/usr/local/pgsql/lib PGDATA=/usr/local/pgsql/data export PATH MANPATH PGLIB PGDATA ; .sh ³ª .csh ÆÄÀÏÀ» ¸¸µé°í ½ÇÇà°¡´ÉÇÏ°Ô ÇØÁÖ´Â°É ÀØÁö¸»ÀÚ. (¹°·Ð root·Î..) # chmod 755 /etc/profile.d/postgres-environment.sh ; /etc/profile.d/ µð·ºÅ丮°¡ ¾ø´Â °æ¿ì´Â, /etc/profile (bash)³ª /etc/csh.cshrc (csh/tcsh) ÆÄÀÏ¿¡ À§ÀÇ ¸í·ÉÀ» Ãß°¡½ÃÄÑÁØ´Ù. 2.16 µ¥ÀÌŸ º£À̽º¸¦ ÃʱâÈ­ÇÑ´Ù (¹Ýµå½Ã postgres·Î ·Î±ä) (¾ÕÀ¸·ÎÀÇ ¸ðµç ÀÛ¾÷Àº postgres·Î ÇÑ´Ù. Àý´ë root·Î »ç¿ëÇÏÁö ¸¶¶ó, ±× °æ¿ì¿¡´Â º¸¾È¿¡ Å« ÇãÁ¡À» ³ëÃâÇÏ°Ô µÈ´Ù.) $ initdb % ¸ÖƼ¹ÙÀÌÆ® ÀÎÄÚµù ÆÁ!! ; initdb command´Â postgresqlÀÇ ±âº» ÀÎÄÚµùÀ¸·Î ÃʱâÈ­µÈ´Ù. ¿¹¸¦ µé¾î, $ initdb -e EUC_KR ÀÌ·¸°Ô Çϸé Çѱ۷ΠÀÎÄÚµù ÇÒ ¼ö ÀÖ´Ù. (EUC_JP Çϸé ÀϺ»¾î·Î, EUC_CN Çϸé Áß±¹¾î·Î.. ÀÚ¼¼ÇÑ ³»¿ëÀº doc/README.mb ÆÄÀÏÀ» ÂüÁ¶) 2.17 µ¥ÀÌŸº£À̽º¿¡ Á¢±ÙÇÒ ±ÇÇÑÀ» ¼öÁ¤ÇÑ´Ù. ; ÀÌ ÀÛ¾÷Àº /etc/local/pgsql/data/pg_hba.conf ÆÄÀÏÀ» ¼öÁ¤ÇÑ´Ù. ¼öÁ¤ÈÄ ¹Ýµå½Ã Àбâ Àü¿ë¸ðµå·Î ¸¸µé¾î µÐ´Ù. (¿ø°ÝÁ¢¼ÓÀ» Áö¿øÇÒ¶§ Áß¿äÇÏ´Ù. ·ÎÄÿ¡¼­¸¸ »ç¿ëÇÒ °æ¿ì´Â ±×³É ³ªµÖµµ »ó°ü¾ø´Ù.) 2.18 command line¿¡¼­ °£´ÜÇÏ°Ô Å×½ºÆ® Çغ¸ÀÚ. a. postmaster ´ë¹®À» ¶ç¿î´Ù. $ postmaster -i & ; 6.4 ÀÌÀü¹öÀü¿¡¼­´Â postmaster¸¸ ¶ç¿ì¸é µÇ¾ú´Âµ¥, tcp¸¦ Áö¿ø ÇÏ·Á¸é, Áï ´Ù¸¥ÄÄÇ»ÅÍ¿¡¼­ ³×Æ®¿öÅ©·Î µ¥ÀÌŸº£À̽º¸¦ Á¢±ÙÇÒ¶§ ¹Ýµå½Ã postmaster -i ·Î ÇÑ´Ù. (ÀÌ °æ¿ì pg_hba.conf ÆÄÀÏÀ» ÀûÀýÈ÷ ¼öÁ¤ÇØ ÁÖ¾î¾ß ÇÑ´Ù.) ; ·ÎÄÿ¡¼­¸¸ »ç¿ëÇÒ °Å¶ó¸é postmaster¸¸ ½ÇÇàÇÏ¸é µÈ´Ù. b. µ¥ÀÌŸº£À̽º¸¦ ¸¸µç´Ù. $ createdb c. »õ µ¥ÀÌŸº£À̽º¿¡ Á¢¼ÓÇÑ´Ù. $ psql d. ±×¸®°í, »ùÇà Äõ¸®¸¦ ½ÇÇàÇØ º»´Ù. postgres=> SELECT datetime 'now'; e. psqlÀ» ºüÁ®³ª¿Â´Ù. postgres=> \q f. Å×½ºÆ® µ¥ÀÌŸº£À̽º¸¦ Áö¿î´Ù. $ destroydb 2.19 Postgres ¼öÆÛÀ¯Àú °èÁ¤ (¾Õ¿¡¼­ postgres·Î ¸¸µê)À¸·Î postmaster¸¦ ½ÇÇàÇÑ´Ù. Àý´ë root °èÁ¤À¸·Î ½ÇÇàÇÏÁö ¾Ê´Â´Ù. ºÎÆÃÇÒ¶§¸¶´Ù ÀÚµ¿À¸·Î ¶ç¿ì·Á¸é ¾Æ·¡¿Í °°ÀÌ ¼öÁ¤ÇØ ÁØ´Ù. ; ¾Æ·¡ ÀÛ¾÷Àº ¹°·Ð root·Î ÇÑ´Ù. a. º¸ÅëÀÇ linux¸¦ Æ÷ÇÔÇÑ unix ½Ã½ºÅÛ¿¡´Â /etc/rc.d µð·ºÅ丮 ¹Ø¿¡ ºÎÆÃÇÒ¶§ ½ÇÇàµÇ´Â ¿©·¯°¡Áö ½ºÅ©¸³Æ®°¡ ÀÖ´Ù. ±× Áß rc.local Á¤µµÀÇ ÆÄÀÏ¿¡ ´ÙÀ½°ú °°ÀÌ Àû¾îÁØ´Ù. ¹°·Ð root·Î. (\´Â ´ÙÀ½ÁÙ°ú ¿¬°áµÇ¾ú´Ù´Â Ç¥½Ã, \Ç¥½Ã´Â ÀÔ·ÂÇÏÁö ¸»°Í) # PostgreSQL database Server starting <== ÁÖ¼®¹® echo "PostgreSQL Starting..." su postgres -c "/usr/local/pgsql/bin/postmaster -S -D \ /usr/local/pgsql/data" <== ÇÑÁÙ¿¡ ÀÔ·Â b. ·¹µåÇÞ ¸®´ª½º¶ó¸é ´ÙÀ½°ú °°ÀÌ ÇÒ ¼öµµ ÀÖ´Ù. ; /etc/inittab ÆÄÀÏ¿¡ ´ÙÀ½ ÇÑÁÙÀ» Ãß°¡ÇÑ´Ù. (ÇÑÁÙ¿¡ ÀԷµµ·Ï ÇÑ´Ù.) pg:2345:respawn:/bin/su - postgres -c "/usr/local/pgsql/bin/postmaster -D/usr/local/pgsql/data >> /usr/local/pgsql/server.log 2>&1 ; ¿©±â¿¡¼­ foo µ¥ÀÌŸ º£À̽º¸¦ ¸¸µé¾î º¸ÀÚ template1=> create database foo; CREATEDB ; µ¥ÀÌŸº£À̽º¿¡ ¿¬°á template1=> \c foo connecting to new database: foo ("slash" command´Â SQL ¹®¹ýÀÌ ¾Æ´Ï¾î¼­ ¼¼¹ÌÄÝ·Ð(;)ÀÌ ÇÊ¿ä¾ø´Ù.) foo=> create table bar (i int4, c char(16)); CREATE ; ±×·±´ÙÀ½ »õ·Î¿î Å×À̺íÀ» Á¡°ËÇغ»´Ù. foo=> \d bar Table = bar +---------------+----------+---------+ | Field | Type | Length | +---------------+----------+---------+ | i | int4 | 4 | | c | (bp)char | 16 | +---------------+----------+---------+ ; ÀϹÝÀûÀ¸·Î µ¥ÀÌŸº£À̽º¸¦ ¸¸µé¶§´Â createdb ¸¦ »ç¿ëÇÏ°í, »èÁ¦ÇÒ¶§´Â destroydb ¸¦ »ç¿ëÇϸç, DB »ç¿ëÀÚ¸¦ Ãß°¡ÇÒ¶§´Â createuser¸¦ »ç¿ëÇÏ°í, »èÁ¦ÇÒ¶§´Â destroyuser¸¦ »ç¿ëÇÑ´Ù) ; foo µ¥ÀÌŸ º£À̽º¸¦ ¸¸µç´Ù¸é $ createdb foo ; foo µ¥ÀÌŸ º£À̽º¸¦ ÀÛ¾÷ÇÏ·Á¸é.. $ psql foo ; foo µ¥ÀÌŸ º£À̽º¸¦ »èÁ¦ÇÏ·Á¸é (Çѹø »èÁ¦µÈ ÀÚ·á´Â º¹±¸°¡ ºÒ°¡´ÉÇÏ´Ù.) $ destroydb foo ; gildong À̶õ DB»ç¿ëÀÚ¸¦ Ãß°¡ÇÏ·Á¸é.. (óÀ½¿¡´Â postgres(¼öÆÛÀ¯Àú)¸¸ DB¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù. ±×·¡¼­, ÀÏ¹Ý ÀÌ¿ëÀÚ°¡ DB¸¦ »ç¿ëÇÏ·Á¸é, µî·ÏÀ» ÇÑ´Ù.) $ createuser gildong ; gildong À̶õ DB»ç¿ëÀÚ¸¦ »èÁ¦ÇÏ·Á¸é.. (ÀÌ°Ç ¸®´ª½º ÀÚü °èÁ¤À» »èÁ¦ÇÏ´Â°Ô ¾Æ´Ï°í postgres¸¦ »ç¿ëÇÒ ¼ö ¾ø°Ô ¸¸µå´Â °ÍÀÌ´Ù.) $ destroyuser gildong 4. Ãß°¡ÀûÀ¸·Î ÇÒ ÀÏ ------------------- ; Áú¹®À̳ª ¹ö±× ȤÀº Çǵå¹éÀÌ ÀÖÀ¸¸é, ¿ì¼± /usr/src/pgsql/doc/ ÀÇ ¹®¼­¸¦ Àо¶ó. FAQ´Â Å« µµ¿òÀÌ µÉ°ÍÀÌ´Ù. (Çѱ۹ø¿ªÀº KLDP¸¦ ÂüÁ¶) ; ¶ÇÇÑ, http://www.postgresql.org ¸¦ ÀÚÁÖ ¹æ¹®ÇÏ¿© ÃÖ½ÅÀÇ Á¤º¸¸¦ ¾òÀÚ. ; ÀÌ ¹®¼­´Â postgresÀÇ »ç¿ë¹ýÀ» ´Ù·é ¹®¼­°¡ ¾Æ´Ï¹Ç·Î, »ç¿ë¹ýÀº HOW-TO ¹®¼­µîÀ» ÂüÁ¶ ¹Ù¶õ´Ù. 5. ¸¶Ä¡¸é¼­ ----------- ; ÀÌ»óÀ¸·Î ¸ðµç ¼³Ä¡°¡ ³¡³µ½À´Ï´Ù. ; PostgreSQL°ú ÇÔ²² Áñ°Å¿î ¸®´ª½ÌÀÌ µÇ±æ... ; Áú¹®ÀÖÀ¸½Ã¸é, ´º½º±×·ì¿¡ Æ÷½ºÆÃÇϽðųª, °¢ µ¿È£È¸µî¿¡ Áú¹®ÇÏ½Ã¸é ½Ç·ÂÀÖ´Â ¸¹Àº ºÐµéÀÌ µµ¿ÍÁÖ½Ç °Ì´Ï´Ù.