Commit 1bdec342 authored by Bruce Momjian's avatar Bruce Momjian

Update Russian FAQ.

Viktor Vislobokov
parent 97e455c9
Otvety na chasto zadavaemye voprosy po PostgreSQL Otvety na chasto zadavaemye voprosy po PostgreSQL
Data poslednego obnovleniya: Ponedel'nik 14 fevralya 23:35:09 EST 2005 Data poslednego obnovleniya: Ponedel'nik 30 maya 09:11:03 EDT 2005
Anglijskij variant soprovozhdaet: Bryus Mom'yan (Bruce Momjian) Anglijskij variant soprovozhdaet: Bryus Mom'yan (Bruce Momjian)
(pgman@candle.pha.pa.us) (pgman@candle.pha.pa.us)
Perevel na russkij: Viktor Vislobokov (corochoone@perm.ru) Pereviol na russkij: Viktor Vislobokov (corochoone@perm.ru)
Samuyu svezhuyu anglijskuyu versiyu dokumenta mozhno najti na Samuyu svezhuyu anglijskuyu versiyu dokumenta mozhno najti na
http://www.PostgreSQL.org/files/documentation/faqs/FAQ.html. http://www.PostgreSQL.org/files/documentation/faqs/FAQ.html.
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
1.10) Kak nauchit'sya SQL? 1.10) Kak nauchit'sya SQL?
1.11) Kak prisoedinitsya k komande razrabotchikov? 1.11) Kak prisoedinitsya k komande razrabotchikov?
1.12) Kak sravnivat' PostgreSQL s drugimi SUBD? 1.12) Kak sravnivat' PostgreSQL s drugimi SUBD?
1.13) Kto upravlyaet PostgreSQL?
Voprosy pol'zovatelej po klientskoj chasti Voprosy pol'zovatelej po klientskoj chasti
...@@ -70,8 +71,8 @@ ...@@ -70,8 +71,8 @@
4.8) Kak mne vypolnit' poisk regulyarnogo vyrazheniya i poisk 4.8) Kak mne vypolnit' poisk regulyarnogo vyrazheniya i poisk
nezavisimyj ot registra bukv poisk regulyarnogo vyrazheniya? Kak mne nezavisimyj ot registra bukv poisk regulyarnogo vyrazheniya? Kak mne
ispol'zovat' indeks dlya poiska nezavisimogo ot registra bukv? ispol'zovat' indeks dlya poiska nezavisimogo ot registra bukv?
4.9) Kak ya mogu opredelit', chto znachenie polya ravno NULL v 4.9) Kak mne opredelit', chto znachenie polya ravno NULL v kakom-libo
kakom-libo zaprose? zaprose? Mogu ya otsortirovat' polya NULL ili net?
4.10) Kakovy otlichiya mezhdu raznymi simvol'nymi tipami? 4.10) Kakovy otlichiya mezhdu raznymi simvol'nymi tipami?
4.11.1) Kak mne sozdat' pole serial/s-avto-uvelicheniem? 4.11.1) Kak mne sozdat' pole serial/s-avto-uvelicheniem?
4.11.2) Kak mne poluchit' znachenie pri vstavke SERIAL? 4.11.2) Kak mne poluchit' znachenie pri vstavke SERIAL?
...@@ -80,36 +81,25 @@ ...@@ -80,36 +81,25 @@
4.11.4) Pochemu chisla iz moej posledovatel'nosti ne ispol'zuyutsya 4.11.4) Pochemu chisla iz moej posledovatel'nosti ne ispol'zuyutsya
snova pri otmene tranzakcii? Pochemu sozdayutsya razryvy pri numeracii snova pri otmene tranzakcii? Pochemu sozdayutsya razryvy pri numeracii
v kolonke, gde ya ispol'zuyu posledovatel'nost'/SERIAL? v kolonke, gde ya ispol'zuyu posledovatel'nost'/SERIAL?
4.12) CHto takoe OID? CHto takoe TID? 4.12) CHto takoe OID? CHto takoe CTID?
4.13) Pochemu ya poluchayu oshibku "ERROR: Memory exhausted in 4.13) Pochemu ya poluchayu oshibku "ERROR: Memory exhausted in
AllocSetAlloc()"? AllocSetAlloc()"?
4.14) Kak mne uznat', kakaya versiya PostgreSQL zapuschena? 4.14) Kak mne uznat', kakaya versiya PostgreSQL zapuschena?
4.15) Pochemu pri rabote s moim bol'shim ob"ektom ya poluchayu oshibku 4.15) Kak mne sozdat' kolonku kotoraya po umolchaniyu budet soderzhat'
"invalid large obj descriptor"?
4.16) Kak mne sozdat' kolonku kotoraya po umolchaniyu budet soderzhat'
tekuschee vremya? tekuschee vremya?
4.17) Kak vypolnit' vneshnee svyazyvanie? 4.16) Kak vypolnit' vneshnee svyazyvanie?
4.18) Kak vypolnyat' zaprosy, ispol'zuyuschie neskol'ko baz dannyh? 4.17) Kak vypolnyat' zaprosy, ispol'zuyuschie neskol'ko baz dannyh?
4.19) Kak mne vernut' iz funkcii neskol'ko strok tablicy? 4.18) Kak mne vernut' iz funkcii neskol'ko strok tablicy?
4.20) Pochemu ya poluchayu oshibku "missing oid", kogda obraschayuts' 4.19) Pochemu ya poluchayu oshibku "relation with OID #### ne
k vremennym tablicam v funkciyah PL/PgSQL? suschestvuet", kogda obraschayuts' k vremennym tablicam v funkciyah
4.21) Kakie opcii shifrovaniya suschestvuyut? PL/PgSQL?
4.20) Kakie est' resheniya dlya replikacii?
Rasshireniya PostgreSQL
5.1) YA napisal funkciyu opredelyaemuyu pol'zovatelem. Kogda ya
zapuskayu ee v psql, pochemu ya poluchayu core dump?
5.2) Kak ya mogu vnesti nekotorye klassnye novye tipy i funkcii v
PostgreSQL?
5.3) Kak mne napisat' C funkciyu, vozvraschayuschuyu stroku tablicy?
5.4) YA izmenil ishodnyj fajl. Pochemu posle perekompilyacii ya ne
vizhu izmenenij?
_________________________________________________________________ _________________________________________________________________
Obschie voprosy Obschie voprosy
1.1) CHto takoe PostgreSQL? Kak proiznositsya `eto nazvanie? 1.1) CHto takoe PostgreSQL? Kak proiznositsya `eto nazvanie?
PostgreSQL proiznositsya Post-Gres-Q-L (Post-Gres-K'yu-`El), takzhe PostgreSQL proiznositsya Post-Gres-Q-L (Post-Gres-K'yu-`El), takzhe
chasto govoryat prosto Postgres. chasto govoryat prosto Postgres.
...@@ -125,8 +115,8 @@ ...@@ -125,8 +115,8 @@
Podrobnosti smotrite v FAQ dlya razrabotchikov, Podrobnosti smotrite v FAQ dlya razrabotchikov,
http://www.PostgreSQL.org/files/documentation/faqs/FAQ_DEV.html http://www.PostgreSQL.org/files/documentation/faqs/FAQ_DEV.html
1.2) Kakovy avtorskie prava na PostgreSQL? 1.2) Kakovy avtorskie prava na PostgreSQL?
PostgreSQL rasprostranyaetsya po klassicheskoj licenzii BSD. `Eta PostgreSQL rasprostranyaetsya po klassicheskoj licenzii BSD. `Eta
licenziya ne soderzhit ogranichenij na to, kak budet ispol'zovat'sya licenziya ne soderzhit ogranichenij na to, kak budet ispol'zovat'sya
ishodnyj kod. Nam nravitsya `eta licenziya i u nas net namerenij eio ishodnyj kod. Nam nravitsya `eta licenziya i u nas net namerenij eio
...@@ -137,7 +127,8 @@ ...@@ -137,7 +127,8 @@
Sistema Upravleniya Bazami Dannyh PostgreSQL Sistema Upravleniya Bazami Dannyh PostgreSQL
Portions copyright (c) 1996-2005, PostgreSQL Global Development Group Portions copyright (c) 1996-2005, PostgreSQL Global Development Group
Portions Copyright (c) 1994-6 Regents of the University of California Portions Copyright (c) 1994-1996 Regents of the University of
California
Predostavlyayutsya prava na ispol'zovanie, kopirovanie, izmenenie i Predostavlyayutsya prava na ispol'zovanie, kopirovanie, izmenenie i
rasprostranenie dannogo programmnogo obespecheniya i ego dokumentacii rasprostranenie dannogo programmnogo obespecheniya i ego dokumentacii
...@@ -161,16 +152,16 @@ ...@@ -161,16 +152,16 @@
PREDOSTAVLYAT' SOPROVOZHDENIE, PODDERZHKU, OBNOVLENIYA, RASSHIRENIYA PREDOSTAVLYAT' SOPROVOZHDENIE, PODDERZHKU, OBNOVLENIYA, RASSHIRENIYA
ILI IZMENENIYA. ILI IZMENENIYA.
1.3) Na kakih platformah rabotaet PostgreSQL? 1.3) Na kakih platformah rabotaet PostgreSQL?
Obychno, PostgreSQL mozhet rabotat' na lyuboj sovremennoj platforme Obychno, PostgreSQL mozhet rabotat' na lyuboj sovremennoj platforme
sovmestimoj s Unix. V instrukcii po ustanovke, vy najdete spisok teh sovmestimoj s Unix. V instrukcii po ustanovke, vy najdete spisok teh
platform, na kotoryh byli provedeny testovye zapuski PostgreSQL k platform, na kotoryh byli provedeny testovye zapuski PostgreSQL k
momentu vyhoda dannoj versii. momentu vyhoda dannoj versii.
Nachinaya s versii 8.0, PostgreSQL bez vsyakih uhischrenij rabotaet na PostgreSQL takzhe rabotaet na operacionnyh sistemah Microsoft Windows,
operacionnyh sistemah Microsoft Windows, osnovannyh na NT, takih kak osnovannyh na NT, takih kak Win2000, WinXP i Win2003. Paket
Win2000, WinXP i Win2003. Paket installyatora dostupen po adresu installyatora dostupen po adresu
http://pgfoundry.org/projects/pginstaller. Versii Windows, osnovannye http://pgfoundry.org/projects/pginstaller. Versii Windows, osnovannye
na MS-DOS (Win95, Win98, WinMe) mogut zapuskat' PostgreSQL s na MS-DOS (Win95, Win98, WinMe) mogut zapuskat' PostgreSQL s
pomosch'yu Cygwin. pomosch'yu Cygwin.
...@@ -180,14 +171,13 @@ ...@@ -180,14 +171,13 @@
http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&button=Search&key=postgre http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&button=Search&key=postgre
SQL&stype=all&sort=type&dir=%2F. SQL&stype=all&sort=type&dir=%2F.
1.4) Gde mozhno vzyat' PostgreSQL? 1.4) Gde mozhno vzyat' PostgreSQL?
Naprimer, vospol'zovavshis' anonimnym dostupom na ftp sajt PostgreSQL CHerez brauzer, ispol'zuya http://www.postgresql.org/ftp/ i cherez
ftp://ftp.PostgreSQL.org/pub. Spisok zerkal vy najdete na nashem ftp, ispol'zuya ftp://ftp.PostgreSQL.org/pub/.
osnovnom sajte.
1.5) Gde poluchit' podderzhku? 1.5) Gde poluchit' podderzhku?
Soobschestvo PostgreSQL predostavlyaet pomosch' mnozhestvu Soobschestvo PostgreSQL predostavlyaet pomosch' mnozhestvu
pol'zovatelej cherez E-mail. Osnovnoj web-sajt dlya podpiski na spiski pol'zovatelej cherez E-mail. Osnovnoj web-sajt dlya podpiski na spiski
rassylki po E-mail `eto: http://www.postgresql.org/community/lists/. rassylki po E-mail `eto: http://www.postgresql.org/community/lists/.
...@@ -205,22 +195,23 @@ ...@@ -205,22 +195,23 @@
Spisok kommercheskoj podderzhki kompanij dostupen na Spisok kommercheskoj podderzhki kompanij dostupen na
http://techdocs.postgresql.org/companies.php. http://techdocs.postgresql.org/companies.php.
1.6) Kak mne soobschit' ob oshibke? 1.6) Kak mne soobschit' ob oshibke?
Posetite stranichku so special'noj formoj otchiota ob oshibke v Posetite stranichku so special'noj formoj otchiota ob oshibke v
PostgreSQL po adresu: http://www.postgresql.org/support/submitbug. PostgreSQL po adresu: http://www.postgresql.org/support/submitbug.
Takzhe prover'te nalichie bolee svezhej versii PostgreSQL na nashem Takzhe prover'te nalichie bolee svezhej versii PostgreSQL na nashem
FTP sajte ftp://ftp.PostgreSQL.org/pub. FTP sajte ftp://ftp.PostgreSQL.org/pub/.
1.7) Kakaya poslednyaya versiya? 1.7) Kakaya poslednyaya versiya?
Poslednij vypusk PostgreSQL - `eto versiya 8.0.1 Poslednij vypusk PostgreSQL - `eto versiya 8.0.2
My planiruem vypuskat' novye versii kazhdye 10-12 mesyacev. My planiruem vypuskat' novye starshie versii kazhdyj god, a mladshie
versii kazhdye neskol'ko mesyacev.
1.8) Kakaya dokumentaciya imeetsya v nalichii? 1.8) Kakaya dokumentaciya imeetsya v nalichii?
PostgreSQL soderzhit mnogo dokumentacii, vklyuchaya bol'shoe PostgreSQL soderzhit mnogo dokumentacii, vklyuchaya bol'shoe
rukovodstvo, stranicy `elektronnogo rukovodstva man i nekotorye rukovodstvo, stranicy `elektronnogo rukovodstva man i nekotorye
malen'kie testovye primery. Smotrite v katalog /doc. Vy takzhe mozhete malen'kie testovye primery. Smotrite v katalog /doc. Vy takzhe mozhete
...@@ -229,8 +220,10 @@ ...@@ -229,8 +220,10 @@
Suschestvuet dve knigi po PostgreSQL dostupnye po adresam Suschestvuet dve knigi po PostgreSQL dostupnye po adresam
http://www.PostgreSQL.org/docs/books/awbook.html i http://www.PostgreSQL.org/docs/books/awbook.html i
http://www.commandprompt.com/ppbook/. Spisok knig po PostgreSQL, http://www.commandprompt.com/ppbook/. Est' neskol'ko knig po
kotorye mozhno kupit' dostupen po adresu PostgreSQL, kotorye mozhno kupit'. Odnu iz naibolee populyarnyh
napisal Korri Duglas (Korry Douglas). Spisok obzorov po `etim knigam
dostupen po adresu
http://techdocs.postgresql.org/techdocs/bookreviews.php. Krome togo, http://techdocs.postgresql.org/techdocs/bookreviews.php. Krome togo,
po adresu http://techdocs.PostgreSQL.org/ vy mozhete najti kollekciyu po adresu http://techdocs.PostgreSQL.org/ vy mozhete najti kollekciyu
tehnicheskih statej posvyaschennyh PostgreSQL. tehnicheskih statej posvyaschennyh PostgreSQL.
...@@ -241,48 +234,33 @@ ...@@ -241,48 +234,33 @@
Nash sajt soderzhit esche bol'she informacii. Nash sajt soderzhit esche bol'she informacii.
1.9) Kak najti informaciyu ob izvestnyh oshibkah ili otsutstvuyuschih 1.9) Kak najti informaciyu ob izvestnyh oshibkah ili otsutstvuyuschih
vozmozhnostyah? vozmozhnostyah?
PostgreSQL podderzhivaet rasshirennyj podklass SQL-92. Smotrite nash PostgreSQL podderzhivaet rasshirennyj podklass SQL-92. Smotrite nash
spisok TODO na predmet izvestnyh oshibok, otsutstvuyuschih spisok TODO na predmet izvestnyh oshibok, otsutstvuyuschih
vozmozhnostej i buduschih planov. vozmozhnostej i buduschih planov.
1.10) Kak mne nauchit'sya SQL? 1.10) Kak mne nauchit'sya SQL?
Kniga po PostgreSQL na Vo-pervyh, voz'mite odnu iz knig po PostgreSQL, o kotoryh govorilos'
http://www.PostgreSQL.org/docs/books/awbook.html nauchit SQL. vyshe. Esche odin uchebnik - `eto kniga "Teach Yourself SQL in 21
Suschestvuet drugaya kniga po PostgreSQL na Days, Second Edition" (Osvoj samostoyatel'no SQL za 21 den', Vtoraya
http://www.commandprompt.com/ppbook. Est' prekrasnyj uchebnik na redakciya) na http://members.tripod.com/er4ebus/sql/index.htm. Mnogim
iz nashih pol'zovatelej nravitsya kniga The Practical SQL Handbook,
Bowman, Judith S., et al., Addison-Wesley. Drugim nravitsya The
Complete Reference SQL, Groff et al., McGraw-Hill.
Est' prekrasnyj uchebnik na
http://www.intermedia.net/support/sql/sqltut.shtm, na http://www.intermedia.net/support/sql/sqltut.shtm, na
http://ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM, http://ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM,
i na http://sqlcourse.com. i na http://sqlcourse.com.
Esche odin uchebnik - `eto kniga "Teach Yourself SQL in 21 Days, 1.11) Kak prisoedinitsya k komande razrabotchikov?
Second Edition" (Osvoj samostoyatel'no SQL za 21 den', Vtoraya
redakciya) na http://members.tripod.com/er4ebus/sql/index.htm Smotrite FAQ dlya razrabotchikov.
Mnogim iz nashih pol'zovatelej nravitsya kniga The Practical SQL 1.12) Kak sravnivat' PostgreSQL s drugimi SUBD?
Handbook, Bowman, Judith S., et al., Addison-Wesley. Drugim nravitsya
The Complete Reference SQL, Groff et al., McGraw-Hill.
1.11) Kak prisoedinitsya k komande razrabotchikov?
Dlya nachala, skachajte poslednyuyu versiyu ishodnyh tekstov i
prochtite FAQ i dokumentaciyu dlya razrabotchikov PostgreSQL na nashem
sajte ili v distributive. Zatem, podpishites' na spiski rassylki
pgsql-hackers i pgsql-patches. Dalee, otpravlyajte ispravleniya
(patches) vysokogo kachestva v spisok pgsql-patches.
Suschestvuet ogranichennyj spisok lyudej, kotoryj imeyut privelegiyu
vnosit' izmeneniya v CVS arhiv PostgreSQL. Kazhdyj iz `etih lyudej v
svoe vremya otpravil tak mnogo vysokokachestvennyh ispravlenij, chto
ih bylo nevozmozhno ostavit' bez vnimaniya i oni byli udostoeny
previlegii vnosit' izmeneniya, i my uvereny, chto te ispravleniya,
kotorye oni vnesut budut vysokogo kachestva.
1.12) Kak sravnivat' PostgreSQL s drugimi SUBD?
Suschestvuet neskol'ko metodov sravneniya programmnogo obespecheniya: Suschestvuet neskol'ko metodov sravneniya programmnogo obespecheniya:
vozmozhnosti, proizvoditel'nost', nadezhnost', podderzhka i cena. vozmozhnosti, proizvoditel'nost', nadezhnost', podderzhka i cena.
...@@ -298,15 +276,8 @@ ...@@ -298,15 +276,8 @@
Proizvoditel'nost' Proizvoditel'nost'
Proizvoditel'nost' PostgreSQL shodna s drugimi kommercheskimi Proizvoditel'nost' PostgreSQL shodna s drugimi kommercheskimi
SUBD i s SUBD s otkrytym ishodnym kodom. V kakih-to veschah my SUBD i s SUBD s otkrytym ishodnym kodom. V kakih-to veschah my
bystree, v kakih-to medlennee. V sravnenii s MySQL ili linejnoj bystree, v kakih-to medlennee. Nasha proizvoditel'nosti obychno
SUBD, my bystree, kogda pol'zovatelej mnogo, a takzhe na +/-10% po sravneniyu s drugimi SUBD.
slozhnyh zaprosah i pri chtenii/zapisi zagruzki zaprosa. MySQL
bystree dlya prostyh SELECT zaprosov, vypolnyaemyh nebol'shim
kolichestvom pol'zovatelej. I razumeetsya, MySQL ne imeet
kakih-libo vozmozhnostej iz perechislenyh vyshe, v sekcii
Vozmozhnosti. My delaem upor na nadezhnost' i rasshirennye
vozmozhnosti, no my takzhe prodolzhaem uvelichivat'
proizvoditel'nost' s kazhdym vypuskom.
Nadezhnost' Nadezhnost'
My ponimali, chto nasha SUBD dolzhna byt' nadezhnoj ili ona My ponimali, chto nasha SUBD dolzhna byt' nadezhnoj ili ona
...@@ -339,10 +310,23 @@ ...@@ -339,10 +310,23 @@
opisyvayutsya v nashej licenzii stilya BSD, kotoraya privedena opisyvayutsya v nashej licenzii stilya BSD, kotoraya privedena
vyshe. vyshe.
1.13) Kto upravlyaet PostgreSQL?
Esli vy ischite kakogo-to osobennogo cheloveka, central'nyj komitet
ili upravlyayuschuyu kompaniyu, to naprasno --- ih net. U nas est'
yadro komiteta i razrabotchikov, rabotayuschih s CVS, no `eti gruppy
sluzhat bol'she dlya administrativnyh celej, chem dlya upravleniya.
Proekt napryamuyu funkcioniruet s pomosch'yu soobschestva
razrabotchikov i pol'zovatelej, k kotoromu mozhet prisoedinitsya
kazhdyj. Vsio chto nuzhno -- `eto podpisat'sya na spiski rassylki i
uchastvovat' v diskussiyah. (Podrobnosti o tom kak vklyuchit'sya v
razrabotku PostgreSQL smotrite v FAQ dlya razrabotchikov.)
_________________________________________________________________
Voprosy pol'zovatelej po klientskoj chasti Voprosy pol'zovatelej po klientskoj chasti
2.1) Kakie interfejsy est' dlya PostgreSQL? 2.1) Kakie interfejsy est' dlya PostgreSQL?
Ustanovka PostgreSQL vklyuchaet tol'ko C i vstroennyj (embedded) C Ustanovka PostgreSQL vklyuchaet tol'ko C i vstroennyj (embedded) C
interfejsy. Vse drugie interfejsy yavlyayutsya nezavisimymi proektami interfejsy. Vse drugie interfejsy yavlyayutsya nezavisimymi proektami
i zagruzhayutsya otdel'no; samostoyatel'nost' proektov pozvolyaet im i zagruzhayutsya otdel'no; samostoyatel'nost' proektov pozvolyaet im
...@@ -354,46 +338,40 @@ ...@@ -354,46 +338,40 @@
Python i mnogih drugih, dostupny na http://gborg.postgresql.org v Python i mnogih drugih, dostupny na http://gborg.postgresql.org v
sekcii Drivers/Interfaces, a takzhe cherez poisk v Internet. sekcii Drivers/Interfaces, a takzhe cherez poisk v Internet.
2.2) Kakie instrumenty suschestvuyut dlya ispol'zovaniya PostgreSQL cherez 2.2) Kakie instrumenty suschestvuyut dlya ispol'zovaniya PostgreSQL cherez
Web? Web?
Prekrasnoe vvedenie vo vzaimodejstvie baz dannyh i Web mozhno najti Prekrasnoe vvedenie vo vzaimodejstvie baz dannyh i Web mozhno najti
na: http://www.webreview.com na: http://www.webreview.com
Dlya integracii s Web, PHP http://www.php.net yavlyaetsya neplohim Dlya integracii s Web, PHP http://www.php.net yavlyaetsya neplohim
interfejsom. interfejsom.
V slozhnyh sluchayah, mnogie pol'zuyutsya Perl i CGI.pm ili mod_perl. V slozhnyh sluchayah, mnogie pol'zuyutsya Perl i DBD::Pg s CGI.pm ili
mod_perl.
2.3) Est' li u PostgreSQL graficheskij interfejs pol'zovatelya?
2.3) Est' li u PostgreSQL graficheskij interfejs pol'zovatelya?
Da, suschestvuet neskol'ko graficheskih interfejsov dlya PostgreSQL.
Oni vklyuchayut PgAdmin III (http://www.pgadmin.org), PgAccess Da, podrobnosti smotrite v
(http://www.pgaccess.org), RHDB Admin http://techdocs.postgresql.org/guides/GUITools.
(http://sources.redhat.com/rhdb/), TORA (http://www.globecom.net/tora/
chastichno kommercheskoe PO) i Rekall (
http://www.rekallrevealed.org/). Takzhe est' PhpPgAdmin (
http://phppgadmin.sourceforge.net/) - interfejs k PostgreSQL,
osnovannyj na Web.
_________________________________________________________________ _________________________________________________________________
Voprosy administrirovaniya Voprosy administrirovaniya
3.1) Kak mne ustanovit' PostgreSQL v mesto otlichnoe ot /usr/local/pgsql? 3.1) Kak mne ustanovit' PostgreSQL v mesto otlichnoe ot /usr/local/pgsql?
Zadajte opciyu --prefix kogda zapuskaete configure. Zadajte opciyu --prefix kogda zapuskaete configure.
3.2) Kak mne upravlyat' soedineniyami s drugih komp'yuterov? 3.2) Kak mne upravlyat' soedineniyami s drugih komp'yuterov?
Po umolchaniyu, PostgreSQL razreshaet tol'ko soedineniya na lokal'noj Po umolchaniyu, PostgreSQL razreshaet tol'ko soedineniya na lokal'noj
mashine cherez sokety domena Unix ili TCP/IP soedineniya. Dlya togo, mashine cherez sokety domena Unix ili TCP/IP soedineniya. Dlya togo,
chtoby drugie mashiny smogli podklyuchit'sya k baze vy dolzhny chtoby drugie mashiny smogli podklyuchit'sya k baze vy dolzhny
izmenit' listen_addresses v postgresql.conf, razreshit' izmenit' listen_addresses v postgresql.conf, razreshit'
host-avtorizaciya v fajle $PGDATA/pg_hba.conf i perestartovat' server. host-avtorizaciya v fajle $PGDATA/pg_hba.conf i perestartovat' server.
3.3) Kakie nastrojki mne nuzhno sdelat' dlya uluchsheniya 3.3) Kakie nastrojki mne nuzhno sdelat' dlya uluchsheniya proizvoditel'nosti?
proizvoditel'nosti?
Suschestvuet tri glavnyh oblasti, kotorye potencial'no mogut Suschestvuet tri glavnyh oblasti, kotorye potencial'no mogut
uvelichit' proizvoditel'nost': uvelichit' proizvoditel'nost':
...@@ -430,64 +408,27 @@ ...@@ -430,64 +408,27 @@
http://candle.pha.pa.us/main/writings/pgsql/hw_performance/inde http://candle.pha.pa.us/main/writings/pgsql/hw_performance/inde
x.html i http://www.powerpostgresql.com/PerfList/. x.html i http://www.powerpostgresql.com/PerfList/.
3.4) Kakie vozmozhnosti dlya otladki est' v nalichii? 3.4) Kakie vozmozhnosti dlya otladki est' v nalichii?
Est' mnozhestvo ustanovok v nastrojkah servera, nachinayuschihsya na Est' mnozhestvo ustanovok v nastrojkah servera, nachinayuschihsya na
log_*, pozvolyayuschih protokolirovat' zaprosy i statistiku raboty log_*, pozvolyayuschih protokolirovat' zaprosy i statistiku raboty
processa, kotoraya ochen' polezna dlya otladki i izmereniya processa, kotoraya ochen' polezna dlya otladki i izmereniya
proizvoditel'nosti. proizvoditel'nosti.
Dlya predostavleniya bolee detal'noj informacii razrabotchikam servera 3.5) Pochemu ya poluchayu soobschenie "Sorry, too many clients" kogda
pri otladke kakoj-libo problemy dolzhny pol'zovat'sya sleduyuschie pytayus' podklyuchit'sya k baze?
instrukcii.
Takim zhe obrazom mozhno proizvodit' i otladku severa, esli on
rabotaet nepravil'no. Vo-pervyh, pri zapuske configure s opciej
--enable-cassert, mnogie vyzovy assert() pozvolyayut otslezhivat'
rabotu backend processa i ostanovku programmy pri vozniknovenii
kakih-libo neozhidannostej.
Esli postmaster ne zapuschen, vy mozhete zapustit' postgres backend iz
komandnoj stroki i vvesti vash operator SQL napryamuyu. `Eto
rekomenduetsya tol'ko dlya celej otladki. Zametim, chto v `etom
rezhime, zapros zavershaetsya simvolom novoj stroki, a ne tochkoj s
zapyatoj. Esli vy proizvodili kompilyaciyu s otladochnymi simvolami,
vy mozhete ispol'zovat' lyuboj otladchik, chtoby posmotret', chto
sluchilos'. Poskol'ku backend zapuskaetsya ne iz postmaster, on ne
zapuskaetsya v identichnom okruzhenii i znachit problemy iteracij
blokirovok/backend ne mogut byt' vosproizvedeny.
Esli postmaster zapuschen, zapustite psql v odnom okne, zatem najdite
PID processa postgres, ispol'zuemyj psql, ispol'zuya SELECT
pg_backend_pid(). Ispol'zujte otladchik dlya podklyucheniya k postgres
PID. Vy mozhete ustanovit' tochki preryvaniya v otladchike i zapustit'
zapros iz psql. Esli vy proizvodite otladku zapuska postgres, vy
mozhete ustanovit' PGOPTIONS="-W n", i zatem zapustit' psql. `Eta
opciya privodit k zaderzhke processa zapuska na n sekund, v techenie
kotoryh vy mozhete podklyuchit' k processu otladchik, ustanovit'
lyubye tochki preryvaniya i prodolzhit' zapusk.
Vy takzhe mozhete skompilirovat' PostgreSQL s profilirovaniem dlya
togo, chtoby uvidet' kakie funkcii skol'ko vremeni vypolnyayutsya.
Fajly profilirovaniya backend'a nahodyatsya v kataloge
pgsql/data/base/dbname. Fajl profilirovaniya klienta budet pomeschen v
tekuschij katalog klienta. V Linux dlya vypolneniya profilirovaniya
trebuetsya kompilyacii s -DLINUX_PROFILE.
3.5) Pochemu ya poluchayu soobschenie "Sorry, too many clients" kogda
pytayus' podklyuchit'sya k baze?
Vy dostigli ustanovlennogo po umolchaniyu ogranicheniya na 100 sessij Vy dostigli ustanovlennogo po umolchaniyu ogranicheniya na 100 sessij
podklyucheniya k baze dannyh. Vam neobhodimo uvelichit' dlya podklyucheniya k baze dannyh. Vam neobhodimo uvelichit' dlya
postmaster limit na kolichestvo konkurentnyh backend processov, postmaster limit na kolichestvo konkurentnyh backend processov,
izmeniv znachenie max_connections v fajle postgresql.conf i izmeniv znachenie max_connections v fajle postgresql.conf i
perestartovat' postmaster. perestartovat' postmaster.
3.6) Pochemu neobhodimo delat' dump i restore pri obnovlenii vypuskov 3.6) Pochemu neobhodimo delat' dump i restore pri obnovlenii vypuskov
PostgreSQL? PostgreSQL?
Razrabotchiki PostgreSQL delayut tol'ko nebol'shie izmeneniya mezhdu Razrabotchiki PostgreSQL delayut tol'ko nebol'shie izmeneniya mezhdu
podvypuskami. Takim obrazom obnovlenie s versii 7.4 do 7.4.1 ne podvypuskami. Takim obrazom obnovlenie s versii 7.4.0 do 7.4.1 ne
trebuet vypolneniya dump i restore. Odnako pri vyhode ocherednogo trebuet vypolneniya dump i restore. Odnako pri vyhode ocherednogo
vypuska (t.e. pri obnovlenii naprimer, s 7.3 na 7.4) chasto menyaetsya vypuska (t.e. pri obnovlenii naprimer, s 7.3 na 7.4) chasto menyaetsya
vnutrennij format sistemnyh tablic i fajlov dannyh. `Eti izmeneniya vnutrennij format sistemnyh tablic i fajlov dannyh. `Eti izmeneniya
...@@ -501,8 +442,8 @@ ...@@ -501,8 +442,8 @@
bez ispol'zovaniya dump/restore. Kommentarii k vypusku govorit kogda bez ispol'zovaniya dump/restore. Kommentarii k vypusku govorit kogda
mozhno ispol'zovat' pg_upgrade dlya `etogo vypuska. mozhno ispol'zovat' pg_upgrade dlya `etogo vypuska.
3.7) Kakoe komp'yuternoe "zhelezo" ya dolzhen ispol'zovat'? 3.7) Kakoe komp'yuternoe "zhelezo" ya dolzhen ispol'zovat'?
Poskol'ku "zhelezo" personal'nyh komp'yuterov yavlyaetsya naibolee Poskol'ku "zhelezo" personal'nyh komp'yuterov yavlyaetsya naibolee
sovmestimym, lyudi sklonny verit', chto takoe "zhelezo" imeet sovmestimym, lyudi sklonny verit', chto takoe "zhelezo" imeet
odinakovoe kachestvo. `Eto ne tak. Pamyat' ECC, SCSI i kachestvennye odinakovoe kachestvo. `Eto ne tak. Pamyat' ECC, SCSI i kachestvennye
...@@ -516,15 +457,15 @@ ...@@ -516,15 +457,15 @@
Voprosy `ekspluatacii Voprosy `ekspluatacii
4.1) Kak vypolnit' SELECT tol'ko dlya neskol'kih pervyh strochek zaprosa? 4.1) Kak vypolnit' SELECT tol'ko dlya neskol'kih pervyh strochek zaprosa?
Proizvol'noj stroki? Proizvol'noj stroki?
Dlya polucheniya tol'ko neskol'kih strok, esli vy znaete ih Dlya polucheniya tol'ko neskol'kih strok, esli vy znaete ih
kolichestvo na moment vypolneniya SELECT ispol'zujte LIMIT. Esli est' kolichestvo na moment vypolneniya SELECT ispol'zujte LIMIT.
kakoj-libo indeks, kotoryj sovpadaet s ORDER BY, to vozmozhno, chto Esli est' kakoj-libo indeks, kotoryj sovpadaet s ORDER BY, to
ves' zapros vypolnen i ne budet. Esli vy ne znaete kolichestva vozmozhno, chto ves' zapros vypolnen i ne budet. Esli vy ne znaete
neobhodimyh strok na moment vypolneniya SELECT, ispol'zujte kursor i kolichestva neobhodimyh strok na moment vypolneniya SELECT,
FETCH. ispol'zujte kursor i FETCH.
To SELECT a random row, use: To SELECT a random row, use:
SELECT col SELECT col
...@@ -532,10 +473,10 @@ ...@@ -532,10 +473,10 @@
ORDER BY random() ORDER BY random()
LIMIT 1; LIMIT 1;
4.2) Kak mne najti kakie tablicy, indeksy, bazy dannyh i pol'zovateli 4.2) Kak mne najti kakie tablicy, indeksy, bazy dannyh i pol'zovateli
suschestvuyut? Kak mne uvidet' zaprosy, kotorye ispol'zuet psql dlya suschestvuyut? Kak mne uvidet' zaprosy, kotorye ispol'zuet psql dlya
polucheniya `etoj informacii? polucheniya `etoj informacii?
CHtoby prosmatrivat' tablicy v psql, ispol'zujte komandu \dt. Polnyj CHtoby prosmatrivat' tablicy v psql, ispol'zujte komandu \dt. Polnyj
spisok komand v psql vy mozhete poluchit', ispol'zuya \?. Krome togo, spisok komand v psql vy mozhete poluchit', ispol'zuya \?. Krome togo,
vy mozhete posmotret' ishodnyj kod psql v fajle vy mozhete posmotret' ishodnyj kod psql v fajle
...@@ -555,8 +496,8 @@ ...@@ -555,8 +496,8 @@
mnogie iz operatorov SELECT neobhodimyh dlya polucheniya informacii iz mnogie iz operatorov SELECT neobhodimyh dlya polucheniya informacii iz
sistemnyh tablic bazy dannyh. sistemnyh tablic bazy dannyh.
4.3) Kak izmenit' tip dannyh kolonki? 4.3) Kak izmenit' tip dannyh kolonki?
V 8.0 i bolee pozdnih versiyah, izmenenie tipa kolonki vypolnyaetsya V 8.0 i bolee pozdnih versiyah, izmenenie tipa kolonki vypolnyaetsya
ochen' legko cherez ALTER TABLE ALTER COLUMN TYPE. ochen' legko cherez ALTER TABLE ALTER COLUMN TYPE.
...@@ -567,9 +508,8 @@ ...@@ -567,9 +508,8 @@
ALTER TABLE tab DROP COLUMN old_col; ALTER TABLE tab DROP COLUMN old_col;
COMMIT; COMMIT;
4.4) Kakovy maksimal'nye razmery dlya strok v tablice, tablic i bazy 4.4) Kakovy maksimal'nye razmery dlya strok v tablice, tablic i bazy dannyh?
dannyh?
Suschestvuyut sleduyuschie ogranicheniya: Suschestvuyut sleduyuschie ogranicheniya:
Maksimal'nyj razmer bazy? neogranichen (suschestvuyut bazy na 32 TB) Maksimal'nyj razmer bazy? neogranichen (suschestvuyut bazy na 32 TB)
...@@ -595,9 +535,9 @@ ...@@ -595,9 +535,9 @@
byt' uvelicheny v chetyre raza, esli razmer bloka po umolchaniyu budet byt' uvelicheny v chetyre raza, esli razmer bloka po umolchaniyu budet
uvelichen do 32k. uvelichen do 32k.
4.5) Kak mnogo diskovogo prostranstva v baze dannyh nuzhno dlya sohraneniya 4.5) Kak mnogo diskovogo prostranstva v baze dannyh nuzhno dlya sohraneniya
dannyh iz obychnogo tekstovogo fajla? dannyh iz obychnogo tekstovogo fajla?
SUBD PostgreSQL mozhet potrebovat'sya diskovogo prostranstva do 5 raz SUBD PostgreSQL mozhet potrebovat'sya diskovogo prostranstva do 5 raz
bol'she dlya sohraneniya dannyh iz prostogo tekstovogo fajla. bol'she dlya sohraneniya dannyh iz prostogo tekstovogo fajla.
...@@ -630,15 +570,15 @@ ...@@ -630,15 +570,15 @@
Znacheniya NULL hranyatsya kak bitovye karty i po`etomu oni zanimayut Znacheniya NULL hranyatsya kak bitovye karty i po`etomu oni zanimayut
ochen' malo mesta. ochen' malo mesta.
4.6) Pochemu moi zaprosy rabotayut medleno? Pochemu oni ne ispol'zuyut moi 4.6) Pochemu moi zaprosy rabotayut medleno? Pochemu oni ne ispol'zuyut moi
indeksy? indeksy?
Indeksy ne ispol'zuyutsya dlya kazhdogo zaprosa avtomaticheski. Oni Indeksy ne ispol'zuyutsya dlya kazhdogo zaprosa. Oni ispol'zuyutsya
ispol'zuyutsya tol'ko esli tablica bol'she minimal'nogo razmera i tol'ko esli tablica bol'she minimal'nogo razmera i zapros vybiraet
zapros vybiraet tol'ko malen'kij procent strok v tablice. Tak tol'ko malen'kij procent strok v tablice. Tak ustroeno, potomu chto
ustroeno, potomu chto dostup k disku s primeneniem randomizacii pri dostup k disku s primeneniem randomizacii pri skanirovanii indeksov
skanirovanii indeksov mozhet byt' medlennee, chem prostoe chtenie mozhet byt' medlennee, chem prostoe chtenie tablicy ili ee
tablicy ili ee posledovatel'noe skanirovanie. posledovatel'noe skanirovanie.
CHtoby opredelit' neobhodimost' ispol'zovaniya indeksa dlya kakoj-libo CHtoby opredelit' neobhodimost' ispol'zovaniya indeksa dlya kakoj-libo
tablicy, PostgreSQL dolzhen imet' statistiku po `etoj tablice. `Eta tablicy, PostgreSQL dolzhen imet' statistiku po `etoj tablice. `Eta
...@@ -665,8 +605,8 @@ ...@@ -665,8 +605,8 @@
Esli vam kazhetsya, chto optimizator nekorrektno vybiraet Esli vam kazhetsya, chto optimizator nekorrektno vybiraet
posledovatel'nyj perebor, ispol'zujte SET enable_seqscan TO 'off' i posledovatel'nyj perebor, ispol'zujte SET enable_seqscan TO 'off' i
zapustite testy, chtoby uvidet', ne stalo-li skanirovanie indeksov zapustite zapros snova, chtoby uvidet', dejstvitel'no li skanirovanie
bystree. indeksov bystree.
Kogda ispol'zuyutsya operacii s shablonami, naprimer LIKE ili ~, Kogda ispol'zuyutsya operacii s shablonami, naprimer LIKE ili ~,
indeksy mogut byt' ispol'zovany v sleduyuschih sluchayah: indeksy mogut byt' ispol'zovany v sleduyuschih sluchayah:
...@@ -689,14 +629,14 @@ ...@@ -689,14 +629,14 @@
esli tipy dannyh tochno ne sovpadali s indeksnymi tipami kolonok. `Eto esli tipy dannyh tochno ne sovpadali s indeksnymi tipami kolonok. `Eto
osobenno kasalos' int2, int8 i numeric indeksov kolonok. osobenno kasalos' int2, int8 i numeric indeksov kolonok.
4.7) Kak posmotret' na to, kak optimizator vypolnyaet moj zapros? 4.7) Kak posmotret' na to, kak optimizator vypolnyaet moj zapros?
Smotrite stranicu rukovodstva posvyaschennuyu EXPLAIN. Smotrite stranicu rukovodstva posvyaschennuyu EXPLAIN.
4.8) Kak mne vypolnit' poisk regulyarnogo vyrazheniya i poisk nezavisimyj 4.8) Kak mne vypolnit' poisk regulyarnogo vyrazheniya i poisk nezavisimyj ot
ot registra bukv poisk regulyarnogo vyrazheniya? Kak mne ispol'zovat' registra bukv poisk regulyarnogo vyrazheniya? Kak mne ispol'zovat' indeks
indeks dlya poiska nezavisimogo ot registra bukv? dlya poiska nezavisimogo ot registra bukv?
Operator ~ proizvodit poisk regulyarnogo vyrazheniya, a operator ~* Operator ~ proizvodit poisk regulyarnogo vyrazheniya, a operator ~*
proizvodit nezavisimyj ot registra bukv poisk regulyarnogo proizvodit nezavisimyj ot registra bukv poisk regulyarnogo
vyrazheniya. Nezavisimyj ot registra variant LIKE nazyvaetsya ILIKE. vyrazheniya. Nezavisimyj ot registra variant LIKE nazyvaetsya ILIKE.
...@@ -710,13 +650,24 @@ ...@@ -710,13 +650,24 @@
esli vy sozdadite indeks vyrazheniya, on budet ispol'zovan: esli vy sozdadite indeks vyrazheniya, on budet ispol'zovan:
CREATE INDEX tabindex ON tab (lower(col)); CREATE INDEX tabindex ON tab (lower(col));
4.9) Kak ya mogu opredelit', chto znachenie polya ravno NULL v kakom-libo 4.9) Kak mne opredelit', chto znachenie polya ravno NULL v kakom-libo
zaprose? zaprose? Mogu ya otsortirovat' polya NULL ili net?
Vy prosto sravnivaete znachenie s IS NULL i IS NOT NULL. Vy prosto sravnivaete znachenie s IS NULL i IS NOT NULL, kak zdes':
SELECT *
4.10) Kakovy otlichiya mezhdu raznymi simvol'nymi tipami? FROM tab
WHERE col IS NULL;
CHtoby otsortirovat' dannye po znacheniyu ispol'zujte modifikatory IS
NULL i IS NOT NULL v vyrazhenii ORDER BY. Kogda oni budut generirovat'
znacheniya istina, to pri sortirovke oni budut vyshe, chem znacheniya
lozh', tak chto zapisi s NULL budut v otsortirovannom spiske sverhu:
SELECT *
FROM tab
ORDER BY (col IS NOT NULL);
4.10) Kakovy otlichiya mezhdu raznymi simvol'nymi tipami?
Tip Vnutrennee imya Zamechaniya Tip Vnutrennee imya Zamechaniya
VARCHAR(n) varchar razmer zadaet maksimal'nuyu dlinu, net zapolneniya VARCHAR(n) varchar razmer zadaet maksimal'nuyu dlinu, net zapolneniya
CHAR(n) bpchar zapolnyaetsya pustotoj do fiksirovannoj dliny CHAR(n) bpchar zapolnyaetsya pustotoj do fiksirovannoj dliny
...@@ -731,10 +682,9 @@ ...@@ -731,10 +682,9 @@
Pervye chetyre tipa yavlyayutsya "varlena" tipami (t.e., pervye Pervye chetyre tipa yavlyayutsya "varlena" tipami (t.e., pervye
chetyre bajta na diske yavlyayutsya dlinnoj, za kotoroj sleduyut chetyre bajta na diske yavlyayutsya dlinnoj, za kotoroj sleduyut
dannye). Takim obrazom, fakticheski ispol'zuemoe prostranstvo bol'she, dannye). Takim obrazom, fakticheski ispol'zuemoe prostranstvo bol'she,
chem oboznachennyj razmer. Odnako, `eti tipy dannyh takzhe poddayutsya chem oboznachennyj razmer. Odnako, dlinnye znacheniya takzhe
szhatiyu ili mogut byt' sohraneny ne v strokom vide cherez TOAST, tak szhimayutsya, tak chto zanimaemoe diskovoe prostranstvo mozhet takzhe
chto zanimaemoe diskovoe prostranstvo mozhet takzhe byt' i men'she, byt' i men'she, chem ozhidalos'.
chem ozhidalos'.
VARCHAR(n) - `eto luchshee reshenie, kogda nuzhno hranit' stroki VARCHAR(n) - `eto luchshee reshenie, kogda nuzhno hranit' stroki
peremennoj dliny, ne prevyshayuschie opredelennogo razmera. TEXT - peremennoj dliny, ne prevyshayuschie opredelennogo razmera. TEXT -
`eto luchshee reshenie dlya strok neogranichennoj dliny, s maksimal'no `eto luchshee reshenie dlya strok neogranichennoj dliny, s maksimal'no
...@@ -747,8 +697,8 @@ ...@@ -747,8 +697,8 @@
znacheniya kotoryh mogut vklyuchat' NULL bajty. Vse tipy opisannye znacheniya kotoryh mogut vklyuchat' NULL bajty. Vse tipy opisannye
zdes', imeyut shodnye harakteristiki proizvoditel'nosti. zdes', imeyut shodnye harakteristiki proizvoditel'nosti.
4.11.1) Kak mne sozdat' pole serial/s-avto-uvelicheniem? 4.11.1) Kak mne sozdat' pole serial/s-avto-uvelicheniem?
PostgreSQL podderzhivaet tip dannyh SERIAL. On avtomaticheski sozdaet PostgreSQL podderzhivaet tip dannyh SERIAL. On avtomaticheski sozdaet
posledovatel'nost'. Naprimer: posledovatel'nost'. Naprimer:
CREATE TABLE person ( CREATE TABLE person (
...@@ -766,8 +716,8 @@ ...@@ -766,8 +716,8 @@
Smotrite podrobnosti o posledovatel'nostyah na stranice rukovodstva Smotrite podrobnosti o posledovatel'nostyah na stranice rukovodstva
posvyaschennoj create_sequence. posvyaschennoj create_sequence.
4.11.2) Kak mne poluchit' znachenie pri vstavke SERIAL? 4.11.2) Kak mne poluchit' znachenie pri vstavke SERIAL?
Odin iz sposobov sostoit v poluchenii sleduyuschego znacheniya SERIAL Odin iz sposobov sostoit v poluchenii sleduyuschego znacheniya SERIAL
iz ob"ekta sequence s pomosch'yu funkcii nextval() pered vstavkoj i iz ob"ekta sequence s pomosch'yu funkcii nextval() pered vstavkoj i
zatem vstavlyat' `eto znachenie yavno. Ispol'zujte tablicu-primer v zatem vstavlyat' `eto znachenie yavno. Ispol'zujte tablicu-primer v
...@@ -788,23 +738,23 @@ ...@@ -788,23 +738,23 @@
execute("INSERT INTO person (name) VALUES ('Blaise Pascal')"); execute("INSERT INTO person (name) VALUES ('Blaise Pascal')");
new_id = execute("SELECT currval('person_id_seq')"); new_id = execute("SELECT currval('person_id_seq')");
4.11.3) Ne mozhet li poluchit'sya tak, chto ispol'zovanie currval() i 4.11.3) Ne mozhet li poluchit'sya tak, chto ispol'zovanie currval() i
nextval() privedet k zaciklirovaniyu s drugimi pol'zovatelyami? nextval() privedet k zaciklirovaniyu s drugimi pol'zovatelyami?
Net. currval() vozvraschaet tekuschee znachenie, naznachennoe vashej Net. currval() vozvraschaet tekuschee znachenie, naznachennoe vashej
sessiej, a ne drugimi sessiyami. sessiej, a ne drugimi sessiyami.
4.11.4) Pochemu chisla iz moej posledovatel'nosti ne ispol'zuyutsya snova 4.11.4) Pochemu chisla iz moej posledovatel'nosti ne ispol'zuyutsya snova pri
pri otmene tranzakcii? Pochemu sozdayutsya razryvy pri numeracii v kolonke, otmene tranzakcii? Pochemu sozdayutsya razryvy pri numeracii v kolonke, gde
gde ya ispol'zuyu posledovatel'nost'/SERIAL? ya ispol'zuyu posledovatel'nost'/SERIAL?
Dlya realizacii konkuretnosti, znacheniya posledovatel'nostej, pri Dlya realizacii konkuretnosti, znacheniya posledovatel'nostej, pri
neobhodimosti vydayutsya vo vremya zapuska tranzakcij i ne neobhodimosti vydayutsya vo vremya zapuska tranzakcij i ne
blokiruyutsya do polnogo vypolneniya tranzakcij. `Eto mozhet vyzyvat' blokiruyutsya do polnogo vypolneniya tranzakcij. `Eto mozhet vyzyvat'
razryvy v numeracii pri otmene tranzakcij. razryvy v numeracii pri otmene tranzakcij.
4.12) CHto takoe OID? CHto takoe TID? 4.12) CHto takoe OID? CHto takoe CTID?
Kazhdaya, sozdavaemaya v PostgreSQL tablichnaya stroka, poluchaet Kazhdaya, sozdavaemaya v PostgreSQL tablichnaya stroka, poluchaet
unikal'nyj indentifikator OID za isklyucheniem sluchaya kogda unikal'nyj indentifikator OID za isklyucheniem sluchaya kogda
ispol'zovalos' WITHOUT OIDS. OID - `eto avtomaticheski naznachaemoe ispol'zovalos' WITHOUT OIDS. OID - `eto avtomaticheski naznachaemoe
...@@ -819,14 +769,16 @@ ...@@ -819,14 +769,16 @@
obrazom men'she podverzheny perepolneniyu. Dlya hraneniya znachenij obrazom men'she podverzheny perepolneniyu. Dlya hraneniya znachenij
8-mi bajtnoj posledovatel'nosti dostupen tip SERIAL8. 8-mi bajtnoj posledovatel'nosti dostupen tip SERIAL8.
TID ispol'zuetsya dlya identifikacii special'nyh fizicheskih zapisej s CTID ispol'zuetsya dlya identifikacii special'nyh fizicheskih zapisej
blochnymi i offset znacheniyami. TID izmenyaetsya posle togo kak s blochnymi i offset znacheniyami. CTID izmenyaetsya posle togo kak
stroki v tablice byli izmeneny ili peregruzheny. TID ispol'zuetsya stroki v tablice byli izmeneny ili peregruzheny.
indeksnymi zapisyami v kachestve ukazatelya na fizicheskie zapisi.
TID ispol'zuetsya indeksnymi zapisyami v kachestve ukazatelya na
fizicheskie zapisi.
4.13) Pochemu ya poluchayu oshibku "ERROR: Memory exhausted in 4.13) Pochemu ya poluchayu oshibku "ERROR: Memory exhausted in
AllocSetAlloc()"? AllocSetAlloc()"?
Predpolozhitel'no u vas zakonchilas' virtual'naya pamyat' ili chto Predpolozhitel'no u vas zakonchilas' virtual'naya pamyat' ili chto
vashe yadro imeet malen'kij limit na opredelennye resursy. Popytajtes' vashe yadro imeet malen'kij limit na opredelennye resursy. Popytajtes'
pered zapuskom postmaster vypolnit' sleduyuschie komandy: pered zapuskom postmaster vypolnit' sleduyuschie komandy:
...@@ -841,36 +793,18 @@ ...@@ -841,36 +793,18 @@
klientom, potomu chto backend vozvraschaet slishkom bol'shoj ob"em klientom, potomu chto backend vozvraschaet slishkom bol'shoj ob"em
dannyh, popytajtes' vypolnit' `etu komandu pered zapuskom klienta. dannyh, popytajtes' vypolnit' `etu komandu pered zapuskom klienta.
4.14) Kak mne uznat', kakaya versiya PostgreSQL zapuschena? 4.14) Kak mne uznat', kakaya versiya PostgreSQL zapuschena?
Iz psql, naberite SELECT version(); Iz psql, naberite SELECT version();
4.15) Pochemu pri rabote s moim bol'shim ob"ektom ya poluchayu oshibku 4.15) Kak mne sozdat' kolonku kotoraya po umolchaniyu budet soderzhat'
"invalid large obj descriptor"? tekuschee vremya?
Vam nuzhno pri ispol'zovanii bol'shogo ob"ekta pomestit' v nachale
BEGIN WORK i v konce COMMIT, a vnutri poluchivshegosya bloka lo_open
... lo_close.
V nastoyaschij moment PostgreSQL trebuet, chtoby pri zakrytii
bol'shogo ob"ekta proishodilo vypolnenie tranzakcii. Takim obrazom,
pervaya zhe popytka sdelat' chto-libo s bol'shim ob"ektom, ne
soblyudaya dannogo pravila privedet k soobscheniyu invalid large obj
descriptor, tak kak kod vypolnyayuschij rabotu nad bol'shim ob"ektom
(po krajnej mere v nastoyaschij moment) budet generirovat' soobschenie
ob oshibke esli vy ne ispol'zuete tranzakciyu.
Esli vy ispol'zuete takoj interfejs klienta kak ODBC, vam vozmozhno
ponadobitsya ustanovit' auto-commit off.
4.16) Kak mne sozdat' kolonku kotoraya po umolchaniyu budet soderzhat'
tekuschee vremya?
Ispol'zujte CURRENT_TIMESTAMP: Ispol'zujte CURRENT_TIMESTAMP:
CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
4.17) Kak mne vypolnit' vneshnee svyazyvanie? 4.16) Kak mne vypolnit' vneshnee svyazyvanie?
PostgreSQL podderzhivaet vneshnee svyazyvanie, ispol'zuya standartnyj PostgreSQL podderzhivaet vneshnee svyazyvanie, ispol'zuya standartnyj
sintaksis SQL. Vot dva primera: sintaksis SQL. Vot dva primera:
SELECT * SELECT *
...@@ -888,8 +822,8 @@ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); ...@@ -888,8 +822,8 @@ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
neobyazatel'nym i naznachaetsya v LEFT, RIGHT i FULL svyazyvaniyah. neobyazatel'nym i naznachaetsya v LEFT, RIGHT i FULL svyazyvaniyah.
Obychnye svyazyvaniya nazyvayutsya INNER svyazyvaniya. Obychnye svyazyvaniya nazyvayutsya INNER svyazyvaniya.
4.18) Kak vypolnyat' zaprosy, ispol'zuyuschie neskol'ko baz dannyh? 4.17) Kak vypolnyat' zaprosy, ispol'zuyuschie neskol'ko baz dannyh?
Ne suschestvuet sposoba sozdat' zapros k bazam dannyh otlichnym ot Ne suschestvuet sposoba sozdat' zapros k bazam dannyh otlichnym ot
tekuschej. Poskol'ku PostgreSQL zagruzhaet sistemnye katalogi tekuschej. Poskol'ku PostgreSQL zagruzhaet sistemnye katalogi
specifichnye dlya bazy dannyh, neponyatno dazhe, kak dolzhen sebya specifichnye dlya bazy dannyh, neponyatno dazhe, kak dolzhen sebya
...@@ -900,14 +834,14 @@ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); ...@@ -900,14 +834,14 @@ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
soedieneniya s razlichnymi bazami dannyh i takih obrazom ob"edinyat' soedieneniya s razlichnymi bazami dannyh i takih obrazom ob"edinyat'
informaciyu iz nih. informaciyu iz nih.
4.19) Kak mne vernut' iz funkcii neskol'ko strok tablicy? 4.18) Kak mne vernut' iz funkcii neskol'ko strok tablicy?
Vy mozhete legko ispol'zovat' funkcii, vozvraschayuschie spisok, Vy mozhete legko ispol'zovat' funkcii, vozvraschayuschie spisok,
http://techdocs.postgresql.org/guides/SetReturningFunctions. http://techdocs.postgresql.org/guides/SetReturningFunctions.
4.20) Pochemu ya poluchayu oshibku "missing oid", kogda obraschayuts' k 4.19) Pochemu ya poluchayu oshibku "relation with OID #### ne suschestvuet",
vremennym tablicam v funkciyah PL/PgSQL? kogda obraschayuts' k vremennym tablicam v funkciyah PL/PgSQL?
PL/PgSQL k`eshiruet scenarii funkcii i odin iz negativnyh `effektov PL/PgSQL k`eshiruet scenarii funkcii i odin iz negativnyh `effektov
`etogo sostoit v tom, chto esli funkciya PL/PgSQL obraschaetsya k `etogo sostoit v tom, chto esli funkciya PL/PgSQL obraschaetsya k
vremennoj tablice i `eta tablica pozdnee udalyaetsya i peresozdaetsya, vremennoj tablice i `eta tablica pozdnee udalyaetsya i peresozdaetsya,
...@@ -917,50 +851,21 @@ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); ...@@ -917,50 +851,21 @@ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
EXECUTE dlya dostupa k vremennym tablicam v PL/PgSQL. Ispol'zovanie EXECUTE dlya dostupa k vremennym tablicam v PL/PgSQL. Ispol'zovanie
`etogo operatora zastavit zapros peregenerirovat'sya kazhdyj raz. `etogo operatora zastavit zapros peregenerirovat'sya kazhdyj raz.
4.21) Kakie opcii shifrovaniya suschestvuyut? 4.20) Kakie est' resheniya dlya replikacii?
* contrib/pgcrypto soderzhit mnogo funkcij shifrovaniya dlya Hotya "replikaciya" -- `eto edinyj termin, est' neskol'ko raznyh
ispol'zovaniya v SQL zaprosah. tehnologij dlya vypolneniya replikacij s raznymi osobennostyami dlya
* Dlya shifrovaniya peredavaemyh dannyh ot klienta k serveru, na kazhdoj.
servere v fajle postgresql.conf, opciya ssl dolzhna byt'
ustanovlena v true, v fajle pg_hba.conf dolzhna byt' Replikaciya Master/slave pozvolyaet imet' odin glavnyj (master) server
sootvetstvuyuschaya zapis' host ili hostssl i na storone klienta dlya vypolneniya zaprosov chteniya/zapisi, v to vremya kak
sslmode ne dolzhen byt' zapreschion cherez disable. (Zametim, chto podchinionnye (slave) servera mogut proizvodit' tol'ko zaprosy
takzhe vozmozhno ispol'zovanie nezavisimyh vneshnih shifruyuschih chteniya/SELECT. Naibolee populyarnym resheniem dlya replikacii
transportov, takih kak stunnel ili ssh, vmesto sobstvennyh SSL master-slave v PostgreSQL yavlyaetsya Slony-I.
soedinenij PostgreSQL).
* Paroli pol'zovatelej k baze dannyh avtomaticheski shifruyutsya, Replikaciya Multi-master pozvolyaet vypolnyat' zaprosy chteniya/zapisi
pri sohranenii v sistemnyh tablicah. na neskol'kih, repliciruemyh drug s drugom komp'yuetrah. `Eta
* Server mozhno zapustit', ispol'zuya shifrovannuyu fajlovuyu osobennost' takzhe privodit k potere proizvoditel'nosti, potomu chto
sistemu. neobhodima sinhronizaciya izmenenij mezhdu neskol'kimi serverami.
_________________________________________________________________ Naibolee populyarnym resheniem dlya takoj replikacii v PostgreSQL
yavlyaetsya Pgcluster.
Rasshireniya PostgreSQL
5.1) YA napisal funkciyu opredelyaemuyu pol'zovatelem. Kogda ya zapuskayu
ee v psql, pochemu ya poluchayu core dump?
Problema mozhet zaklyuchat'sya v neskol'kih veschah. Popytajtes'
sperva protestirovat' vashu funkciyu v otdel'noj samostoyatel'noj
programme.
5.2) Kak ya mogu vnesti nekotorye klassnye novye tipy i funkcii v
PostgreSQL?
Otprav'te vashi rasshireniya v spisok rassylki pgsql-hackers i oni po
vozmozhnosti budut pomescheny v podkatalog contrib/.
5.3) Kak mne napisat' C funkciyu, vozvraschayuschuyu stroku tablicy?
V versiyah PostgreSQL, nachinaya s 7.3, funkcii, vozvraschayuschie
tablicy polnost'yu podderzhivayutsya v C, PL/PgSQL i SQL. Podrobnosti
smotrite v Rukovodstve Programmista. Primer vozvraschayuschej tablicu
funkcii, napisannoj na C, mozhno najti v contrib/tablefunc.
5.4) YA izmenil ishodnyj fajl. Pochemu posle perekompilyacii ya ne vizhu
izmenenij?
Fajly Makefile ne imeyut pravil'nyh zavisimostej dlya include fajlov.
Vy dolzhny vypolnit' make clean i zatem make. Esli vy ispol'zuete GCC
vy mozhete ispol'zovat' opciyu --enable-depend v configure chtoby
poruchit' kompilyatoru avtomaticheski otslezhivat' zavisimosti.
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
<BODY bgcolor="#ffffff" text="#000000" link="#ff0000" vlink="#a00000" alink="#0000ff"> <BODY bgcolor="#ffffff" text="#000000" link="#ff0000" vlink="#a00000" alink="#0000ff">
<H1> PostgreSQL</H1> <H1> PostgreSQL</H1>
<P> : 14 23:35:09 EST 2005</P> <P> : 30 09:11:03 EDT 2005</P>
<P> : (Bruce Momjian) (<A href= <P> : (Bruce Momjian) (<A href=
"mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)<BR> "mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)<BR>
</P> </P>
<P> : (<A href= <P>ף : (<A href=
"mailto:corochoone@perm.ru">corochoone@perm.ru</A>)<BR> "mailto:corochoone@perm.ru">corochoone@perm.ru</A>)<BR>
</P> </P>
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
<A href="#1.11">1.11</A>) ?<BR> <A href="#1.11">1.11</A>) ?<BR>
<A href="#1.12">1.12</A>) PostgreSQL <A href="#1.12">1.12</A>) PostgreSQL
<SMALL></SMALL>?<BR> <SMALL></SMALL>?<BR>
<A href="#1.13">1.13</A>) PostgreSQL?<BR>
<H2 align="center"> </H2> <H2 align="center"> </H2>
...@@ -87,8 +88,9 @@ ...@@ -87,8 +88,9 @@
<A href="#4.8">4.8</A>) <A href="#4.8">4.8</A>)
? ?
?<BR> ?<BR>
<A href="#4.9">4.9</A>) , <A href="#4.9">4.9</A>) ,
<SMALL>NULL</SMALL> - ?<BR> <SMALL>NULL</SMALL> - ?
<SMALL>NULL</SMALL> ?<BR>
<A href="#4.10">4.10</A>) <A href="#4.10">4.10</A>)
?<BR> ?<BR>
<A href="#4.11.1">4.11.1</A>) serial/--?<BR> <A href="#4.11.1">4.11.1</A>) serial/--?<BR>
...@@ -101,38 +103,26 @@ ...@@ -101,38 +103,26 @@
? ?
, /SERIAL?<BR> , /SERIAL?<BR>
<A href="#4.12">4.12</A>) <SMALL>OID</SMALL>? <A href="#4.12">4.12</A>) <SMALL>OID</SMALL>?
<SMALL>TID</SMALL>?<BR> <SMALL>CTID</SMALL>?<BR>
<A href="#4.13">4.13</A>) <I>"ERROR: Memory <A href="#4.13">4.13</A>) <I>"ERROR: Memory
exhausted in AllocSetAlloc()"</I>?<BR> exhausted in AllocSetAlloc()"</I>?<BR>
<A href="#4.14">4.14</A>) , PostgreSQL <A href="#4.14">4.14</A>) , PostgreSQL
?<BR> ?<BR>
<A href="#4.15">4.15</A>) <A href="#4.15">4.15</A>)
<I>"invalid large obj descriptor"</I>?<BR>
<A href="#4.16">4.16</A>)
?<BR> ?<BR>
<A href="#4.17">4.17</A>) ?<BR> <A href="#4.16">4.16</A>) ?<BR>
<A href="#4.18">4.18</A>) , <A href="#4.17">4.17</A>) ,
?<BR> ?<BR>
<A href="#4.19">4.19</A>) ?<BR> <A href="#4.18">4.18</A>) ?<BR>
<A href="#4.20">4.20</A>) "missing oid", <A href="#4.19">4.19</A>) "relation with OID ####
PL/PgSQL?<BR> ", PL/PgSQL?<BR>
<A href="#4.21">4.21</A>) ?<BR> <A href="#4.20">4.20</A>) ?<BR>
<H2 align="center"> PostgreSQL</H2>
<A href="#5.1">5.1</A>) .
<I>psql</I>, core dump?<BR>
<A href="#5.2">5.2</A>)
PostgreSQL?<BR>
<A href="#5.3">5.3</A>) C ,
?<BR>
<A href="#5.4">5.4</A>) .
?<BR>
<HR> <HR>
<H2 align="center"> </H2> <H2 align="center"> </H2>
<H4><A name="1.1">1.1</A>) PostgreSQL? ?</H4> <H3><A name="1.1">1.1</A>) PostgreSQL? ?</H3>
<P>PostgreSQL <I>Post-Gres-Q-L (---)</I>, <P>PostgreSQL <I>Post-Gres-Q-L (---)</I>,
<I>Postgres</I>.</P> <I>Postgres</I>.</P>
...@@ -151,7 +141,7 @@ ...@@ -151,7 +141,7 @@
http://www.PostgreSQL.org/files/documentation/faqs/FAQ_DEV.html</A> http://www.PostgreSQL.org/files/documentation/faqs/FAQ_DEV.html</A>
</P> </P>
<H4><A name="1.2">1.2</A>) PostgreSQL?</H4> <H3><A name="1.2">1.2</A>) PostgreSQL?</H3>
<P>PostgreSQL BSD. <P>PostgreSQL BSD.
, ,
...@@ -163,7 +153,7 @@ ...@@ -163,7 +153,7 @@
<P> PostgreSQL</P> <P> PostgreSQL</P>
<P>Portions copyright (c) 1996-2005, PostgreSQL Global Development <P>Portions copyright (c) 1996-2005, PostgreSQL Global Development
Group Portions Copyright (c) 1994-6 Regents of the University of Group Portions Copyright (c) 1994-1996 Regents of the University of
California</P> California</P>
<P> , , <P> , ,
...@@ -187,16 +177,16 @@ ...@@ -187,16 +177,16 @@
" " " "
, , , .</P> , , , .</P>
<H4><A name="1.3">1.3</A>) PostgreSQL?</H4> <H3><A name="1.3">1.3</A>) PostgreSQL?</H3>
<P>, PostgreSQL <P>, PostgreSQL
Unix. , Unix. ,
, PostgreSQL , PostgreSQL
.</P> .</P>
<P> 8.0, PostgreSQL <P>PostgreSQL Microsoft
Microsoft Windows, NT, Windows, NT, Win2000, WinXP Win2003.
Win2000, WinXP Win2003.
<A href="http://pgfoundry.org/projects/pginstaller"> <A href="http://pgfoundry.org/projects/pginstaller">
http://pgfoundry.org/projects/pginstaller</A>. Windows, http://pgfoundry.org/projects/pginstaller</A>. Windows,
MS-DOS (Win95, Win98, WinMe) MS-DOS (Win95, Win98, WinMe)
...@@ -208,14 +198,13 @@ ...@@ -208,14 +198,13 @@
<A href="http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&amp;button=Search&amp;key=postgreSQL&amp;stype=all&amp;sort=type&amp;dir=%2F"> <A href="http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&amp;button=Search&amp;key=postgreSQL&amp;stype=all&amp;sort=type&amp;dir=%2F">
http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&amp;button=Search&amp;key=postgreSQL&amp;stype=all&amp;sort=type&amp;dir=%2F</A>.</P> http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&amp;button=Search&amp;key=postgreSQL&amp;stype=all&amp;sort=type&amp;dir=%2F</A>.</P>
<H4><A name="1.4">1.4</A>) PostgreSQL?</H4> <H3><A name="1.4">1.4</A>) PostgreSQL?</H3>
<P>, ftp <P> , <a href="http://www.postgresql.org/ftp/">
PostgreSQL <A href= http://www.postgresql.org/ftp/</a> ftp,
"ftp://ftp.PostgreSQL.org/pub">ftp://ftp.PostgreSQL.org/pub</A>. <A href="ftp://ftp.PostgreSQL.org/pub/">ftp://ftp.PostgreSQL.org/pub/</A>.</P>
.</P>
<H4><A name="1.5">1.5</A>) ?</H4> <H3><A name="1.5">1.5</A>) ?</H3>
<P> PostgreSQL <P> PostgreSQL
E-mail. web- E-mail. web-
...@@ -233,28 +222,30 @@ ...@@ -233,28 +222,30 @@
. PostgreSQL EFNet.</P> . PostgreSQL EFNet.</P>
<P> <P>
<A href="http://techdocs.postgresql.org/companies.php">http://techdocs.postgresql.org/companies.php</A>.</P> <A href="http://techdocs.postgresql.org/companies.php">
http://techdocs.postgresql.org/companies.php</A>.</P>
<H4><A name="1.6">1.6</A>) ?</H4> <H3><A name="1.6">1.6</A>) ?</H3>
<P> ޣ <P> ޣ
PostgreSQL : PostgreSQL :
<A href="http://www.postgresql.org/support/submitbug"> <A HREF="http://www.postgresql.org/support/submitbug">
http://www.postgresql.org/support/submitbug</A>.</P> http://www.postgresql.org/support/submitbug</A>.</P>
<P> PostgreSQL <P> PostgreSQL
FTP <A href="ftp://ftp.postgresql.org/pub"> FTP <A href="ftp://ftp.postgresql.org/pub/">
ftp://ftp.PostgreSQL.org/pub</A>.</P> ftp://ftp.PostgreSQL.org/pub/</A>.
<H4><A name="1.7">1.7</A>) ?</H4> <H3><A name="1.7">1.7</A>) ?</H3>
<P> PostgreSQL - 8.0.1</P> <P> PostgreSQL - 8.0.2</P>
<P> 10-12 .</P> <P> ,
.</P>
<H4><A name="1.8">1.8</A>) ?</H4> <H3><A name="1.8">1.8</A>) ?</H3>
<P>PostgreSQL , , <P>PostgreSQL , ,
man man
...@@ -264,11 +255,13 @@ ...@@ -264,11 +255,13 @@
<P> PostgreSQL <A href= <P> PostgreSQL <A href=
"http://www.PostgreSQL.org/docs/books/awbook.html">http://www.PostgreSQL.org/docs/books/awbook.html</A> "http://www.PostgreSQL.org/docs/books/awbook.html">http://www.PostgreSQL.org/docs/books/awbook.html</A>
<a href="http://www.commandprompt.com/ppbook/">http://www.commandprompt.com/ppbook/</a>. <a href="http://www.commandprompt.com/ppbook/">http://www.commandprompt.com/ppbook/</a>.
PostgreSQL, PostgreSQL, .
<a href="http://techdocs.postgresql.org/techdocs/bookreviews.php">http://techdocs.postgresql.org/techdocs/bookreviews.php</a>. (Korry Douglas).
, <a href="http://techdocs.postgresql.org">http://techdocs.PostgreSQL.org/</a>
PostgreSQL.</p> <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>
<P> <I>psql</I> \d <P> <I>psql</I> \d
, , , .. - , , , .. -
...@@ -276,56 +269,41 @@ ...@@ -276,56 +269,41 @@
<P> .</P> <P> .</P>
<H4><A name="1.9">1.9</A>) <H3><A name="1.9">1.9</A>)
?</H4> ?</H3>
<P>PostgreSQL <SMALL>SQL</SMALL>-92. <P>PostgreSQL <SMALL>SQL</SMALL>-92.
<A href="http://www.postgresql.org/docs/faqs.TODO.html">TODO</A> <A href="http://www.postgresql.org/docs/faqs.TODO.html">TODO</A>
, ,
.</P> .</P>
<H4><A name="1.10">1.10</A>) <SMALL>SQL</SMALL>?</H4> <H3><A name="1.10">1.10</A>) <SMALL>SQL</SMALL>?</H3>
<P> PostgreSQL <A href=
"http://www.PostgreSQL.org/docs/books/awbook.html">http://www.PostgreSQL.org/docs/books/awbook.html</A>
<SMALL>SQL</SMALL>. PostgreSQL
<A href="http://www.commandprompt.com/ppbook/">
http://www.commandprompt.com/ppbook.</A>
<A href=
"http://www.intermedia.net/support/sql/sqltut.shtm">http://www.intermedia.net/support/sql/sqltut.shtm,</A>
<A href=
"http://ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM">
http://ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM,</A>
<A href=
"http://sqlcourse.com/">http://sqlcourse.com.</A></P>
<P> - "Teach Yourself SQL in 21 Days, Second Edition" <P>-, PostgreSQL,
( SQL 21 , ) . - "Teach Yourself SQL in 21 Days,
<A href= Second Edition" ( SQL 21 , )
"http://members.tripod.com/er4ebus/sql/index.htm">http://members.tripod.com/er4ebus/sql/index.htm</A></P> <A href="http://members.tripod.com/er4ebus/sql/index.htm">
http://members.tripod.com/er4ebus/sql/index.htm</A>.
<P>
<I>The Practical SQL Handbook</I>, <I>The Practical SQL Handbook</I>,
Bowman, Judith S., et al., Addison-Wesley. <I>The Bowman, Judith S., et al., Addison-Wesley. <I>The
Complete Reference SQL</I>, Groff et al., McGraw-Hill.</P> Complete Reference SQL</I>, Groff et al., McGraw-Hill.</P>
<H4><A name="1.11">1.11</A>) ?</H4> <A href=
"http://www.intermedia.net/support/sql/sqltut.shtm">http://www.intermedia.net/support/sql/sqltut.shtm,</A>
<A href="http://ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM">
http://ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM,</A>
<A href="http://sqlcourse.com/">http://sqlcourse.com.</A></P>
<P> , <H3><A name="1.11">1.11</A>) ?</H3>
FAQ PostgreSQL
. , <I>pgsql-hackers</I>
<I>pgsql-patches</I>. , (patches)
pgsql-patches.</P>
<P> , <P> <a href="http://www.postgresql.org/docs/faqs.FAQ_DEV.html">
<SMALL>CVS</SMALL> PostgreSQL. FAQ </A>.</P>
,
, , ,
.</P>
<H4><A name="1.12">1.12</A>) PostgreSQL
<SMALL></SMALL>?</H4> <H3><A name="1.12">1.12</A>) PostgreSQL
<SMALL></SMALL>?</H3>
<P> <P>
: :
...@@ -348,14 +326,8 @@ ...@@ -348,14 +326,8 @@
<DD> PostgreSQL <DD> PostgreSQL
. - , . - ,
- . MySQL - . +/-10%
, , , .
/ . MySQL
SELECT , .
, MySQL -
, <I></I>.
,
. <BR>
<BR> <BR>
</DD> </DD>
...@@ -396,10 +368,25 @@ ...@@ -396,10 +368,25 @@
</DD> </DD>
</DL> </DL>
<H3><A name="1.13">1.13</A>) PostgreSQL?</H3>
<P> - ,
, --- .
, CVS,
,
.
,
. ӣ --
. (
PostgreSQL
<a href="http://www.postgresql.org/docs/faqs.FAQ_DEV.html">
FAQ </A>.)</P>
<H2 align="center"> </H2> <HR>
<H4><A name="2.1">2.1</A>) PostgreSQL?</H4> <H3 align="center"> </H3>
<H3><A name="2.1">2.1</A>) PostgreSQL?</H3>
<P> PostgreSQL <small>C</small> <P> PostgreSQL <small>C</small>
(embedded) <small>C</small> . (embedded) <small>C</small> .
...@@ -414,8 +401,8 @@ ...@@ -414,8 +401,8 @@
<i>Drivers/Interfaces</I>, .</P> <i>Drivers/Interfaces</I>, .</P>
<H4><A name="2.2">2.2</A>) <H3><A name="2.2">2.2</A>)
PostgreSQL Web?</H4> PostgreSQL Web?</H3>
<P> Web : <P> Web :
<A href="http://www.webreview.com">http://www.webreview.com</A></P> <A href="http://www.webreview.com">http://www.webreview.com</A></P>
...@@ -423,33 +410,26 @@ ...@@ -423,33 +410,26 @@
<P> Web, PHP <A href="http://www.php.net"> <P> Web, PHP <A href="http://www.php.net">
http://www.php.net</A> .</P> http://www.php.net</A> .</P>
<P> , Perl CGI.pm mod_perl.</P> <P> , Perl DBD::Pg CGI.pm
mod_perl.</P>
<H4><A name="2.3">2.3</A>) PostgreSQL
?</H4> <H3><A name="2.3">2.3</A>) PostgreSQL
?</H3>
<P>, PostgreSQL.
PgAdmin III (<A href="http://www.pgadmin.org/">http://www.pgadmin.org</A>), <P>, <a href="http://techdocs.postgresql.org/guides/GUITools">
PgAccess (<A href="http://www.pgaccess.org/">http://www.pgaccess.org</A>), http://techdocs.postgresql.org/guides/GUITools</A>.</P>
RHDB Admin (<A href="http://sources.redhat.com/rhdb/">http://sources.redhat.com/rhdb/</A>),
TORA (<A href="http://www.globecom.net/tora/">http://www.globecom.net/tora/</A>
)
Rekall (<A href="http://www.rekallrevealed.org/">
http://www.rekallrevealed.org/</A>).
PhpPgAdmin (<A href="http://phppgadmin.sourceforge.net/">
http://phppgadmin.sourceforge.net/</A>) - PostgreSQL,
Web.</P>
<HR> <HR>
<H2 align="center"> </H2> <H2 align="center"> </H2>
<H4><A name="3.1">3.1</A>) PostgreSQL <H3><A name="3.1">3.1</A>) PostgreSQL
<I>/usr/local/pgsql</I>?</H4> <I>/usr/local/pgsql</I>?</H3>
<P> <I>--prefix</I> <I>configure</I>.</P> <P> <I>--prefix</I> <I>configure</I>.</P>
<H4><A name="3.2">3.2</A>) <H3><A name="3.2">3.2</A>)
?</H4> ?</H3>
<P> , PostgreSQL <P> , PostgreSQL
Unix TCP/IP . , Unix TCP/IP . ,
...@@ -458,8 +438,8 @@ ...@@ -458,8 +438,8 @@
host- <I>$PGDATA/pg_hba.conf</I> host- <I>$PGDATA/pg_hba.conf</I>
.</P> .</P>
<H4><A name="3.3">3.3</A>) <H3><A name="3.3">3.3</A>)
?</H4> ?</H3>
<P> , <P> ,
:</P> :</P>
...@@ -510,55 +490,17 @@ ...@@ -510,55 +490,17 @@
</DD> </DD>
</DL> </DL>
<H4><A name="3.4">3.4</A>) <H3><A name="3.4">3.4</A>)
?</H4> ?</H3>
<P> , <P> ,
<code>log_*</code>, <code>log_*</code>,
, ,
.</P> .</P>
<P><B>
- <H3><A name="3.5">3.5</A>) <I>"Sorry, too
.</B></P> many clients"</I> ?</H3>
<P> ,
. -, <I>configure</I>
--enable-cassert, <I>assert()</I>
backend
- .</P>
<P> <I>postmaster</I> ,
<I>postgres</I> backend
<SMALL>SQL</SMALL> . <B></B>
. , ,
, .
, ,
, . backend
<I>postmaster</I>,
/backend .</P>
<P> <I>postmaster</I> , <I>psql</I>
, <SMALL>PID</SMALL> <I>postgres</I>,
<I>psql</I>, <CODE>SELECT pg_backend_pid()</CODE>.
<I>postgres</I> <SMALL>PID</SMALL>.
<I>psql</I>.
<I>postgres</I>,
PGOPTIONS="-W n", <I>psql</I>.
<I>n</I> ,
,
.</P>
<P> PostgreSQL
, .
backend'
<I>pgsql/data/base/dbname</I>.
. Linux
<I>-DLINUX_PROFILE</I>.</P>
<H4><A name="3.5">3.5</A>) <I>"Sorry, too
many clients"</I> ?</H4>
<P> 100 <P> 100
. .
...@@ -567,11 +509,11 @@ ...@@ -567,11 +509,11 @@
<I>postmaster</I>.</P> <I>postmaster</I>.</P>
<H4><A name="3.6">3.6</A>) dump restore <H3><A name="3.6">3.6</A>) dump restore
PostgreSQL?</H4> PostgreSQL?</H3>
<P> PostgreSQL <P> PostgreSQL
. 7.4 7.4.1 . 7.4.0 7.4.1
dump restore. dump restore.
(.. , 7.3 7.4) (.. , 7.3 7.4)
. .
...@@ -585,8 +527,10 @@ ...@@ -585,8 +527,10 @@
dump/restore. dump/restore.
<i>pg_upgrade</i> .</P> <i>pg_upgrade</i> .</P>
<H4><A name="3.7">3.7</A>) ""
?</H4> <H3><A name="3.7">3.7</A>) ""
?</H3>
<P> "" <P> ""
, , "" , , ""
. . ECC, SCSI . . ECC, SCSI
...@@ -600,26 +544,27 @@ ...@@ -600,26 +544,27 @@
<H2 align="center"> </H2> <H2 align="center"> </H2>
<H4><A name="4.1">4.1</A>) <SMALL>SELECT</SMALL> <H3><A name="4.1">4.1</A>) <SMALL>SELECT</SMALL>
? ?</H4> ? ?</H3>
<P> , <P> ,
<SMALL>SELECT</SMALL> <SMALL>LIMIT</SMALL>. <SMALL>SELECT</SMALL> <SMALL>LIMIT</SMALL>.</P>
- , <SMALL>ORDER BY</SMALL>, - , <SMALL>ORDER BY</SMALL>,
, . , .
<SMALL>SELECT</SMALL>, <SMALL>SELECT</SMALL>,
<SMALL>FETCH</SMALL>.</P> <SMALL>FETCH</SMALL>.</P>
<p>To <small>SELECT</small> a random row, use:</p> <P>To <small>SELECT</small> a random row, use:</P>
<pre> SELECT col <PRE> SELECT col
FROM tab FROM tab
ORDER BY random() ORDER BY random()
LIMIT 1; LIMIT 1;
</pre> </PRE>
<H4><A name="4.2">4.2</A>) , ,
<H3><A name="4.2">4.2</A>) , ,
? , ? ,
<I>psql</I> ?</H4> <I>psql</I> ?</H3>
<P> <I>psql</I>, \dt. <P> <I>psql</I>, \dt.
<I>psql</I> , \?. <I>psql</I> , \?.
...@@ -642,7 +587,7 @@ ...@@ -642,7 +587,7 @@
.</P> .</P>
<H4><A name="4.3">4.3</A>) ?</H4> <H3><A name="4.3">4.3</A>) ?</H3>
<P> 8.0 , <P> 8.0 ,
<SMALL>ALTER TABLE ALTER COLUMN TYPE</SMALL>.</P> <SMALL>ALTER TABLE ALTER COLUMN TYPE</SMALL>.</P>
...@@ -656,13 +601,12 @@ ...@@ -656,13 +601,12 @@
COMMIT; COMMIT;
</PRE> </PRE>
<H4><A name="4.4">4.4</A>) , <H3><A name="4.4">4.4</A>) ,
?</H4> ?</H3>
<P> :</P> <P> :</P>
<BLOCKQUOTE> <BLOCKQUOTE>
<TABLE> <TABLE>
<TBODY>
<TR> <TR>
<TD> ?</TD> <TD> ?</TD>
<TD> ( 32 TB)</TD> <TD> ( 32 TB)</TD>
...@@ -691,7 +635,6 @@ ...@@ -691,7 +635,6 @@
<TD> ?</TD> <TD> ?</TD>
<TD></TD> <TD></TD>
</TR> </TR>
</TBODY>
</TABLE> </TABLE>
</BLOCKQUOTE> </BLOCKQUOTE>
<BR> <BR>
...@@ -709,8 +652,8 @@ ...@@ -709,8 +652,8 @@
, ,
32k.</P> 32k.</P>
<H4><A name="4.5">4.5</A>) <H3><A name="4.5">4.5</A>)
?</H4> ?</H3>
<P> PostgreSQL 5 <P> PostgreSQL 5
.</P> .</P>
...@@ -747,10 +690,10 @@ ...@@ -747,10 +690,10 @@
. .
</P> </P>
<H4><A name="4.6">4.6</A>) ? <H3><A name="4.6">4.6</A>) ?
?</H4> ?</H3>
<P> . <P> .
. , . ,
...@@ -774,17 +717,18 @@ ...@@ -774,17 +717,18 @@
, ,
. MAX() MIN() . MAX() MIN()
, ,
<SMALL>ORDER BY</SMALL> <SMALL>LIMIT</SMALL>:</P> <SMALL>ORDER BY</SMALL> <SMALL>LIMIT</SMALL>:
<pre> <PRE>
SELECT col SELECT col
FROM tab FROM tab
ORDER BY col [ DESC ] ORDER BY col [ DESC ]
LIMIT 1; LIMIT 1;
</pre> </PRE>
<P> , <P> ,
, <CODE>SET enable_seqscan TO 'off'</CODE> , <CODE>SET enable_seqscan TO 'off'</CODE>
, , - . , ,
.
</P> </P>
<P> , <SMALL>LIKE</SMALL> <P> , <SMALL>LIKE</SMALL>
...@@ -810,15 +754,15 @@ ...@@ -810,15 +754,15 @@
. .
int2, int8 numeric .</P> int2, int8 numeric .</P>
<H4><A name="4.7">4.7</A>) , <H3><A name="4.7">4.7</A>) ,
?</H4> ?</H3>
<P> <SMALL>EXPLAIN</SMALL>.</P> <P> <SMALL>EXPLAIN</SMALL>.</P>
<H4><A name="4.8">4.8</A>) <H3><A name="4.8">4.8</A>)
? ?
?</H4> ?</H3>
<P> <I>~</I> , <P> <I>~</I> ,
<I>~*</I> <I>~*</I>
...@@ -832,23 +776,40 @@ ...@@ -832,23 +776,40 @@
WHERE lower(col) = 'abc'; WHERE lower(col) = 'abc';
</PRE> </PRE>
<P> . , . ,
, :</P> , :
<PRE> <PRE>
CREATE INDEX tabindex ON tab (lower(col)); CREATE INDEX tabindex ON tab (lower(col));
</PRE> </PRE>
<H4><A name="4.9">4.9</A>) , <H3><A name="4.9">4.9</A>) ,
<SMALL>NULL</SMALL> - ?</H4> <SMALL>NULL</SMALL> - ?
<SMALL>NULL</SMALL> ?</H3>
<P> <SMALL>IS NULL</SMALL> <P> <SMALL>IS NULL</SMALL>
<SMALL>IS NOT NULL</SMALL>.</P> <SMALL>IS NOT NULL</SMALL>, :</P>
<PRE>
SELECT *
FROM tab
WHERE col IS NULL;
</PRE>
<P> <NULL>
<SMALL>IS NULL</SMALL> <SMALL>IS NOT NULL</SMALL>
<SMALL>ORDER BY</SMALL>.
<I></I>, ,
<I></I>, NULL :</P>
<H4><A name="4.10">4.10</A>) <PRE>
?</H4> SELECT *
FROM tab
ORDER BY (col IS NOT NULL);
</PRE>
<H3><A name="4.10">4.10</A>)
?</H3>
<BLOCKQUOTE> <BLOCKQUOTE>
<TABLE> <TABLE>
<TBODY>
<TR> <TR>
<TH></TH> <TH></TH>
<TH> </TH> <TH> </TH>
...@@ -879,7 +840,6 @@ ...@@ -879,7 +840,6 @@
<TD>char</TD> <TD>char</TD>
<TD> </TD> <TD> </TD>
</TR> </TR>
</TBODY>
</TABLE> </TABLE>
</BLOCKQUOTE> </BLOCKQUOTE>
...@@ -889,8 +849,7 @@ ...@@ -889,8 +849,7 @@
<P> "varlena" (.., <P> "varlena" (..,
, ). , ).
, , , ,
. , . , ,
<SMALL>TOAST</SMALL>,
, ,
.</P> .</P>
...@@ -906,8 +865,8 @@ ...@@ -906,8 +865,8 @@
<SMALL>NULL</SMALL> . <SMALL>NULL</SMALL> .
, .</P> , .</P>
<H4><A name="4.11.1">4.11.1</A>) <H3><A name="4.11.1">4.11.1</A>)
serial/--?</H4> serial/--?</H3>
<P>PostgreSQL <SMALL>SERIAL</SMALL>. <P>PostgreSQL <SMALL>SERIAL</SMALL>.
. :</P> . :</P>
...@@ -918,7 +877,7 @@ ...@@ -918,7 +877,7 @@
); );
</PRE> </PRE>
<P> : </P> :
<PRE> <PRE>
CREATE SEQUENCE person_id_seq; CREATE SEQUENCE person_id_seq;
CREATE TABLE person ( CREATE TABLE person (
...@@ -930,8 +889,8 @@ ...@@ -930,8 +889,8 @@
<I>create_sequence</I>. <I>create_sequence</I>.
<H4><A name="4.11.2">4.11.2</A>) <H3><A name="4.11.2">4.11.2</A>)
<SMALL>SERIAL</SMALL>?</H4> <SMALL>SERIAL</SMALL>?</H3>
<P> <P>
<SMALL>SERIAL</SMALL> sequence <SMALL>SERIAL</SMALL> sequence
...@@ -960,16 +919,16 @@ ...@@ -960,16 +919,16 @@
</PRE> </PRE>
<H4><A name="4.11.3">4.11.3</A>) , <H3><A name="4.11.3">4.11.3</A>) ,
<I>currval()</I> <I>nextval()</I> <I>currval()</I> <I>nextval()</I>
?</H4> ?</H3>
<P>. <i>currval()</i> , <P>. <i>currval()</i> ,
, .</P> , .</P>
<H4><A name="4.11.4">4.11.4</A>) <H3><A name="4.11.4">4.11.4</A>)
? ?
, /SERIAL?</H4> , /SERIAL?</H3>
<P> , , <P> , ,
...@@ -977,8 +936,8 @@ ...@@ -977,8 +936,8 @@
.</P> .</P>
<H4><A name="4.12">4.12</A>) <SMALL>OID</SMALL>? <H3><A name="4.12">4.12</A>) <SMALL>OID</SMALL>?
<SMALL>TID</SMALL>?</H4> <SMALL>CTID</SMALL>?</H3>
<P>, PostgreSQL , <P>, PostgreSQL ,
<SMALL>OID</SMALL> <SMALL>OID</SMALL>
...@@ -993,17 +952,17 @@ ...@@ -993,17 +952,17 @@
O<SMALL>ID</SMALL>, <SMALL>SERIAL</SMALL> O<SMALL>ID</SMALL>, <SMALL>SERIAL</SMALL>
. 8- . 8-
<SMALL>SERIAL8</SMALL>.</P> <SMALL>SERIAL8</SMALL>.
<P>T<SMALL>ID</SMALL> <P>C<SMALL>TID</SMALL>
offset . T<SMALL>ID</SMALL> offset . C<SMALL>TID</SMALL>
. .
T<SMALL>ID</SMALL> <P>T<SMALL>ID</SMALL>
.</P> .</P>
<H4><A name="4.13">4.13</A>) <I>"ERROR: Memory <H3><A name="4.13">4.13</A>) <I>"ERROR: Memory
exhausted in AllocSetAlloc()"</I>?</H4> exhausted in AllocSetAlloc()"</I>?</H3>
<P> <P>
. .
...@@ -1022,38 +981,21 @@ ...@@ -1022,38 +981,21 @@
, backend , , backend ,
. .
<H4><A name="4.14">4.14</A>) , PostgreSQL <H3><A name="4.14">4.14</A>) , PostgreSQL
?</H4> ?</H3>
<P> <I>psql</I>, <CODE>SELECT version();</CODE></P> <P> <I>psql</I>, <CODE>SELECT version();</CODE></P>
<H4><A name="4.15">4.15</A>)
<I>"invalid large obj descriptor"</I>?</H4>
<P>
<CODE>BEGIN WORK</CODE> <CODE>COMMIT</CODE>,
<CODE>lo_open</CODE> ... <CODE>lo_close.</CODE></P>
<P> PostgreSQL , <H3><A name="4.15">4.15</A>)
. , ?</H3>
- ,
<I>invalid large obj descriptor</I>,
(
)
.</P>
<P> <SMALL>ODBC</SMALL>,
<CODE>auto-commit off.</CODE></P>
<H4><A name="4.16">4.16</A>)
?</H4>
<P> <I>CURRENT_TIMESTAMP</I>:</P> <P> <I>CURRENT_TIMESTAMP</I>:</P>
<PRE> <PRE>
CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
</PRE> </PRE>
<H4><A name="4.17">4.17</A>) ?</H4> <H3><A name="4.16">4.16</A>) ?</H3>
<P>PostgreSQL , <P>PostgreSQL ,
SQL. :</P> SQL. :</P>
...@@ -1077,8 +1019,8 @@ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); ...@@ -1077,8 +1019,8 @@ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
<SMALL>RIGHT</SMALL> <SMALL>FULL</SMALL> . <SMALL>RIGHT</SMALL> <SMALL>FULL</SMALL> .
<SMALL>INNER</SMALL> .</P> <SMALL>INNER</SMALL> .</P>
<H4><A name="4.18">4.18</A>) , <H3><A name="4.17">4.17</A>) ,
?</H4> ?</H3>
<P> . <P> .
PostgreSQL PostgreSQL
...@@ -1089,14 +1031,16 @@ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); ...@@ -1089,14 +1031,16 @@ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
.</P> .</P>
<H4><A name="4.19">4.19</A>) ?</H4> <H3><A name="4.18">4.18</A>) ?</H3>
<P> , , <P> , ,
<A href="http://techdocs.postgresql.org/guides/SetReturningFunctions"> <A href="http://techdocs.postgresql.org/guides/SetReturningFunctions">
http://techdocs.postgresql.org/guides/SetReturningFunctions</A>.</P> http://techdocs.postgresql.org/guides/SetReturningFunctions</A>.</P>
<H4><A name="4.20">4.20</A>) "missing oid",
PL/PgSQL?</H4> <H3><A name="4.19">4.19</A>) "relation with OID ####
", PL/PgSQL?</H3>
<P>PL/PgSQL <P>PL/PgSQL
, PL/PgSQL , PL/PgSQL
, ,
...@@ -1106,53 +1050,26 @@ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); ...@@ -1106,53 +1050,26 @@ CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
PL/PgSQL. PL/PgSQL.
.</P> .</P>
<h4><a name="4.21">4.21</a>) ?
</h4>
<ul>
<li><i>contrib/pgcrypto</i>
<small>SQL</small> .</li>
<li> ,
<i>postgresql.conf</i>, <i>ssl</i>
<i>true</i>, <i>pg_hba.conf</i>
<i>host</i> <i>hostssl</i> <i>sslmode</i>
ݣ <i>disable</i>. (,
,
stunnel ssh, SSL PostgreSQL).</li>
<li> ,
.</li>
<li> , .</li>
</ul>
<HR>
<H2 align="center"> PostgreSQL</H2>
<H4><A name="5.1">5.1</A>) .
<I>psql</I>, core dump?</H4>
<P> .
.</P>
<H4><A name="5.2">5.2</A>)
PostgreSQL?</H4>
<P> <I>pgsql-hackers</I> <H3><A name="4.20">4.20</a>) ?</H3>
<I>contrib/</I>.</P>
<H4><A name="5.3">5.3</A>) C , <P> "" -- ,
?</H4> .</P>
<P> PostgreSQL, 7.3, , <P> Master/slave (master)
C, PL/PgSQL SQL. /, Σ
. , (slave)
C, <i>contrib/tablefunc</i>.</P> /<SMALL>SELECT</SMALL>.
master-slave PostgreSQL
<H4><A name="5.4">5.4</A>) . <A href="http://gborg.postgresql.org/project/slony1/projdisplay.php">
?</H4> Slony-I</A>.</P>
<P> <I>Makefile</I> include <P> Multi-master /
. <I>make clean</I> <I>make</I>. , .
<SMALL>GCC</SMALL> ,
<I>--enable-depend</I> <I>configure</I> .
.</P> PostgreSQL
<A href="http://pgfoundry.org/projects/pgcluster/">Pgcluster</A>.
</BODY> </BODY>
</HTML> </HTML>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment