<BODY bgcolor="#ffffff" text="#000000" link="#ff0000" vlink="#a00000" alink="#0000ff">
<H1>ïÔ×ÅÔÙ ÎÁ ÞÁÓÔÏ ÚÁÄÁ×ÁÅÍÙÅ ×ÏÐÒÏÓÙ ÐÏ PostgreSQL</H1>
- <P>äÁÔÁ ÐÏÓÌÅÄÎÅÇÏ ÏÂÎÏ×ÌÅÎÉÑ: ÷ÏÓËÒÅÓÅÎØÅ 18 ÉÀÎÑ 15:33:25 EDT 2006</P>
+ <P>äÁÔÁ ÐÏÓÌÅÄÎÅÇÏ ÏÂÎÏ×ÌÅÎÉÑ: ðÑÔÎÉÃÁ 26 ÏËÔÑÂÒÑ 14:59:45 EDT 2007</P>
<P>áÎÇÌÉÊÓËÉÊ ×ÁÒÉÁÎÔ ÓÏÐÒÏ×ÏÖÄÁÅÔ: âÒÀÓ íÏÍØÑÎ (Bruce Momjian) (<A href=
"mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)<BR>
</P>
<P>óÁÍÕÀ Ó×ÅÖÕÀ ÁÎÇÌÉÊÓËÕÀ ×ÅÒÓÉÀ ÄÏËÕÍÅÎÔÁ ÍÏÖÎÏ ÎÁÊÔÉ ÎÁ
- <A href="http://www.postgresql.org/files/documentation/faqs/FAQ.html">http://www.PostgreSQL.org/files/documentation/faqs/FAQ.html</A>.</P>
+ <A href="http://www.postgresql.org/files/documentation/faqs/FAQ.html">http://www.postgresql.org/files/documentation/faqs/FAQ.html</A>.</P>
<P>ïÔ×ÅÔÙ ÎÁ ×ÏÐÒÏÓÙ ÓÐÅÃÉÆÉÞÎÙÅ ÄÌÑ ËÏÎËÒÅÔÎÙÈ ÐÌÁÔÆÏÒÍ ÍÏÖÎÏ ÎÁÊÔÉ ÎÁ
- <A href="http://www.postgresql.org/docs/faq/">http://www.PostgreSQL.org/docs/faq/</A>.</P>
+ <A href="http://www.postgresql.org/docs/faq/">http://www.postgresql.org/docs/faq/</A>.</P>
<HR>
<H2 align="center">ïÂÝÉÅ ×ÏÐÒÏÓÙ</H2>
<A href="#item1.12">1.12</A>) ëÁË ÍÎÅ ÏÔÐÒÁ×ÉÔØ ÉÓÐÒÁ×ÌÅÎÉÅ ÉÌÉ ÐÒÉÓÏÅÄÉÎÉÔÓÑ Ë ËÏÍÁÎÄÅ ÒÁÚÒÁÂÏÔÞÉËÏ×?<BR>
<A href="#item1.13">1.13</A>) ëÁË ÓÒÁ×ÎÉÔØ PostgreSQL Ó ÄÒÕÇÉÍÉ
<SMALL>óõâä</SMALL>?<BR>
-
+ <A href="#item1.14">1.14</A>) âÕÄÅÔ ÌÉ PostgreSQL ÒÁÂÏÔÁÔØ Ó ÐÏÓÌÅÄÎÉÍÉ ÉÚÍÅÎÅÎÉÑÍÉ, × ÒÁÚÎÙÈ ÓÔÒÁÎÙÈ,
+ ËÁÓÁÀÝÉÍÉÓÑ ÄÎÅ×ÎÏÇÏ ×ÒÅÍÅÎÉ?<BR>
<H2 align="center">÷ÏÐÒÏÓÙ ÐÏÌØÚÏ×ÁÔÅÌÅÊ ÐÏ ËÌÉÅÎÔÓËÏÊ ÞÁÓÔÉ</H2>
<A href="#item2.1">2.1</A>) ëÁËÉÅ ÉÎÔÅÒÆÅÊÓÙ ÅÓÔØ ÄÌÑ PostgreSQL?<BR>
<A href="#item4.8">4.8</A>) ëÁË ÍÎÅ ×ÙÐÏÌÎÉÔØ ÐÏÉÓË ÒÅÇÕÌÑÒÎÏÇÏ ×ÙÒÁÖÅÎÉÑ
É ÐÏÉÓË ÎÅÚÁ×ÉÓÉÍÙÊ ÏÔ ÒÅÇÉÓÔÒÁ ÂÕË× ÐÏÉÓË ÒÅÇÕÌÑÒÎÏÇÏ ×ÙÒÁÖÅÎÉÑ?
ëÁË ÍÎÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÉÎÄÅËÓ ÄÌÑ ÐÏÉÓËÁ ÎÅÚÁ×ÉÓÉÍÏÇÏ ÏÔ ÒÅÇÉÓÔÒÁ ÂÕË×?<BR>
- <A href="#item4.9">4.9</A>) ëÁË ÍÎÅ ÏÐÒÅÄÅÌÉÔØ, ÞÔÏ ÚÎÁÞÅÎÉÅ ÐÏÌÑ ÒÁ×ÎÏ
- <SMALL>NULL</SMALL> × ËÁËÏÍ-ÌÉÂÏ ÚÁÐÒÏÓÅ? íÏÇÕ Ñ ÏÔÓÏÒÔÉÒÏ×ÁÔØ ÐÏÌÑ
- <SMALL>NULL</SMALL> ÉÌÉ ÎÅÔ?<BR>
+ <A href="#item4.9">4.9</A>) ëÁË ÍÎÅ ÏÐÒÅÄÅÌÉÔØ, ÞÔÏ ÚÎÁÞÅÎÉÅ ÐÏÌÑ × ËÁËÏÍ-ÌÉÂÏ
+ ÚÁÐÒÏÓÅ ÒÁ×ÎÏ <SMALL>NULL</SMALL>? ëÁË ÍÎÅ ÓÏÅÄÉÎÉÔØ ×ÏÚÍÏÖÎÙÅ
+ <SMALL>NULL</SMALL>? íÏÇÕ Ñ ÓÏÒÔÉÒÏ×ÁÔØ ÐÏÌÑ <SMALL>NULL</SMALL> ÉÌÉ ÎÅÔ?<BR>
<A href="#item4.10">4.10</A>) ëÁËÏ×Ù ÏÔÌÉÞÉÑ ÍÅÖÄÕ ÒÁÚÎÙÍÉ ÓÉÍ×ÏÌØÎÙÍÉ
ÔÉÐÁÍÉ?<BR>
<A href="#item4.11.1">4.11.1</A>) ëÁË ÍÎÅ ÓÏÚÄÁÔØ ÐÏÌÅ serial/Ó-Á×ÔÏ-Õ×ÅÌÉÞÅÎÉÅÍ?<BR>
ÎÅ ÓÕÝÅÓÔ×ÕÅÔ", ËÏÇÄÁ ÏÂÒÁÝÁÀÔÓØ Ë ×ÒÅÍÅÎÎÙÍ ÔÁÂÌÉÃÁÍ × ÆÕÎËÃÉÑÈ PL/PgSQL?<BR>
<A href="#item4.20">4.20</A>) ëÁËÉÅ ÅÓÔØ ÒÅÛÅÎÉÑ ÄÌÑ ÒÅÐÌÉËÁÃÉÉ?<BR>
<A href="#item4.21">4.21</A>) ðÏÞÅÍÕ ÉÍÅÎÁ ÔÁÂÌÉÃÙ É ËÏÌÏÎÏË ÎÅ
- ÒÁÓÐÏÚÎÁÀÔÓÑ × × ÍÏ£Í ÚÁÐÒÏÓÅ?<BR>
+ ÒÁÓÐÏÚÎÁÀÔÓÑ × × ÍÏ£Í ÚÁÐÒÏÓÅ? ðÏÞÅÍÕ ÎÅ ÓÏÈÒÁÎÑÀÔÓÑ ÚÁÇÌÁ×ÎÙÅ ÂÕË×Ù?<BR>
<HR>
<H3><A name="item1.1">1.1</A>) þÔÏ ÔÁËÏÅ PostgreSQL? ëÁË ÐÒÏÉÚÎÏÓÉÔÓÑ ÜÔÏ ÎÁÚ×ÁÎÉÅ?</H3>
<P>PostgreSQL ÐÒÏÉÚÎÏÓÉÔÓÑ <I>Post-Gres-Q-L (ðÏÓÔ-çÒÅÓ-ëØÀ-üÌ)</I>,
- ÔÁËÖÅ ÉÎÏÇÄÁ ÇÏ×ÏÒÑÔ ÐÒÏÓÔÏ <I>Postgres</I>. ÷Ù ÍÏÖÅÔÅ ÕÓÌÙÛÁÔØ ËÁË
- ÜÔÏ ÐÒÏÉÚÎÏÓÉÔÓÑ Ó ÐÏÍÏÝØÀ ÁÕÄÉÏÆÁÊÌÁ, ËÏÔÏÒÙÊ ÄÏÓÔÕÐÅÎ ×
- <A href="http://www.postgresql.org/files/postgresql.mp3">ÆÏÒÍÁÔÅ MP3</A>.
+ ÔÁËÖÅ ÇÏ×ÏÒÑÔ É ÐÒÏÓÔÏ <I>Postgres</I>, ÏÓÏÂÅÎÎÏ ÐÒÉ ÒÁÚÇÏ×ÏÒÅ.
+ (äÌÑ ÏÓÏÂÏ ÌÀÂÏÐÙÔÓÔ×ÕÀÝÉÈ ËÁË ÐÒÏÉÚÎÏÓÉÔØ "PostgreSQL", ÓÕÝÅÓÔ×ÕÅÔ
+ <A href="http://www.postgresql.org/files/postgresql.mp3">ÁÕÄÉÏ-ÆÁÊÌ</A>).
</P>
<P>PostgreSQL - ÜÔÏ ÏÂßÅËÔÎÏ-ÒÅÌÑÃÉÏÎÎÁÑ ÓÉÓÔÅÍÁ ÕÐÒÁ×ÌÅÎÉÑ ÂÁÚÁÍÉ
ÐÏ ×ÓÅÍÕ ÍÉÒÕ É Ó×ÑÚÁÎÎÁÑ ÞÅÒÅÚ éÎÔÅÒÎÅÔ. òÁÚÒÁÂÏÔËÁ Ñ×ÌÑÅÔÓÑ
ÏÂÝÅÓÔ×ÅÎÎÙÍ ÐÒÏÅËÔÏÍ É ÎÅ ÕÐÒÁ×ÌÑÅÔÓÑ ËÁËÏÊ-ÌÉÂÏ ËÏÍÐÁÎÉÅÊ.
ðÏÄÒÏÂÎÏÓÔÉ ÓÍÏÔÒÉÔÅ × FAQ ÄÌÑ ÒÁÚÒÁÂÏÔÞÉËÏ×,
- <A href="http://www.postgresql.org/files/documentation/faqs/FAQ_DEV.html">
- http://www.PostgreSQL.org/files/documentation/faqs/FAQ_DEV.html</A>
+ <A href="http://www.postgresql.org/docs/faqs.FAQ_DEV.html">
+ http://www.postgresql.org/docs/faqs.FAQ_DEV.html</A>
</P>
<H3><A name="item1.2">1.2</A>) ëÔÏ ÕÐÒÁ×ÌÑÅÔ PostgreSQL?</H3>
<P>óÉÓÔÅÍÁ õÐÒÁ×ÌÅÎÉÑ âÁÚÁÍÉ äÁÎÎÙÈ PostgreSQL</P>
- <P>Portions copyright (c) 1996-2006, PostgreSQL Global Development
+ <P>Portions copyright (c) 1996-2007, PostgreSQL Global Development
Group Portions Copyright (c) 1994-1996 Regents of the University of
California</P>
Ë ÍÏÍÅÎÔÕ ×ÙÈÏÄÁ ÄÁÎÎÏÊ ×ÅÒÓÉÉ.</P>
<P>PostgreSQL ÔÁËÖÅ ÒÁÂÏÔÁÅÔ ÎÁ ÏÐÅÒÁÃÉÏÎÎÙÈ ÓÉÓÔÅÍÁÈ Microsoft
- Windows, ÏÓÎÏ×ÁÎÎÙÈ ÎÁ NT, ÔÁËÉÈ ËÁË Win2000, WinXP É Win2003.
+ Windows, ÏÓÎÏ×ÁÎÎÙÈ ÎÁ NT, ÔÁËÉÈ ËÁË Win2000 SP4, WinXP É Win2003.
ðÁËÅÔ ÉÎÓÔÁÌÌÑÔÏÒÁ ÄÏÓÔÕÐÅÎ ÐÏ ÁÄÒÅÓÕ
<A href="http://pgfoundry.org/projects/pginstaller">
http://pgfoundry.org/projects/pginstaller</A>. ÷ÅÒÓÉÉ Windows,
<P>þÅÒÅÚ ÂÒÁÕÚÅÒ, ÉÓÐÏÌØÚÕÑ <a href="http://www.postgresql.org/ftp/">
http://www.postgresql.org/ftp/</a> É ÞÅÒÅÚ ftp, ÉÓÐÏÌØÚÕÑ
- <A href="ftp://ftp.PostgreSQL.org/pub/">ftp://ftp.PostgreSQL.org/pub/</A>.</P>
+ <A href="ftp://ftp.PostgreSQL.org/pub/">ftp://ftp.postgresql.org/pub/</A>.</P>
<H3><A name="item1.6">1.6</A>) ëÁËÁÑ ×ÅÒÓÉÑ ÎÁÉÂÏÌÅÅ Ó×ÅÖÁÑ?</H3>
- <P>ðÏÓÌÅÄÎÉÊ ×ÙÐÕÓË PostgreSQL - ÜÔÏ ×ÅÒÓÉÑ 8.1.4</P>
+ <P>ðÏÓÌÅÄÎÉÊ ×ÙÐÕÓË PostgreSQL - ÜÔÏ ×ÅÒÓÉÑ 8.2.5</P>
<P>íÙ ÐÌÁÎÉÒÕÅÍ ×ÙÐÕÓËÁÔØ ÎÏ×ÙÅ ÓÔÁÒÛÉÅ ×ÅÒÓÉÉ ËÁÖÄÙÊ ÇÏÄ,
Á ÍÌÁÄÛÉÅ ×ÅÒÓÉÉ ËÁÖÄÙÅ ÎÅÓËÏÌØËÏ ÍÅÓÑÃÅ×.</P>
ÐÏÄËÌÀÞÉÔØÓÑ, ×Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ × Unix ×ÙÚÏ× ÐÒÏÇÒÁÍÍÙ
<code>irc -c '#postgresql' "$USER" irc.freenode.net</code> ÉÌÉ
ÌÀÂÏÊ ÄÒÕÇÏÊ IRC ËÌÉÅÎÔ. îÁ ÜÔÏÍ ÖÅ ÓÅÒ×ÅÒÅ ÓÕÝÅÓÔ×ÕÀÔ ËÁÎÁÌÙ ÎÁ
- ÉÓÐÁÎÓËÏÍ (<I>#postgresql-es</I>) É ÆÒÁÎÃÕÚÓËÏÍ (<I>#postgresqlfr</I>)
- ÑÚÙËÁÈ. ôÁËÖÅ ÓÕÝÅÓÔ×ÕÅÔ ËÁÎÁÌ ÐÏ PostgreSQL ÎÁ ÓÅÒ×ÅÒÅ EFNet.</P>
+ ÉÓÐÁÎÓËÏÍ (<I>#postgresql-es</I>), ÆÒÁÎÃÕÚÓËÏÍ (<I>#postgresqlfr</I>)
+ É ÂÒÁÚÉÌØÓËÏÍ (<I>#postgresql-br</I>) ÑÚÙËÁÈ. ôÁËÖÅ ÓÕÝÅÓÔ×ÕÅÔ ËÁÎÁÌ
+ ÐÏ PostgreSQL ÎÁ ÓÅÒ×ÅÒÅ EFNet.</P>
<P>óÐÉÓÏË ËÏÍÍÅÒÞÅÓËÏÊ ÐÏÄÄÅÒÖËÉ ËÏÍÐÁÎÉÊ ÄÏÓÔÕÐÅÎ ÎÁ
- <A href="http://techdocs.postgresql.org/companies.php">
- http://techdocs.postgresql.org/companies.php</A>.</P>
+ <A href="http://www.postgresql.org/support/professional_support">
+ http://www.postgresql.org/support/professional_support</A>.</P>
<H3><A name="item1.8">1.8</A>) ëÁË ÍÎÅ ÓÏÏÂÝÉÔØ Ï ÏÛÉÂËÅ?</H3>
http://www.postgresql.org/support/submitbug</A>.
ôÁËÖÅ ÐÒÏ×ÅÒØÔÅ ÎÁÌÉÞÉÅ ÂÏÌÅÅ Ó×ÅÖÅÊ ×ÅÒÓÉÉ PostgreSQL ÎÁ ÎÁÛÅÍ
FTP ÓÁÊÔÅ <A href="ftp://ftp.postgresql.org/pub/">
- ftp://ftp.PostgreSQL.org/pub/</A>.</P>
+ ftp://ftp.postgresql.org/pub/</A>.</P>
<P>îÁ ÏÛÉÂËÉ, Õ×ÅÄÏÍÌÅÎÉÅ Ï ËÏÔÏÒÙÈ ÂÙÌÉ ÓÄÅÌÁÎÙ ÞÅÒÅÚ ÓÐÅÃÉÁÌØÎÕÀ
ÆÏÒÍÕ ÉÌÉ ÏÔÐÒÁ×ÌÅÎÎÙÅ × ËÁËÏÊ-ÌÉÂÏ ÓÐÉÓÏË ÒÁÓÓÙÌËÉ PostgreSQL,
ÓÔÒÁÎÉÃÙ ÜÌÅËÔÒÏÎÎÏÇÏ ÒÕËÏ×ÏÄÓÔ×Á man É ÎÅËÏÔÏÒÙÅ ÍÁÌÅÎØËÉÅ ÔÅÓÔÏ×ÙÅ
ÐÒÉÍÅÒÙ. óÍÏÔÒÉÔÅ × ËÁÔÁÌÏÇ <I>/doc</I>. ÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ÐÒÏÓÍÁÔÒÉ×ÁÔØ
ÄÏËÕÍÅÎÔÁÃÉÀ × éÎÔÅÒÎÅÔ ÐÏ ÁÄÒÅÓÕ <A href="http://www.postgresql.org/docs">
- http://www.PostgreSQL.org/docs</A>.</P>
+ http://www.postgresql.org/docs</A>.</P>
<P>óÕÝÅÓÔ×ÕÅÔ Ä×Å ËÎÉÇÉ ÐÏ PostgreSQL ÄÏÓÔÕÐÎÙÅ ÐÏ ÁÄÒÅÓÁÍ <A href=
"http://www.PostgreSQL.org/docs/books/awbook.html">http://www.PostgreSQL.org/docs/books/awbook.html</A>
åÓÔØ ÎÅÓËÏÌØËÏ ËÎÉÇ ÐÏ PostgreSQL, ËÏÔÏÒÙÅ ÍÏÖÎÏ ËÕÐÉÔØ.
ïÄÎÕ ÉÚ ÎÁÉÂÏÌÅÅ ÐÏÐÕÌÑÒÎÙÈ ÎÁÐÉÓÁÌ ëÏÒÒÉ äÕÇÌÁÓ (Korry Douglas).
óÐÉÓÏË ÏÂÚÏÒÏ× ÐÏ ÜÔÉÍ ËÎÉÇÁÍ ÄÏÓÔÕÐÅÎ ÐÏ ÁÄÒÅÓÕ
- <a href="http://techdocs.postgresql.org/techdocs/bookreviews.php">http://techdocs.postgresql.org/techdocs/bookreviews.php</a>.
- ëÒÏÍÅ ÔÏÇÏ, ÐÏ ÁÄÒÅÓÕ <a href="http://techdocs.postgresql.org">http://techdocs.PostgreSQL.org/</a>
- ×Ù ÍÏÖÅÔÅ ÎÁÊÔÉ ËÏÌÌÅËÃÉÀ ÔÅÈÎÉÞÅÓËÉÈ ÓÔÁÔÅÊ ÐÏÓ×ÑÝÅÎÎÙÈ PostgreSQL.</P>
+ <a href="http://www.postgresql.org/docs/books/">http://www.postgresql.org/docs/books/</a>.
+ ëÒÏÍÅ ÔÏÇÏ, ÐÏ ÁÄÒÅÓÕ <a href="http://www.postgresql.org/docs/techdocs">http://www.postgresql.org/docs/techdocs</a>
+ ×Ù ÍÏÖÅÔÅ ÎÁÊÔÉ ËÏÌÌÅËÃÉÀ ÔÅÈÎÉÞÅÓËÉÈ ÓÔÁÔÅÊ, ÐÏÓ×ÅÝÅÎÎÙÈ PostgreSQL.</P>
<P>ëÌÉÅÎÔ ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÉ <I>psql</I> ÉÍÅÅÔ ÎÅÓËÏÌØËÏ ËÏÍÁÎÄ \d ÄÌÑ
ÏÔÏÂÒÁÖÅÎÉÑ ÉÎÆÏÒÍÁÃÉÉ ÐÏ ÔÉÐÁÍ, ÏÐÅÒÁÔÏÒÁÍ, ÆÕÎËÃÉÑÍ, ÁÇÒÅÇÁÔÁÍ É Ô.Ä. -
<H3><A name="item1.11">1.11</A>) ëÁË ÍÎÅ ÎÁÕÞÉÔØÓÑ <SMALL>SQL</SMALL>?</H3>
<P>÷Ï-ÐÅÒ×ÙÈ, ×ÏÚØÍÉÔÅ ÏÄÎÕ ÉÚ ËÎÉÇ ÐÏ PostgreSQL, Ï ËÏÔÏÒÙÈ ÇÏ×ÏÒÉÌÏÓØ
- ×ÙÛÅ. åÝÅ ÏÄÉÎ ÕÞÅÂÎÉË - ÜÔÏ ËÎÉÇÁ "Teach Yourself SQL in 21 Days,
- Second Edition" (ïÓ×ÏÊ ÓÁÍÏÓÔÏÑÔÅÌØÎÏ SQL ÚÁ 21 ÄÅÎØ, ÷ÔÏÒÁÑ ÒÅÄÁËÃÉÑ)
- ÎÁ <A href="http://members.tripod.com/er4ebus/sql/index.htm">
- http://members.tripod.com/er4ebus/sql/index.htm</A>.
- íÎÏÇÉÍ ÉÚ ÎÁÛÉÈ ÐÏÌØÚÏ×ÁÔÅÌÅÊ ÎÒÁ×ÉÔÓÑ ËÎÉÇÁ
+ ×ÙÛÅ. íÎÏÇÉÍ ÉÚ ÎÁÛÉÈ ÐÏÌØÚÏ×ÁÔÅÌÅÊ ÔÁËÖÅ ÎÒÁ×ÉÔÓÑ ËÎÉÇÁ
<I>The Practical SQL Handbook</I>,
Bowman, Judith S., et al., Addison-Wesley. äÒÕÇÉÍ ÎÒÁ×ÉÔÓÑ <I>The
Complete Reference SQL</I>, Groff et al., McGraw-Hill.</P>
</DD>
</DL>
+ <H3><A name="item1.14">1.14</A>) âÕÄÅÔ ÌÉ PostgreSQL ÒÁÂÏÔÁÔØ Ó
+ ÐÏÓÌÅÄÎÉÍÉ ÉÚÍÅÎÅÎÉÑÍÉ, × ÒÁÚÎÙÈ ÓÔÒÁÎÙÈ, ËÁÓÁÀÝÉÍÉÓÑ ÄÎÅ×ÎÏÇÏ ×ÒÅÍÅÎÉ?</H3>
+ <P>éÚÍÅÎÅÎÉÑ × ÓÏÈÒÁÎÅÎÉÉ ÄÎÅ×ÎÏÇÏ ×ÒÅÍÅÎÉ × óûá ×ËÌÀÞÅÎÙ × PostgreSQL ×ÅÒÓÉÉ
+ 8.0.[4+] É ×Ï ×ÓÅ ÓÌÅÄÕÀÝÉÅ ×ÙÐÕÓËÉ, ÎÁÐÒÉÍÅÒ × 8.1. éÚÍÅÎÅÎÉÑ ÐÏ ëÁÎÁÄÅ
+ É úÁÐÁÄÎÏÊ á×ÓÔÒÁÌÉÉ ×ËÌÀÞÅÎÙ × 8.0.[10+], 8.1.[6+] É ×ÓÅ ÓÌÅÄÕÀÝÉÅ
+ ×ÙÐÕÓËÉ. ÷ÙÐÕÓËÉ PostgreSQL ÄÏ 8.0 ÉÓÐÏÌØÚÕÀÔ ÉÎÆÏÒÍÁÃÉÀ Ï ÓÏÈÒÁÎÅÎÉÉ
+ ÄÎÅ×ÎÏÇÏ ×ÒÅÍÅÎÉ ÉÚ ÂÁÚÙ ÄÁÎÎÙÈ ×ÒÅÍÅÎÎÙÈ ÚÏÎ × ÏÐÅÒÁÃÉÏÎÎÏÊ ÓÉÓÔÅÍÅ.</p>
<HR>
<H3 align="center">÷ÏÐÒÏÓÙ ÐÏÌØÚÏ×ÁÔÅÌÅÊ ÐÏ ËÌÉÅÎÔÓËÏÊ ÞÁÓÔÉ</H3>
<DD>îÅËÏÔÏÒÙÅ ÕÓÔÁÎÏ×ËÉ × <I>postgresql.conf</I> ×ÌÉÑÀÔ ÎÁ
ÐÒÏÉÚ×ÏÄÉÔÅÌØÎÏÓÔØ. ðÏÄÒÏÂÎÙÊ ÐÏÌÎÙÊ ÓÐÉÓÏË ÕÓÔÁÎÏ×ÏË ÓÍ. ×
- <A href="http://www.postgresql.org/docs/current/static/runtime.html">
+ <A href="http://www.postgresql.org/docs/current/static/runtime-config.html">
Administration Guide/Server Run-time Environment/Run-time Configuration</A>,
Á ËÏÍÍÅÎÔÁÒÉÉ ÓÍ. × <A href="http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html">
http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html</A>
<DT><B>÷ÙÂÏÒ "ÖÅÌÅÚÁ" - ÁÐÐÁÒÁÔÎÏÇÏ ÏÂÅÓÐÅÞÅÎÉÑ</B></DT>
<DD>÷ÌÉÑÎÉÅ "ÖÅÌÅÚÁ" ÎÁ ÐÒÏÉÚ×ÏÄÉÔÅÌØÎÏÓÔØ ÐÏÄÒÏÂÎÏ ÏÐÉÓÁÎÏ ×
- <A href="http://momjian.us/main/writings/pgsql/hw_performance/index.html">
- http://candle.pha.pa.us/main/writings/pgsql/hw_performance/index.html</A> É
<A href="http://www.powerpostgresql.com/PerfList/">
- http://www.powerpostgresql.com/PerfList/</A>.
- <BR><BR>
+ http://www.powerpostgresql.com/PerfList/</A> É
+ <A href="http://momjian.us/main/writings/pgsql/hw_performance/index.html">
+ http://momjian.us/main/writings/pgsql/hw_performance/index.html</A>.
+ <BR>
+ <BR>
</DD>
</DL>
<H3><A name="item3.5">3.5</A>) ðÏÞÅÍÕ Ñ ÐÏÌÕÞÁÀ ÓÏÏÂÝÅÎÉÅ <I>"Sorry, too
many clients"</I> ËÏÇÄÁ ÐÙÔÁÀÓØ ÐÏÄËÌÀÞÉÔØÓÑ Ë ÂÁÚÅ?</H3>
- <P>÷Ù ÄÏÓÔÉÇÌÉ ÕÓÔÁÎÏ×ÌÅÎÎÏÇÏ ÐÏ ÕÍÏÌÞÁÎÉÀ ÏÇÒÁÎÉÞÅÎÉÑ ÎÁ 100 ÓÅÓÓÉÊ
- ÐÏÄËÌÀÞÅÎÉÑ Ë ÂÁÚÅ ÄÁÎÎÙÈ. ÷ÁÍ ÎÅÏÂÈÏÄÉÍÏ Õ×ÅÌÉÞÉÔØ ÄÌÑ
- <I>postmaster</I> ÌÉÍÉÔ ÎÁ ËÏÌÉÞÅÓÔ×Ï ËÏÎËÕÒÅÎÔÎÙÈ backend ÐÒÏÃÅÓÓÏ×,
+ <P>÷Ù ÄÏÓÔÉÇÌÉ ÕÓÔÁÎÏ×ÌÅÎÎÏÇÏ ÐÏ ÕÍÏÌÞÁÎÉÀ ÏÇÒÁÎÉÞÅÎÉÑ × 100 ÓÅÓÓÉÊ
+ ÐÏÄËÌÀÞÅÎÉÑ Ë ÂÁÚÅ ÄÁÎÎÙÈ. ÷ÁÍ ÎÅÏÂÈÏÄÉÍÏ Õ×ÅÌÉÞÉÔØ ÌÉÍÉÔ ÎÁ ËÏÌÉÞÅÓÔ×Ï
+ ËÏÎËÕÒÅÎÔÎÙÈ backend ÐÒÏÃÅÓÓÏ× ÄÌÑ ×ÁÛÅÇÏ ÓÅÒ×ÅÒÁ âä,
ÉÚÍÅÎÉ× ÚÎÁÞÅÎÉÅ <I>max_connections</I> × ÆÁÊÌÅ <I>postgresql.conf</I>
- É ÐÅÒÅÓÔÁÒÔÏ×ÁÔØ <I>postmaster</I>.</P>
+ É ÐÅÒÅÓÔÁÒÔÏ×ÁÔØ ÓÅÒ×ÅÒ âä.</P>
<H3><A name="item3.6">3.6</A>) ëÁË ×ÙÐÏÌÎÉÔØ ÏÂÎÏ×ÌÅÎÉÅ PostgreSQL?</H3>
- <P>íÅÖÄÕ ÐÏÄ×ÙÐÕÓËÁÍÉ, ÒÁÚÒÁÂÏÔÞÉËÉ PostgreSQL ÄÅÌÁÀÔ ÔÏÌØËÏ ÉÓÐÒÁ×ÌÅÎÉÑ
- ÏÛÉÂÏË. ôÁËÉÍ ÏÂÒÁÚÏÍ ÏÂÎÏ×ÌÅÎÉÅ Ó ×ÅÒÓÉÉ 7.4.8 ÄÏ 7.4.9 ÎÅ ÔÒÅÂÕÅÔ
- ×ÙÐÏÌÎÅÎÉÑ dump É restore; ÄÏÓÔÁÔÏÞÎÏ ÏÓÔÁÎÏ×ÉÔØ ÓÅÒ×ÅÒ, ÕÓÔÁÎÏ×ÉÔØ
- ÏÂÎÏ×Ì£ÎÎÙÅ ÆÁÊÌÙ óõâä É ÚÁÐÕÓÔÉÔØ ÓÅÒ×ÅÒ.</P>
-
- <P>÷ÓÅ ÐÏÌØÚÏ×ÁÔÅÌÉ ÄÏÌÖÎÙ ÂÙ ÏÂÎÏ×ÌÑÔØÓÑ ÎÁ ÎÁÉÂÏÌÅÅ Ó×ÅÖÕÀ ÐÏÄ×ÅÒÓÉÀ
- ËÁË ÔÏÌØËÏ ÏÎÁ ÂÕÄÅÔ ÄÏÓÔÕÐÎÁ. ÷ ÔÏ ×ÒÅÍÑ ËÁË ËÁÖÄÏÅ ÏÂÎÏ×ÌÅÎÉÅ
- ÐÏÄÒÁÚÕÍÅ×ÁÅÔ ÎÅËÏÔÏÒÙÊ ÒÉÓË, ÐÏÄ×ÅÒÓÉÉ PostgreSQL ÒÁÚÒÁÂÙÔÙ×ÁÀÔÓÑ ÔÏÌØËÏ
- ÄÌÑ ÉÓÐÒÁ×ÌÅÎÉÑ ÏÂÝÉÈ ÏÛÉÂÏË Ó ÍÉÎÉÍÁÌØÎÙÍ ÒÉÓËÏÍ. ôÁËÉÍ ÏÂÒÁÚÏÍ, ×ÁÛ
- ÒÉÓË Ó×ÑÚÁÎ ÔÏÌØËÏ Ó ÓÁÍÉÍ ÏÂÎÏ×ÌÅÎÉÅÍ.</P>
-
-
- <P>ðÒÉ ×ÙÈÏÄÅ ÏÞÅÒÅÄÎÏÇÏ ×ÙÐÕÓËÁ
- (Ô.Å. ÐÒÉ ÏÂÎÏ×ÌÅÎÉÉ ÎÁÐÒÉÍÅÒ, Ó 7.3 ÎÁ 7.4) ÞÁÓÔÏ ÍÅÎÑÅÔÓÑ ×ÎÕÔÒÅÎÎÉÊ
- ÆÏÒÍÁÔ ÓÉÓÔÅÍÎÙÈ ÔÁÂÌÉÃ É ÆÁÊÌÏ× ÄÁÎÎÙÈ. üÔÉ ÉÚÍÅÎÅÎÉÑ ÞÁÓÔÏ ÎÏÓÑÔ
- ÓÌÏÖÎÙÊ ÈÁÒÁËÔÅÒ, ÔÁË ÞÔÏ ÍÙ ÎÅ ÏÂÓÌÕÖÉ×ÁÅÍ ÏÂÒÁÔÎÕÀ
- ÓÏ×ÍÅÓÔÉÍÏÓÔØ ÄÌÑ ÆÁÊÌÏ× ÄÁÎÎÙÈ. ÷ ÜÔÉÈ ÓÌÕÞÁÑÈ ÄÌÑ ÏÂÎÏ×ÌÅÎÉÑ ÂÁÚÙ
- ÄÁÎÎÙÈ ÔÒÅÂÕÅÔÓÑ ×ÙÐÏÌÎÉÔØ dump/restore.</P>
+ <P>óÍ. ÉÎÆÏÒÍÁÃÉÀ Ï ÏÂÎÏ×ÌÅÎÉÉ × <a
+ href="http://www.postgresql.org/support/versioning">http://www.postgresql.org/support/versioning</a>
+ É ÓÐÅÃÉÁÌØÎÙÅ ÉÎÓÔÒÕËÃÉÉ × <a href="http://www.postgresql.org/docs/current/static/install-upgrading.html">
+ http://www.postgresql.org/docs/current/static/install-upgrading.html</a>.</P>
<H3><A name="item3.7">3.7</A>) ëÁËÏÅ ËÏÍÐØÀÔÅÒÎÏÅ "ÖÅÌÅÚÏ" Ñ ÄÏÌÖÅÎ
ËÏÔÏÒÙÈ ÃÅÌÏÅ ÞÉÓÌÏ É ÔÅËÓÔÏ×ÏÅ ÏÐÉÓÁÎÉÅ. ðÒÉ ÜÔÏÍ ÄÌÉÎÁ ÔÅËÓÔÁ,
× ÓÒÅÄÎÅÍ, ÓÏÓÔÁ×ÌÑÅÔ 20 ÂÁÊÔ. òÁÚÍÅÒ ÐÒÏÓÔÏÇÏ ÆÁÊÌÁ ÓÏÓÔÁ×ÉÔ 2.8 MB.
òÁÚÍÅÒ ÂÁÚÙ PostgreSQL, ÓÏÄÅÒÖÁÝÅÊ ÜÔÉ ÖÅ ÄÁÎÎÙÅ ÓÏÓÔÁ×ÉÔ ÐÒÉÂÌÉÚÉÔÅÌØÎÏ
- 5.6 MB ÉÚ ËÏÔÏÒÙÈ:</P>
+ 5.2 MB ÉÚ ËÏÔÏÒÙÈ:</P>
<PRE>
- 28 ÂÁÊÔ: ÎÁ ËÁÖÄÙÊ ÚÁÇÏÌÏ×ÏË ÓÔÒÏËÉ × ÔÁÂÌÉÃÅ (ÐÒÉÂÌÉÚÉÔÅÌØÎÏ)
+ 24 ÂÁÊÔ: ÎÁ ËÁÖÄÙÊ ÚÁÇÏÌÏ×ÏË ÓÔÒÏËÉ × ÔÁÂÌÉÃÅ (ÐÒÉÂÌÉÚÉÔÅÌØÎÏ)
+ 24 ÂÁÊÔÁ: ÏÄÎÏ ÐÏÌÅ Ó ÃÅÌÏÞÉÓÌÅÎÎÙÍ ÔÉÐÏÍ É ÏÄÎÏ ÔÅËÓÔÏ×ÏÅ ÐÏÌÅ
+ 4 ÂÁÊÔÁ: ÕËÁÚÁÔÅÌØ ÎÁ ÓÔÒÁÎÉÃÅ ÄÌÑ ×ÓÅÊ ÔÁÂÌÉÞÎÏÊ ÓÔÒÏËÉ
----------------------------------------
òÁÚÍÅÒ ÓÔÒÁÎÉÃÙ ÄÁÎÎÙÈ × PostgreSQL ÓÏÓÔÁ×ÌÑÅÔ 8192 ÂÁÊÔ (8 KB), ÔÁË ÞÔÏ:
8192 ÂÁÊÔ ÎÁ ÓÔÒÁÎÉÃÕ
- --------------------- = 146 ÓÔÒÏË × ÔÁÂÌÉÃÅ ÎÁ ÓÔÒÁÎÉÃÕ âä (ÏËÒÕÇÌ£ÎÎÏ)
- 56 ÂÁÊÔ ÎÁ ÓÔÒÏËÕ × ÔÁÂÌÉÃÅ
+ --------------------- = 158 ÓÔÒÏË × ÔÁÂÌÉÃÅ ÎÁ ÓÔÒÁÎÉÃÕ âä (ÏËÒÕÇÌ£ÎÎÏ)
+ 52 ÂÁÊÔ ÎÁ ÓÔÒÏËÕ × ÔÁÂÌÉÃÅ
100000 ÓÔÒÏË ÄÁÎÎÙÈ
- ----------------------- = 685 ÓÔÒÁÎÉÃ × âä (ÏËÒÕÇÌ£ÎÎÏ)
- 146 ÓÔÒÏË × ÔÁÂÌÉÃÅ ÎÁ ÓÔÒÁÎÉÃÕ
+ ----------------------- = 633 ÓÔÒÁÎÉÃ × âä (ÏËÒÕÇÌ£ÎÎÏ)
+ 158 ÓÔÒÏË × ÔÁÂÌÉÃÅ ÎÁ ÓÔÒÁÎÉÃÕ
- 685 ÓÔÒÁÎÉÃ âä * 8192 ÂÁÊÔ ÎÁ ÓÔÒÁÎÉÃÕ = 5,611,520 ÂÁÊÔ (5.6 MB)
+ 633 ÓÔÒÁÎÉÃ âä * 8192 ÂÁÊÔ ÎÁ ÓÔÒÁÎÉÃÕ = 5,185,536 ÂÁÊÔ (5.2 MB)
</PRE>
<P>éÎÄÅËÓÙ ÎÅ ÔÒÅÂÕÀÔ ÔÁË ÍÎÏÇÏ, ÎÏ ÐÏÓËÏÌØËÕ ÏÎÉ ÓÏÚÄÁÀÔÓÑ ÄÌÑ
<i>C</i>, ÐÏÔÏÍÕ ÞÔÏ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ ×ÏÚÍÏÖÎÏÓÔÉ ÕÚÎÁÔØ ÓÌÅÄÕÀÝÉÊ ÎÁÉÂÏÌØÛÉÊ
ÓÉÍ×ÏÌ ÄÌÑ ÎÅ-C ÌÏËÁÌÉ. ÷Ù ÍÏÖÅÔÅ ÄÌÑ ÔÁËÉÈ ÓÌÕÞÁÅ× ÓÏÚÄÁÔØ ÓÐÅÃÉÁÌØÎÙÊ
ÉÎÄÅËÓ <CODE>text_pattern_ops</CODE> ËÏÔÏÒÙÊ ÒÁÂÏÔÁÅÔ ÔÏÌØËÏ ÄÌÑ
- <SMALL>LIKE</SMALL> ÉÎÄÅËÓÉÒÏ×ÁÎÉÑ.</LI>
+ <SMALL>LIKE</SMALL> ÉÎÄÅËÓÉÒÏ×ÁÎÉÑ. äÌÑ ÐÏÉÓËÁ ÓÌÏ× ÔÁËÖÅ ÍÏÖÎÏ
+ ÉÓÐÏÌØÚÏ×ÁÔØ ÐÏÌÎÏÔÅËÓÔÏ×ÙÊ ÉÎÄÅËÓ.</LI>
</UL>
- <P>÷ ×ÙÐÕÓËÁÈ ÄÏ ×ÅÒÓÉÉ 8.0, ÉÎÄÅËÓÙ ÞÁÓÔÏ ÎÅÌØÚÑ ÂÙÌÏ ÉÓÐÏÌØÚÏ×ÁÔØ,
- ÅÓÌÉ ÔÉÐÙ ÄÁÎÎÙÈ ÔÏÞÎÏ ÎÅ ÓÏ×ÐÁÄÁÌÉ Ó ÉÎÄÅËÓÎÙÍÉ ÔÉÐÁÍÉ ËÏÌÏÎÏË. üÔÏ
- ÏÓÏÂÅÎÎÏ ËÁÓÁÌÏÓØ int2, int8 É numeric ÉÎÄÅËÓÏ× ËÏÌÏÎÏË.</P>
-
<H3><A name="item4.7">4.7</A>) ëÁË ÐÏÓÍÏÔÒÅÔØ ÎÁ ÔÏ, ËÁË ÏÐÔÉÍÉÚÁÔÏÒ ×ÙÐÏÌÎÑÅÔ
ÍÏÊ ÚÁÐÒÏÓ?</H3>
ÔÏÌØËÏ × ÏÐÒÅÄÅÌ£ÎÎÏÍ ÒÅÇÉÓÔÒÅ, ÉÓÐÏÌØÚÕÊÔÅ ÏÇÒÁÎÉÞÅÎÉÅ
<SMALL>CHECK</SMALL> ÉÌÉ ÐÒÏ×ÅÒËÕ ÞÅÒÅÚ ÔÒÉÇÇÅÒ.</P>
- <H3><A name="item4.9">4.9</A>) ëÁË ÍÎÅ ÏÐÒÅÄÅÌÉÔØ, ÞÔÏ ÚÎÁÞÅÎÉÅ ÐÏÌÑ ÒÁ×ÎÏ
- <SMALL>NULL</SMALL> × ËÁËÏÍ-ÌÉÂÏ ÚÁÐÒÏÓÅ? íÏÇÕ Ñ ÏÔÓÏÒÔÉÒÏ×ÁÔØ ÐÏÌÑ
- <SMALL>NULL</SMALL> ÉÌÉ ÎÅÔ?</H3>
+ <H3><A name="item4.9">4.9</A>) ëÁË ÍÎÅ ÏÐÒÅÄÅÌÉÔØ, ÞÔÏ ÚÎÁÞÅÎÉÅ ÐÏÌÑ × ËÁËÏÍ-ÌÉÂÏ
+ ÚÁÐÒÏÓÅ ÒÁ×ÎÏ <SMALL>NULL</SMALL>? ëÁË ÍÎÅ ÓÏÅÄÉÎÉÔØ ×ÏÚÍÏÖÎÙÅ
+ <SMALL>NULL</SMALL>? íÏÇÕ Ñ ÓÏÒÔÉÒÏ×ÁÔØ ÐÏÌÑ <SMALL>NULL</SMALL> ÉÌÉ ÎÅÔ?</H3>
<P>÷Ù ÐÒÏÓÔÏ ÓÒÁ×ÎÉ×ÁÅÔÅ ÚÎÁÞÅÎÉÅ Ó <SMALL>IS NULL</SMALL> É
<SMALL>IS NOT NULL</SMALL>, ËÁË ÚÄÅÓØ:</P>
WHERE col IS NULL;
</PRE>
+ <P>þÔÏÂÙ ÓÏÅÄÉÎÉÔØ Ó ×ÏÚÍÏÖÎÙÍÉ ÚÎÁÞÅÎÉÑÍÉ <SMALL>NULL</SMALL>, ÉÓÐÏÌØÚÕÊÔÅ
+ <I>COALESCE()</I> ËÁË ÚÄÅÓØ:</P>
+<PRE>
+ SELECT COALESCE(col1, '') || COALESCE(col2, '')
+ FROM tab
+</PRE>
+
<P>þÔÏÂÙ ÏÔÓÏÒÔÉÒÏ×ÁÔØ ÄÁÎÎÙÅ ÐÏ ÚÎÁÞÅÎÉÀ <NULL> ÉÓÐÏÌØÚÕÊÔÅ ÍÏÄÉÆÉËÁÔÏÒÙ
<SMALL>IS NULL</SMALL> É <SMALL>IS NOT NULL</SMALL> × ×ÙÒÁÖÅÎÉÉ
<SMALL>ORDER BY</SMALL>. ëÏÇÄÁ ÏÎÉ ÂÕÄÕÔ ÇÅÎÅÒÉÒÏ×ÁÔØ ÚÎÁÞÅÎÉÑ
);
</PRE>
+ <P>á×ÔÏÍÁÔÉÞÅÓËÉ ÓÏÚÄÁÎÎÁÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ ÉÍÅÅÔ ÉÍÑ ×ÉÄÁ
+ <<I>ÔÁÂÌÉÃÁ</I>>_<<I>ËÏÌÏÎËÁ_serial</I>>_<I>seq</I>, ÇÄÅ
+ <I>ÔÁÂÌÉÃÁ</I> É <I>ËÏÌÏÎËÁ_serial</I> - ÜÔÏ ÓÏÏÔ×ÅÔÓÔ×ÅÎÎÏ ÉÍÅÎÁ
+ ÔÁÂÌÉÃÙ É ËÏÌÏÎËÉ Ó ÔÉÐÏÍ <SMALL>SERIAL</SMALL>.
óÍÏÔÒÉÔÅ ÐÏÄÒÏÂÎÏÓÔÉ Ï ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÑÈ ÎÁ ÓÔÒÁÎÉÃÅ ÒÕËÏ×ÏÄÓÔ×Á
- ÐÏÓ×ÑÝÅÎÎÏÊ <I>create_sequence</I>.
+ ÐÏÓ×ÑÝÅÎÎÏÊ <I>create_sequence</I>.</P>
<H3><A name="item4.11.2">4.11.2</A>) ëÁË ÍÎÅ ÐÏÌÕÞÉÔØ ÚÎÁÞÅÎÉÅ ÐÒÉ ×ÓÔÁ×ËÅ
<SMALL>SERIAL</SMALL>?</H3>
- <P>ïÄÉÎ ÉÚ ÓÐÏÓÏÂÏ× ÓÏÓÔÏÉÔ × ÐÏÌÕÞÅÎÉÉ ÓÌÅÄÕÀÝÅÇÏ ÚÎÁÞÅÎÉÑ
- <SMALL>SERIAL</SMALL> ÉÚ ÏÂßÅËÔÁ sequence Ó ÐÏÍÏÝØÀ ÆÕÎËÃÉÉ
- <I>nextval()</I> <I>ÐÅÒÅÄ</I> ×ÓÔÁ×ËÏÊ É ÚÁÔÅÍ ×ÓÔÁ×ÌÑÔØ ÜÔÏ ÚÎÁÞÅÎÉÅ
- Ñ×ÎÏ. éÓÐÏÌØÚÕÊÔÅ ÔÁÂÌÉÃÕ-ÐÒÉÍÅÒ × <A href="#item4.11.1">4.11.1</A>, ÐÒÉÍÅÒ
- × ÐÓÅ×ÄÏÑÚÙËÅ ÐÏËÁÖÅÔ ËÁË ÜÔÏ ÄÅÌÁÅÔÓÑ:</P>
-<PRE>
- new_id = execute("SELECT nextval('person_id_seq')");
- execute("INSERT INTO person (id, name) VALUES (new_id, 'Blaise Pascal')");
-</PRE>
+ <P>ðÒÏÓÔÅÊÛÉÊ ÓÐÏÓÏÂ ÐÏÌÕÞÉÔØ ÎÁÚÎÁÞÅÎÎÏÅ ÚÎÁÞÅÎÉÅ <SMALL>SERIAL</SMALL>
+ ÜÔÏ ÉÓÐÏÌØÚÏ×ÁÔØ <SMALL>RETURNING</SMALL>. éÓÐÏÌØÚÕÑ ÄÌÑ ÐÒÉÍÅÒÁ ÔÁÂÌÉÃÕ × <A
+ href="#item4.11.1">4.11.1</A>, ÜÔÏ ÍÏÖÅÔ ×ÙÇÌÑÄÅÔØ ÔÁË:</P>
- úÁÔÅÍ ×Ù ÄÏÌÖÎÙ ÔÁËÖÅ ÓÏÈÒÁÎÉÔØ ÎÏ×ÏÅ ÚÎÁÞÅÎÉÅ × ÐÅÒÅÍÅÎÎÏÊ
- <CODE>new_id</CODE> ÄÌÑ ÅÇÏ ÉÓÐÏÌØÚÏ×ÁÎÉÑ × ÄÒÕÇÉÈ ÚÁÐÒÏÓÁÈ (ÎÁÐÒÉÍÅÒ
- ÔÁËÉÈ ËÁË ×ÎÅÛÎÉÊ ËÌÀÞ ÄÌÑ ÔÁÂÌÉÃÙ <CODE>person</CODE>). úÁÍÅÔÉÍ,
- ÞÔÏ ÉÍÑ Á×ÔÏÍÁÔÉÞÅÓËÉ ÓÏÚÄÁÎÎÏÇÏ ÏÂßÅËÔÁ <SMALL>SEQUENCE</SMALL>
- ÂÕÄÅÔ <<I>table</I>>_<<I>serialcolumn</I>>_<I>seq</I>,
- ÇÄÅ <I>table</I> É <I>serialcolumn</I> Ñ×ÌÑÀÔÓÑ ÓÏÏÔ×ÅÔÓÔ×ÅÎÎÏ
- ÉÍÅÎÁÍÉ ×ÁÛÅÊ ÔÁÂÌÉÃÙ É ×ÁÛÅÊ ËÏÌÏÎËÉ <SMALL>SERIAL</SMALL>.
-
- <P>÷ ËÁÞÅÓÔ×Å ÁÌØÔÅÒÎÁÔÉ×Ù, ×Ù ÍÏÖÅÔÅ ÐÏÌÕÞÉÔØ ÎÁÚÎÁÞÅÎÎÏÅ ÚÎÁÞÅÎÉÅ
- <SMALL>SERIAL</SMALL> Ó ÐÏÍÏÝØÀ ÆÕÎËÃÉÉ <I>currval()</I>
- <I>ÐÏÓÌÅ</I> ÐÒÏ×ÅÄÅÎÉÑ ÏÂÙÞÎÏÊ ÏÐÅÒÁÃÉÉ ×ÓÔÁ×ËÉ, ÎÁÐÒÉÍÅÒ</P>
<PRE>
- execute("INSERT INTO person (name) VALUES ('Blaise Pascal')");
- new_id = execute("SELECT currval('person_id_seq')");
+ INSERT INTO person (name) VALUES ('Blaise Pascal') RETURNING id;
</PRE>
+ ÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ×ÙÚ×ÁÔØ <I>nextval()</I> É ÉÓÐÏÌØÚÏ×ÁÔØ ÜÔÏ ÚÎÁÞÅÎÉÅ ×
+ <SMALL>INSERT</SMALL> ÉÌÉ ×ÙÚ×ÁÔØ <I>currval()</I> <I>ÐÏÓÌÅ</I>
+ <SMALL>INSERT</SMALL>.
+
<H3><A name="item4.11.3">4.11.3</A>) îÅ ÍÏÖÅÔ ÌÉ ÐÏÌÕÞÉÔØÓÑ ÔÁË, ÞÔÏ
ÉÓÐÏÌØÚÏ×ÁÎÉÅ <I>currval()</I> É <I>nextval()</I> ÐÒÉ×ÅÄÅÔ Ë
<H3><A name="item4.12">4.12</A>) þÔÏ ÔÁËÏÅ <SMALL>OID</SMALL>? þÔÏ ÔÁËÏÅ
<SMALL>CTID</SMALL>?</H3>
- <P>ëÁÖÄÁÑ, ÓÏÚÄÁ×ÁÅÍÁÑ × PostgreSQL ÔÁÂÌÉÞÎÁÑ ÓÔÒÏËÁ, ÐÏÌÕÞÁÅÔ ÕÎÉËÁÌØÎÙÊ
- ÉÎÄÅÎÔÉÆÉËÁÔÏÒ <SMALL>OID</SMALL> ÚÁ ÉÓËÌÀÞÅÎÉÅÍ ÓÌÕÞÁÑ ËÏÇÄÁ
- ÉÓÐÏÌØÚÏ×ÁÌÏÓØ <SMALL>WITHOUT OIDS</SMALL>. O<SMALL>ID</SMALL> - ÜÔÏ
- Á×ÔÏÍÁÔÉÞÅÓËÉ ÎÁÚÎÁÞÁÅÍÏÅ ÕÎÉËÁÌØÎÏÅ 4-È ÂÁÊÔÏ×ÏÅ ÃÅÌÏÅ ÞÉÓÌÏ.
+ <P>åÓÌÉ ÔÁÂÌÉÃÁ ÓÏÚÄÁÎÁ Ó <SMALL>WITH OIDS</SMALL>, ÔÏ ËÁÖÄÁÑ ÓÔÒÏËÁ
+ ÐÏÌÕÞÁÅÔ ÕÎÉËÁÌØÎÙÊ ÉÎÄÅÎÔÉÆÉËÁÔÏÒ <SMALL>OID</SMALL>.
+ O<SMALL>ID</SMALL> - ÜÔÏ Á×ÔÏÍÁÔÉÞÅÓËÉ ÎÁÚÎÁÞÁÅÍÏÅ ÕÎÉËÁÌØÎÏÅ 4-È
+ ÂÁÊÔÏ×ÏÅ ÃÅÌÏÅ ÞÉÓÌÏ, ËÏÔÏÒÏÅ ÕÎÉËÁÌØÎÏ ÄÌÑ ×ÓÅÊ ÕÓÔÁÎÏ×ÌÅÎÎÏÊ óõâä.
ïÄÎÁËÏ, ÐÏÓÌÅ ÔÏÇÏ ËÁË ÅÇÏ ÚÎÁÞÅÎÉÅ ÐÒÅ×ÙÓÉÔ 4 ÍÉÌÌÉÁÒÄÁ, ÚÎÁÞÅÎÉÑ
O<SMALL>ID</SMALL> ÎÁÞÉÎÁÀÔ ÄÕÂÌÉÒÏ×ÁÔØÓÑ. PostgreSQL ÉÓÐÏÌØÚÕÅÔ
<SMALL>OID</SMALL> ÄÌÑ Ó×ÑÚÙ×ÁÎÉÑ Ó×ÏÉÈ ×ÎÕÔÒÅÎÎÉÈ ÔÁÂÌÉÃ.</P>
- <P>äÌÑ ÕÎÉËÁÌØÎÙÈ ÚÎÁÞÅÎÉÊ × ËÏÌÏÎËÁÈ ÔÁÂÌÉÃÙ ÐÏÌØÚÏ×ÁÔÅÌÑ, ÌÕÞÛÉÍ
+ <P>äÌÑ ÕÎÉËÁÌØÎÏÇÏ ÚÎÁÞÅÎÉÑ × ÓÔÒÏËÁÈ ÔÁÂÌÉÃÙ ÐÏÌØÚÏ×ÁÔÅÌÑ, ÌÕÞÛÉÍ
ÓÐÏÓÏÂÏÍ Ñ×ÌÑÅÔÓÑ ÉÓÐÏÌØÚÏ×ÁÎÉÅ <SMALL>SERIAL</SMALL> ×ÍÅÓÔÏ
O<SMALL>ID</SMALL>, ÐÏÔÏÍÕ ÞÔÏ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ <SMALL>SERIAL</SMALL>
ÕÎÉËÁÌØÎÙ ÔÏÌØËÏ ×ÎÕÔÒÉ ÔÁÂÌÉÃÙ É ÔÁËÉÍ ÏÂÒÁÚÏÍ ÍÅÎØÛÅ ÐÏÄ×ÅÒÖÅÎÙ
<P>ðÒÅÄÐÏÌÏÖÉÔÅÌØÎÏ Õ ×ÁÓ ÚÁËÏÎÞÉÌÁÓØ ×ÉÒÔÕÁÌØÎÁÑ ÐÁÍÑÔØ
ÉÌÉ ÞÔÏ ×ÁÛÅ ÑÄÒÏ ÉÍÅÅÔ ÍÁÌÅÎØËÉÊ ÌÉÍÉÔ ÎÁ ÏÐÒÅÄÅÌÅÎÎÙÅ ÒÅÓÕÒÓÙ.
- ðÏÐÙÔÁÊÔÅÓØ ÐÅÒÅÄ ÚÁÐÕÓËÏÍ <I>postmaster</I> ×ÙÐÏÌÎÉÔØ ÓÌÅÄÕÀÝÉÅ
+ ðÏÐÙÔÁÊÔÅÓØ ÐÅÒÅÄ ÚÁÐÕÓËÏÍ ÓÅÒ×ÅÒÁ âä ×ÙÐÏÌÎÉÔØ ÓÌÅÄÕÀÝÉÅ
ËÏÍÁÎÄÙ:</P>
<PRE>
ulimit -d 262144
<H3><A name="item4.18">4.18</A>) ëÁË ÍÎÅ ×ÅÒÎÕÔØ ÉÚ ÆÕÎËÃÉÉ ÎÅÓËÏÌØËÏ ÓÔÒÏË ÔÁÂÌÉÃÙ?</H3>
<P>÷Ù ÍÏÖÅÔÅ ÌÅÇËÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÆÕÎËÃÉÉ, ×ÏÚ×ÒÁÝÁÀÝÉÅ ÓÐÉÓÏË,
- <A href="http://techdocs.postgresql.org/guides/SetReturningFunctions">
- http://techdocs.postgresql.org/guides/SetReturningFunctions</A>.</P>
+ <A href="http://www.postgresql.org/docs/techdocs.17">
+ http://www.postgresql.org/docs/techdocs.17</A>.</P>
<H3><A name="item4.19">4.19</A>) ðÏÞÅÍÕ Ñ ÐÏÌÕÞÁÀ ÏÛÉÂËÕ "relation with OID ####
ÎÅ ÓÕÝÅÓÔ×ÕÅÔ", ËÏÇÄÁ ÏÂÒÁÝÁÀÔÓØ Ë ×ÒÅÍÅÎÎÙÍ ÔÁÂÌÉÃÁÍ × ÆÕÎËÃÉÑÈ PL/PgSQL?</H3>
- <P>PL/PgSQL ËÜÛÉÒÕÅÔ ÓÃÅÎÁÒÉÉ ÆÕÎËÃÉÉ É ÏÄÉÎ ÉÚ ÎÅÇÁÔÉ×ÎÙÈ ÜÆÆÅËÔÏ× ÜÔÏÇÏ
- ÓÏÓÔÏÉÔ × ÔÏÍ, ÞÔÏ ÅÓÌÉ ÆÕÎËÃÉÑ PL/PgSQL ÏÂÒÁÝÁÅÔÓÑ Ë ×ÒÅÍÅÎÎÏÊ ÔÁÂÌÉÃÅ
- É ÜÔÁ ÔÁÂÌÉÃÁ ÐÏÚÄÎÅÅ ÕÄÁÌÑÅÔÓÑ É ÐÅÒÅÓÏÚÄÁÅÔÓÑ, Á ÆÕÎËÃÉÑ ÚÁÔÅÍ ×ÙÚÙ×ÁÅÔÓÑ
- ÓÎÏ×Á, ÔÏ ÅÅ ×ÙÚÏ× ÐÒÉ×ÅÄÅÔ Ë ÏÛÉÂËÅ, ÐÏÔÏÍÕ ÞÔÏ ÓËÜÛÉÒÏ×ÁÎÎÏÅ ÓÏÄÅÒÖÉÍÏÅ
- ÆÕÎËÃÉÉ ÓÏÄÅÒÖÉÔ ÕËÁÚÁÔÅÌØ ÎÁ ÓÔÁÒÕÀ ×ÒÅÍÅÎÎÕÀ ÔÁÂÌÉÃÕ. þÔÏÂÙ ÒÅÛÉÔØ ÜÔÕ
- ÐÒÏÂÌÅÍÕ, ÉÓÐÏÌØÚÕÊÔÅ <SMALL>EXECUTE</SMALL> ÄÌÑ ÄÏÓÔÕÐÁ Ë ×ÒÅÍÅÎÎÙÍ
+ <P>÷ PostgreSQL ÄÏ ×ÅÒÓÉÉ 8.3, PL/PgSQL ËÜÛÉÒÕÅÔ ÓÃÅÎÁÒÉÉ ÆÕÎËÃÉÉ É ÏÄÉÎ ÉÚ
+ ÎÅÇÁÔÉ×ÎÙÈ ÜÆÆÅËÔÏ× ÜÔÏÇÏ ÓÏÓÔÏÉÔ × ÔÏÍ, ÞÔÏ ÅÓÌÉ ÆÕÎËÃÉÑ PL/PgSQL ÏÂÒÁÝÁÅÔÓÑ
+ Ë ×ÒÅÍÅÎÎÏÊ ÔÁÂÌÉÃÅ É ÜÔÁ ÔÁÂÌÉÃÁ ÐÏÚÄÎÅÅ ÕÄÁÌÑÅÔÓÑ É ÐÅÒÅÓÏÚÄÁÅÔÓÑ, Á ÆÕÎËÃÉÑ
+ ÚÁÔÅÍ ×ÙÚÙ×ÁÅÔÓÑ ÓÎÏ×Á, ÔÏ ÅÅ ×ÙÚÏ× ÐÒÉ×ÅÄÅÔ Ë ÏÛÉÂËÅ, ÐÏÔÏÍÕ ÞÔÏ ÓËÜÛÉÒÏ×ÁÎÎÏÅ
+ ÓÏÄÅÒÖÉÍÏÅ ÆÕÎËÃÉÉ ÓÏÄÅÒÖÉÔ ÕËÁÚÁÔÅÌØ ÎÁ ÓÔÁÒÕÀ ×ÒÅÍÅÎÎÕÀ ÔÁÂÌÉÃÕ. þÔÏÂÙ ÒÅÛÉÔØ
+ ÜÔÕ ÐÒÏÂÌÅÍÕ, ÉÓÐÏÌØÚÕÊÔÅ <SMALL>EXECUTE</SMALL> ÄÌÑ ÄÏÓÔÕÐÁ Ë ×ÒÅÍÅÎÎÙÍ
ÔÁÂÌÉÃÁÍ × PL/PgSQL. éÓÐÏÌØÚÏ×ÁÎÉÅ ÜÔÏÇÏ ÏÐÅÒÁÔÏÒÁ ÚÁÓÔÁ×ÉÔ ÚÁÐÒÏÓ
ÐÅÒÅÇÅÎÅÒÉÒÏ×ÁÔØÓÑ ËÁÖÄÙÊ ÒÁÚ.</P>
+ <P>÷ PostgreSQL 8.3 É ÐÏÚÄÎÅÅ, ÜÔÏÊ ÐÒÏÂÌÅÍÙ ÎÅÔ.</p>
+
<H3><A name="item4.20">4.20</a>) ëÁËÉÅ ÅÓÔØ ÒÅÛÅÎÉÑ ÄÌÑ ÒÅÐÌÉËÁÃÉÉ?</H3>
(slave) ÓÅÒ×ÅÒÁ ÍÏÇÕÔ ÐÒÏÉÚ×ÏÄÉÔØ ÔÏÌØËÏ ÚÁÐÒÏÓÙ
ÞÔÅÎÉÑ/<SMALL>SELECT</SMALL>. îÁÉÂÏÌÅÅ ÐÏÐÕÌÑÒÎÙÍ ÒÅÛÅÎÉÅÍ ÄÌÑ ÒÅÐÌÉËÁÃÉÉ
master-slave × PostgreSQL Ñ×ÌÑÅÔÓÑ
- <A href="http://gborg.postgresql.org/project/slony1/projdisplay.php">
+ <A href="http://main.slony.info/">
Slony-I</A>.</P>
<P>òÅÐÌÉËÁÃÉÑ Multi-master ÐÏÚ×ÏÌÑÅÔ ×ÙÐÏÌÎÑÔØ ÚÁÐÒÏÓÙ ÞÔÅÎÉÑ/ÚÁÐÉÓÉ
ÔÁËÖÅ ÐÒÉ×ÏÄÉÔ Ë ÐÏÔÅÒÅ ÐÒÏÉÚ×ÏÄÉÔÅÌØÎÏÓÔÉ, ÐÏÔÏÍÕ ÞÔÏ ÎÅÏÂÈÏÄÉÍÁ
ÓÉÎÈÒÏÎÉÚÁÃÉÑ ÉÚÍÅÎÅÎÉÊ ÍÅÖÄÕ ÎÅÓËÏÌØËÉÍÉ ÓÅÒ×ÅÒÁÍÉ. îÁÉÂÏÌÅÅ
ÐÏÐÕÌÑÒÎÙÍ ÒÅÛÅÎÉÅÍ ÄÌÑ ÔÁËÏÊ ÒÅÐÌÉËÁÃÉÉ × PostgreSQL Ñ×ÌÑÅÔÓÑ
- <A href="http://pgfoundry.org/projects/pgcluster/">Pgcluster</A>.
+ <A href="http://pgfoundry.org/projects/pgcluster/">PGcluster</A>.
<H3><A name="item4.21">4.21</A>) ðÏÞÅÍÕ ÉÍÅÎÁ ÔÁÂÌÉÃÙ É ËÏÌÏÎÏË ÎÅ
- ÒÁÓÐÏÚÎÁÀÔÓÑ × × ÍÏ£Í ÚÁÐÒÏÓÅ?</H3>
+ ÒÁÓÐÏÚÎÁÀÔÓÑ × × ÍÏ£Í ÚÁÐÒÏÓÅ? ðÏÞÅÍÕ ÎÅ ÓÏÈÒÁÎÑÀÔÓÑ ÚÁÇÌÁ×ÎÙÅ ÂÕË×Ù?</H3>
- <P>îÁÉÂÏÌÅÅ ÞÁÓÔÏ ÜÔÏ ÐÒÏÉÓÈÏÄÉÔ ÉÚ-ÚÁ ÉÓÐÏÌØÚÏ×ÁÎÉÑ Ä×ÏÊÎÙÈ ËÁ×ÙÞÅË ×
+ <P>îÁÉÂÏÌÅÅ ÞÁÓÔÏ ÉÍÅÎÁ ÎÅÒÁÓÐÏÚÎÁÀÔÓÑ ÉÚ-ÚÁ ÉÓÐÏÌØÚÏ×ÁÎÉÑ Ä×ÏÊÎÙÈ ËÁ×ÙÞÅË ×
ÉÍÅÎÉ ÔÁÂÌÉÃÙ ÉÌÉ ËÏÌÏÎËÉ ÐÒÉ ÓÏÚÄÁÎÉÉ ÔÁÂÌÉÃÙ. ðÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ Ä×ÏÊÎÙÈ
ËÁ×ÙÞÅË, ÉÍÑ ÔÁÂÌÉÃÙ É ËÏÌÏÎËÉ (ËÏÔÏÒÙÅ ÎÁÚÙ×ÁÀÔ ÉÄÅÎÔÉÆÉËÁÔÏÒÁÍÉ)
- ÓÏÈÒÁÎÑÀÔÓÑ × <A href="http://www.postgresql.org/docs/8.0/static/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS">
+ ÓÏÈÒÁÎÑÀÔÓÑ × <A href="http://www.postgresql.org/docs/current/static/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS">
ÒÅÇÉÓÔÒÏ-ÚÁ×ÉÓÉÍÏÍ ×ÉÄÅ</A>; ÜÔÏ ÏÚÎÁÞÁÅÔ, ÞÔÏ ×Ù ÄÏÌÖÎÙ ÉÓÐÏÌØÚÏ×ÁÔØ
Ä×ÏÊÎÙÅ ËÁ×ÙÞËÉ, ËÏÇÄÁ ÕËÁÚÙ×ÁÅÔÅ ÜÔÉ ÉÍÅÎÁ × ÚÁÐÒÏÓÅ. îÅËÏÔÏÒÙÅ
ÉÎÔÅÒÆÅÊÓÙ, ÔÁËÉÅ ËÁË pgAdmin, ×Ï ×ÒÅÍÑ ÓÏÚÄÁÎÉÑ ÔÁÂÌÉÃÙ ÄÏÂÁ×ÌÑÀÔ