2003-07-31 04:41:56 +00:00
|
|
|
|
|
|
|
|
|
PostgreSQL i<>in S<>k<EFBFBD>a Sorulan Sorular (SSS)
|
|
|
|
|
|
|
|
|
|
Son g<>ncelleme : 26 Temmuz 2003 Cumartesi - 18:32:11
|
|
|
|
|
|
|
|
|
|
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us
|
|
|
|
|
<mailto:pgman@candle.pha.pa.us>)
|
|
|
|
|
|
|
|
|
|
<EFBFBD>evirenler : Devrim G<>nd<6E>z (devrim@gunduz.org <mailto:devrim@gunduz.org>)
|
|
|
|
|
Nicholas Morris Tufar (ntufar@yahoo.com <mailto:ntufar@yahoo.com>)
|
|
|
|
|
Volkan Yaz<61>c<EFBFBD> (volkany@celiknet.com <mailto:volkany@celiknet.com>)
|
|
|
|
|
|
|
|
|
|
Bu belgenin en g<>ncel hali,
|
|
|
|
|
http://www.PostgreSQL.org/docs/faqs/FAQ_turkish.html
|
|
|
|
|
<http://www.postgresql.org/docs/faqs/FAQ_turkish.html> ve
|
|
|
|
|
http://www.gunduz.org/seminer/pg/FAQ_turkish adreslerinde g<>r<EFBFBD>lebilir.
|
|
|
|
|
|
|
|
|
|
Platforma <20>zel sorular<61>n<EFBFBD>z, http://www.PostgreSQL.org/docs/index.html
|
|
|
|
|
<http://www.postgresql.org/docs/index.html> adresinde yan<61>tlan<61>r.
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Genel Sorular
|
|
|
|
|
|
|
|
|
|
1.1 <#1.1>) PostgreSQL nedir? Nas<61>l okunur?
|
|
|
|
|
1.2 <#1.2>) PostgreSQL' in haklar<61> nedir?
|
|
|
|
|
1.3 <#1.3>) PostgreSQL, hangi Unix platformlar<61>nda <20>al<61>s<EFBFBD>r?
|
|
|
|
|
1.4 <#1.4>) Hangi Unix olmayan uyarlamalar<61> bulunmaktad<61>r?
|
|
|
|
|
1.5 <#1.5>) PostgreSQL'i nereden indirebilirim?
|
|
|
|
|
1.6 <#1.6>) Deste<74>i nereden alabilirim?
|
|
|
|
|
1.7 <#1.7>) En son s<>r<EFBFBD>m<EFBFBD> nedir?
|
|
|
|
|
1.8 <#1.8>) Hangi belgelere ula<6C>abilirim?
|
|
|
|
|
1.9 <#1.9>) Bilinen hatalar ya da eksik <20>zelliklere nereden ulasabilirim?
|
|
|
|
|
1.10 <#1.10>) Nas<61>l SQL <20><>renebilirim?
|
|
|
|
|
1.11 <#1.11>) PostgreSQL 2000 y<>l<EFBFBD>na uyumlu mudur?
|
|
|
|
|
1.12 <#1.12>) Geli<6C>tirme tak<61>m<EFBFBD>na nas<61>l kat<61>labilirim??
|
|
|
|
|
1.13 <#1.13>) Bir hata raporunu nas<61>l g<>nderebilirim?
|
|
|
|
|
1.14 <#1.14>) PostgreSQL, di<64>er VTYS(DBMS) lerle nas<61>l kar<61><72>la<6C>t<EFBFBD>r<EFBFBD>labilir?
|
|
|
|
|
1.15 <#1.15>) PostgreSQL'e maddi a<><61>dan nas<61>l destek olabilirim?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Kullan<61>c<EFBFBD>/istemci Sorular<61>
|
|
|
|
|
|
|
|
|
|
2.1 <#2.1>) PostgreSQL i<>in ODBC s<>r<EFBFBD>c<EFBFBD>leri var m<> ?
|
|
|
|
|
2.2 <#2.2>) PostgreSQL'i web sayfalar<61>nda kullanabilmek i<>in hangi
|
|
|
|
|
ara<EFBFBD>lar bulunmaktad<61>r ?
|
|
|
|
|
2.3 <#2.3>) PostgreSQL'in grafik kullan<61>c<EFBFBD> arabirimi var m<>d<EFBFBD>r?
|
|
|
|
|
2.4 <#2.4>) PostgreSQL ile ileti<74>imi kurabilmek i<>in hangi dilleri
|
|
|
|
|
kullanabilirim?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Y<>netimsel Sorular
|
|
|
|
|
|
|
|
|
|
3.1 <#3.1>) PostgreSQL'i //usr/local/pgsql/ dizininden ba<62>ka dizinlere
|
|
|
|
|
nas<EFBFBD>l kurabilirim??
|
|
|
|
|
3.2 <#3.2>) /Postmaster/'<27> ba<62>latt<74><74><EFBFBD>mda /Bad System Call/ ya da core
|
|
|
|
|
dumped mesaj<61> al<61>yorum. Neden?
|
|
|
|
|
3.3 <#3.3>) /Postmaster/'<27> ba<62>latt<74><74><EFBFBD>mda, /IpcMemoryCreate/ hatas<61>
|
|
|
|
|
al<EFBFBD>yorum. Neden?
|
|
|
|
|
3.4 <#3.4>) /Postmaster/, ba<62>latt<74><74><EFBFBD>mda, /IpcSemaphoreCreate hatas<61>/
|
|
|
|
|
al<EFBFBD>yorum. Neden?
|
|
|
|
|
3.5 <#3.5>) Di<44>er bilgisayarlar<61>n benim PostgreSQL veritaban<61> sunucuma
|
|
|
|
|
ba<EFBFBD>lant<EFBFBD>lar<EFBFBD>n<EFBFBD> nas<61>l kontrol edebilirim?
|
|
|
|
|
3.6 <#3.6>) Veritaban<61> motorunu daha iyi ba<62>ar<61>m icin nas<61>l ayarlayabilirim?
|
|
|
|
|
3.7 <#3.7>) Hangi hata ay<61>klama <20>zellikleri bulunmaktad<61>r?
|
|
|
|
|
3.8 <#3.8>) Ba<42>lanmaya <20>al<61><6C><EFBFBD>rken, neden "/Sorry, too many clients/"
|
|
|
|
|
hatas<EFBFBD>n<EFBFBD> al<61>yorum?
|
|
|
|
|
3.9 <#3.9>) /pgsql_tmp/dizinin i<>indeki dosyalar nelerdir?
|
|
|
|
|
3.10 <#3.10>) PostgreSQL s<>r<EFBFBD>mlerini y<>kselmek i<>in neden bir
|
|
|
|
|
dump/reload i<>lemi ger<65>ekle<6C>tirmek zorunday<61>m?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<20><>letimsel Sorular
|
|
|
|
|
|
|
|
|
|
4.1 <#4.1>) Binary cursor ve normal cursor aras<61>ndaki fark ned<65>r?
|
|
|
|
|
4.2 <#4.2>)Sorgunun sadece ilk birka<6B> sat<61>r<EFBFBD>n<EFBFBD> nas<61>l SELECT edebilirim?
|
|
|
|
|
4.3 <#4.3>) /psql/'in i<>inde g<>rd<72>g<EFBFBD>m tablolarin ya da di<64>er <20>eylerin
|
|
|
|
|
listesini nas<61>l alabilirim?
|
|
|
|
|
4.4 <#4.4>)Bir tablodan bir kolonu nas<61>l kald<6C>rabilirim?
|
|
|
|
|
4.5 <#4.5>)Bir sat<61>r, tablo ve veritaban<61> icin en fazla b<>y<EFBFBD>kl<6B>k nedir?
|
|
|
|
|
4.6 <#4.6>) Tipik bir metin dosyas<61>ndaki veriyi saklamak i<>in ne kadar
|
|
|
|
|
disk alan<61> gereklidir?
|
|
|
|
|
4.7 <#4.7>) Veritaban<61>nda hangi tablo ya da indexlerin tan<61>mland<6E>g<EFBFBD>n<EFBFBD>
|
|
|
|
|
nasil g<>rebilirim?
|
|
|
|
|
4.8 <#4.8>) Sorgular<61>m cok yavas, ya da indexlerimi kullanmiyorlar. Neden?
|
|
|
|
|
4.9 <#4.9>) Query-optimizer in sorgular<61>m<EFBFBD> nas<61>l de<64>erlendirdigini,
|
|
|
|
|
i<EFBFBD>leme soktu<74>unu nas<61>l g<>rebilirim?
|
|
|
|
|
4.10 <#4.10>) R-tree index nedir?
|
|
|
|
|
4.11 <#4.11>) Genetic Query Optimizer nedir?
|
|
|
|
|
4.12 <#4.12>) D<>zenli ifade (Regular Expression) aramalar<61>n<EFBFBD> ve
|
|
|
|
|
b<EFBFBD>y<EFBFBD>k/k<><6B><EFBFBD>k harfe duyars<72>z aramalar<61> nasil yapabilirim? Bu b<>y<EFBFBD>k(k<><6B><EFBFBD>k
|
|
|
|
|
harfe duyarl<72> aramalar i<>in indeksi nasil kullanabilirim?
|
|
|
|
|
4.13 <#4.13>) Bir sorguda, bir alan<61>n NULL oldu<64>unu nas<61>l ortaya
|
|
|
|
|
<EFBFBD><EFBFBD>karabilirim?
|
|
|
|
|
4.14 <#4.14>) <20>esitli karakter tipleri aras<61>ndaki farklar nelerdir?
|
|
|
|
|
4.15.1 <#4.15.1>) Nas<61>l serial/otomatik artan(auto-incrementing) bir
|
|
|
|
|
alan yaratabilirim?
|
|
|
|
|
4.15.2 <#4.15.2>) Serial giri<72>inin de<64>erini nas<61>l alabilirim?
|
|
|
|
|
4.15.3 <#4.15.3>) /currval()/ ve /nextval()/ di<64>er kullan<61>c<EFBFBD>lara sorun
|
|
|
|
|
yaratmaz m<>?>
|
|
|
|
|
4.15.4 <#4.15.4>) Neden sequence say<61>lar<61>n transaction i<>leminin
|
|
|
|
|
iptalinden sonra yeniden kullan<61>l<EFBFBD>yor? Neden sequence/SERIAL kolonumdaki
|
|
|
|
|
say<EFBFBD>larda atlamalar oluyor?
|
|
|
|
|
4.16 <#4.16>) OID nedir? TID nedir?
|
|
|
|
|
4.17 <#4.17>) PostgreSQL' de kullan<61>lan baz<61> terimlerin anlamlar<61> nelerdi?
|
|
|
|
|
4.18 <#4.18>) Neden /"ERROR: Memory exhausted in AllocSetAlloc()"/
|
|
|
|
|
hatas<EFBFBD>n<EFBFBD> al<61>yorum?
|
|
|
|
|
4.19 <#4.19>) Hangi PostgreSQL s<>r<EFBFBD>m<EFBFBD>n<EFBFBD> <20>al<61>st<73>rd<72><64><EFBFBD>m<EFBFBD> nas<61>l g<>rebilirim??
|
|
|
|
|
4.20 <#4.20>) Neden large-object i<>lemlerim, /"invalid large obj
|
|
|
|
|
descriptor"/ hatas<61>n<EFBFBD> veriyor?
|
|
|
|
|
4.21 <#4.21>) <20>u andaki zaman<61> <20>ntan<61>ml<6D> de<64>er olarak kabul eden kolonu
|
|
|
|
|
nas<EFBFBD>l yarat<61>r<EFBFBD>m?
|
|
|
|
|
4.22 <#4.22>) Neden |IN| kullanan subquerylerim <20>ok yava<76>?
|
|
|
|
|
4.23 <#4.23>) Outer join i<>lemini nas<61>l yapabilirim?
|
|
|
|
|
4.24 <#4.24>) Ayn<79> anda birden fazla veritaban<61>nda nas<61>l i<>lem yapabilirim?
|
|
|
|
|
4.25 <#4.25>) Bir fonksiyondan nas<61>l <20>oklu sat<61>r ya da kolon
|
|
|
|
|
d<EFBFBD>nd<EFBFBD>rebilirim??
|
|
|
|
|
4.26 <#4.26>) Neden Pl/PgSQL fonksiyonlar<61> i<>inden g<>venli bir <20>ekilde
|
|
|
|
|
tablo yaratma/kald<6C>rma i<>lemlerini yapam<61>yoruz?
|
|
|
|
|
4.27 <#4.27>) Hangi replikasyon se<73>enekleri bulunmaktad<61>r?
|
|
|
|
|
4.28"D <#4.28>) Hangi <20>ifreleme se<73>enekleri bulunmaktad<61>r?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PostgreSQL <20>zelliklerini Geni<6E>letmek
|
|
|
|
|
|
|
|
|
|
5.1 <#5.1>) Kullan<61>c<EFBFBD>-tan<61>ml<6D> bir fonksiyon yazd<7A>m. /psql/'de
|
|
|
|
|
<EFBFBD>al<EFBFBD><EFBFBD>t<EFBFBD>rd<EFBFBD><EFBFBD><EFBFBD>m zaman neden core dump ediyor?
|
|
|
|
|
5.2 <#5.2>) PostgreSQL'e nas<61>l yeni veri tipleri/fonksiyonlar ekleyebilirim?
|
|
|
|
|
5.3 <#5.3>) Bir tuple d<>nd<6E>rmek i<>in bir C fonksiyonunu nas<61>l yazar<61>m?
|
|
|
|
|
5.4 <#5.4>) Bir kaynak dosyas<61>nda de<64>isiklik yapt<70>m. Yeniden derlememe
|
|
|
|
|
ra<EFBFBD>men de<64>i<EFBFBD>iklik ge<67>erli olmuyor. Neden??
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Genel Sorular
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.1) PostgreSQL nedir? Nas<61>l okunur?
|
|
|
|
|
|
|
|
|
|
PostgreSQL, /Post-Gres-Q-L/. olarak okunur
|
|
|
|
|
|
|
|
|
|
PostgreSQL, yeni-nesil VTYS ara<72>t<EFBFBD>rma prototipi olan POSTGRES veritaban<61>
|
|
|
|
|
y<EFBFBD>netim sisteminin geli<6C>tirilmesidir. POSTGRES' in zengin veri tiplerini
|
|
|
|
|
ve g<><67>l<EFBFBD> veri modelini tutarken, SQL'in geli<6C>tirilmis alt k<>mesi olan
|
|
|
|
|
PostQuel dilini kullan<61>r. PostgreSQL <20>cretsizdir ve kaynak kodu a<><61>k
|
|
|
|
|
da<EFBFBD><EFBFBD>t<EFBFBD>l<EFBFBD>r.
|
|
|
|
|
|
|
|
|
|
PostgreSQL, PostgreSQL geli<6C>tirme listesine <20>ye olan bir Internet
|
|
|
|
|
geli<EFBFBD>tirici tak<61>m<EFBFBD> taraf<61>ndan geli<6C>tirilir. <20>u andaki koordinat<61>r, Marc
|
|
|
|
|
G. Fournier (scrappy@PostgreSQL.org <mailto:scrappy@PostgreSQL.org>).
|
|
|
|
|
(Bu tak<61>ma nas<61>l kat<61>lacag<61>n<EFBFBD>z<EFBFBD> <20><>renmek i<>in 1.6 <#1.6> numaral<61>
|
|
|
|
|
maddeyi okuyunuz.) Bu tak<61>m, t<>m PostgreSQL geli<6C>iminden sorumludur.
|
|
|
|
|
|
|
|
|
|
PostgreSQL 1.01 s<>r<EFBFBD>m<EFBFBD>n<EFBFBD>n yazarlar<61> Andrew Yu ve Jolly Chen idi.
|
|
|
|
|
Bunlar<EFBFBD>n d<><64><EFBFBD>nda bir ka<6B> kisi de uyarlama, hata ay<61>klama ve kodun
|
|
|
|
|
geli<EFBFBD>tirilmesi i<>in <20>al<61>sm<73><6D>t<EFBFBD>. PostgreSQL'in t<>redigi orijinal Postgres
|
|
|
|
|
kodu, lisans, lisans<6E>st<73> ve akademisyenler taraf<61>ndan, Professor Michael
|
|
|
|
|
Stonebraker ) University of California, Berkeley) koordinat<61>rl<72>g<EFBFBD>nde
|
|
|
|
|
yaz<EFBFBD>lm<EFBFBD>st<EFBFBD>r.
|
|
|
|
|
|
|
|
|
|
Berkley'deki yaz<61>l<EFBFBD>m<EFBFBD>n ad<61> Postgres idi. SQL uyumlulu<6C>u 1995'te
|
|
|
|
|
eklenince, ad<61> Postgres 95 oldu. 1996 y<>l<EFBFBD>n<EFBFBD>n sonlar<61>nda ad<61> PostgreSQL
|
|
|
|
|
olarak de<64>i<EFBFBD>tirildi.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2) PostgreSQL'in haklar<61> nedir?
|
|
|
|
|
|
|
|
|
|
PostgreSQL Data Base Management System
|
|
|
|
|
|
|
|
|
|
Portions copyright (c) 1996-2002, PostgreSQL Global Development Group
|
|
|
|
|
Portions Copyright (c) 1994-6 Regents of the University of California
|
|
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and distribute this software and its
|
|
|
|
|
documentation for any purpose, without fee, and without a written
|
|
|
|
|
agreement is hereby granted, provided that the above copyright notice
|
|
|
|
|
and this paragraph and the following two paragraphs appear in all copies.
|
|
|
|
|
|
|
|
|
|
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
|
|
|
|
|
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
|
|
|
|
INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
|
|
|
|
|
DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF
|
|
|
|
|
THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
|
|
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
|
|
|
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
|
|
AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
|
|
|
|
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS
|
|
|
|
|
TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
|
|
|
|
|
|
|
|
|
<EFBFBD>stteki metin klasik a<><61>k-kod lisans<6E> olan BSD lisans<6E>d<EFBFBD>r. Kaynak kodun
|
|
|
|
|
nas<EFBFBD>l kullan<61>labilece<63>ine dair s<>n<EFBFBD>rlamalar<61> yoktur. Bu lisans<6E>
|
|
|
|
|
seviyoruz. De<44>i<EFBFBD>tirme niyetimiz bulunmamaktad<61>r.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3) PostgreSQL, hangi Unix platforlar<61>nda <20>al<61>s<EFBFBD>r?
|
|
|
|
|
|
|
|
|
|
Genel olarak, modern bir Unix-uyumlu platform PostgreSQL'i
|
|
|
|
|
<EFBFBD>al<EFBFBD><EFBFBD>t<EFBFBD>racakt<EFBFBD>r. Ayr<79>nt<6E>l<EFBFBD> bilgi i<>in kurulum belgelerine bakabilirsiniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.4) Hangi Unix olmayan uyarlamalar<61> bulunmaktad<61>r?
|
|
|
|
|
|
|
|
|
|
*<2A>stemci*
|
|
|
|
|
|
|
|
|
|
libpq C k<>t<EFBFBD>phanesini, psql ve diger arabirimleri ve binary dosyalar<61>,
|
|
|
|
|
MS Windows ortamlar<61>nda <20>al<61>smas<61> i<>in derlemeniz m<>mk<6D>nd<6E>r. Bu <20>rnekte
|
|
|
|
|
istemcide MS Windows <20>al<61>s<EFBFBD>yor ve desteklenen Unix platformlar<61>ndan
|
|
|
|
|
birinde <20>al<61>san PostgreSQL sunucuna TCP/IP ile baglanmaktad<61>r. Da<44><61>t<EFBFBD>m
|
|
|
|
|
i<EFBFBD>indeki win31.mak dosyas<61> ile, Win32 libpg k<>t<EFBFBD>phanesi ve psql
|
|
|
|
|
yaratabilirsiniz. PostgreSQL ayn<79> zamanda ODBC istemcileri ile
|
|
|
|
|
haberlesebilmektedir.
|
|
|
|
|
|
|
|
|
|
*Sunucu*
|
|
|
|
|
|
|
|
|
|
Veritaban<EFBFBD> sunuucsu Cygwin kullanarak Windows NT, 2K ya da XP <20>zerinde
|
|
|
|
|
calistirilabilir. Dag<61>t<EFBFBD>m i<>indeki pgsql/doc/FAQ_MSW<53>N dosyas<61>n<EFBFBD> ya da
|
|
|
|
|
web sitemizdeki MS Windows FAQ'u inceleyebilirsiniz.
|
|
|
|
|
|
|
|
|
|
Do<EFBFBD>al Windows NT/2000/XP portu i<>in <20>u anda <20>al<61><6C>malar devam etmektedir.
|
|
|
|
|
Windows s<>r<EFBFBD>m<EFBFBD> hakk<6B>nda g<>ncel bilgi i<>in,
|
|
|
|
|
http://techdocs.postgresql.org/guides/Windows adresini ziyaret
|
|
|
|
|
edebilirsiniz.
|
|
|
|
|
|
|
|
|
|
Ayr<EFBFBD>ca, http://forge.novell.com adresinde Novell Netware 6 portu
|
|
|
|
|
bulunmaktad<EFBFBD>r.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.5) PostgreSQL'i nereden indirebilirim?
|
|
|
|
|
|
|
|
|
|
PostgreSQL i<>in ana anonim ftp sitesi ftp://ftp.PostgreSQL.org/pub' dur.
|
|
|
|
|
Yans<EFBFBD>lar i<>in, ana web sayfam<61>za bakabilirsiniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.6) Nereden destek alabilirim?
|
|
|
|
|
|
|
|
|
|
Ana e-posta listesi : pgsql-general@PostgreSQL.org. PostgreSQL
|
|
|
|
|
konusundaki tart<72>smalara a<><61>kt<6B>r. <20>ye olmak i<>in, asag<61>daki sat<61>rlar<61>
|
|
|
|
|
e-postanizin body k<>sm<73>na (konu k<>sm<73>na degil) yaz<61>p,
|
|
|
|
|
pgsql-general-request@PostgreSQL.org adresine g<>nderin:
|
|
|
|
|
|
|
|
|
|
subscribe
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Ayn<EFBFBD> zamanda, bir digest listesi bulunmaktad<61>r. Bu listeye <20>ye olmak
|
|
|
|
|
i<EFBFBD>in, pgsql-general-digest-request@PostgreSQL.org adresine, body k<>sm<73>nda
|
|
|
|
|
|
|
|
|
|
subscribe
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
yazan bir e-posta atman<61>z yeterli olacakt<6B>r.
|
|
|
|
|
|
|
|
|
|
Digest postalar, ana liste 30k civar<61>nda e-postaya ulastiginda <20>yelere
|
|
|
|
|
g<EFBFBD>nderilmektedir.
|
|
|
|
|
|
|
|
|
|
Buglar i<>in bir e-posta listesi bulunmaktad<61>r. Bu listeye <20>ye olmak
|
|
|
|
|
i<EFBFBD>in, email to pgsql-bugs-request@PostgreSQL.org adresine, body k<>sm<73>nda
|
|
|
|
|
|
|
|
|
|
subscribe
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
yazan bir e-posta atman<61>z yeterli olacakt<6B>r.
|
|
|
|
|
|
|
|
|
|
Ayn<EFBFBD> zamanda, gelistiriciler i<>in tart<72>sma listesi bulunmaktad<61>r. Bu
|
|
|
|
|
listeye <20>ye olmak i<>in, pgsql-hackers-request@PostgreSQL.org adresine,
|
|
|
|
|
body k<>sm<73>nda
|
|
|
|
|
|
|
|
|
|
subscribe
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
yazan bir e-posta atman<61>z yeterli olacakt<6B>r.
|
|
|
|
|
|
|
|
|
|
Bunun d<>s<EFBFBD>ndaki e-posta listelerine ve PostgreSQL hakk<6B>nda bilgiye,
|
|
|
|
|
PostgreSQL WWW ana sayfas<61>ndan ulasabilirsiniz:
|
|
|
|
|
|
|
|
|
|
http://www.PostgreSQL.org
|
|
|
|
|
|
|
|
|
|
Ayn<EFBFBD> zamanda, EFNet <20>zerinde, #PostgreSQL adl<64> bir <20>RC kanal<61>
|
|
|
|
|
bulunmaktad<EFBFBD>r. Bunun i<>in, irc -c '#PostgreSQL' "$USER" irc.phoenix.net
|
|
|
|
|
Unix komutunu kullanabilirsiniz.
|
|
|
|
|
|
|
|
|
|
Ticari destek veren firmalar<61>n listesine
|
|
|
|
|
|
|
|
|
|
http://www.postgresql.org/users-lounge/commercial-support.html
|
|
|
|
|
|
|
|
|
|
adresinden ulasabilirsiniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.7) En son s<>r<EFBFBD>m nedir?
|
|
|
|
|
|
|
|
|
|
PostgreSQL'in son s<>r<EFBFBD>m<EFBFBD> 7.3.3't<>r.
|
|
|
|
|
|
|
|
|
|
Her 4 ayda major release <20><>kar<61>lmas<61> planlanmaktad<61>r.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.8) Hangi belgelere ulasabilirim?
|
|
|
|
|
|
|
|
|
|
Da<EFBFBD><EFBFBD>t<EFBFBD>m<EFBFBD>n icinde, kitapciklar, kitapcik sayfalari ve bazi k<><6B><EFBFBD>k <20>rnekler
|
|
|
|
|
verilmektedir. /doc dizinine bak<61>n<EFBFBD>z. Ayrica, bu el kitap<61><70>klar<61>n<EFBFBD>
|
|
|
|
|
online olarak http://www.PostgreSQL.org/docs/ adresinden inceleyebilirsiniz.
|
|
|
|
|
|
|
|
|
|
http://www.PostgreSQL.org/docs/awbook.html ve
|
|
|
|
|
http://www.commandprompt.com/ppbook adreslerinde PostgreSQL kitaplar<61>
|
|
|
|
|
bulunmaktad<EFBFBD>r. PostgreSQL kitablar<61>n<EFBFBD>n listesine,
|
|
|
|
|
http://www.ca.PostgreSQL.org/books/ adresinden ula<6C>aiblirsiniz. Ayr<79>ca,
|
|
|
|
|
PostgreSQL konusundaki teknik makalelere de
|
|
|
|
|
http://techdocs.PostgreSQL.org/ adresinden ula<6C>abilirsiniz.
|
|
|
|
|
|
|
|
|
|
psql'in, \d ile baslayan veri tipler, operatorler, fonksiyonlar,
|
|
|
|
|
aggregateler, vb. ile ilgili g<>zel komutlar<61> vard<72>r.
|
|
|
|
|
|
|
|
|
|
Web sitemiz daha fazla belgeyi i<>ermektedir.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.9) Bilinen hatalar ya da eksik <20>zelliklere nereden ulasabilirim?
|
|
|
|
|
|
|
|
|
|
PostgreSQL SQL-92 uyumlugugu icindedir, standartlardan fazla da
|
|
|
|
|
<EFBFBD>zellikleri bulunmaktad<61>r. Bilinen hatalar, eksik <20>zellikler ve gelecek
|
|
|
|
|
ile ilgili planlar i<>in TODO listesine bak<61>n<EFBFBD>z.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.10) Nas<61>l SQL <20><>renebilirim?
|
|
|
|
|
|
|
|
|
|
http:/www.PostgreSQL.org/docs/awbook.html adresindeki kitap SQL
|
|
|
|
|
<EFBFBD>gretecektir. http://www.commandprompt.com/ppbook adresinde de bir baska
|
|
|
|
|
PostgreSQL kitab<61> bulunmaktad<61>r.
|
|
|
|
|
|
|
|
|
|
http://www.intermedia.net/support/sql/sqltut.shtm,
|
|
|
|
|
http://ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM
|
|
|
|
|
http://sqlcourse.com ve http://sqlcourse2.com adreslerinde de g<>zel
|
|
|
|
|
belgeler bulunmaktad<61>r.
|
|
|
|
|
|
|
|
|
|
Bir ba<62>kas<61> da, http://members.tripod.com/er4ebus/sql/index.htm
|
|
|
|
|
adresinde bulunan "Teach Yourself SQL in 21 Days, Second Edition" kitab<61>d<EFBFBD>r.
|
|
|
|
|
|
|
|
|
|
Baz<EFBFBD> kullan<61>c<EFBFBD>lar<61>m<EFBFBD>z da <20>u kitab<61> <20>nermektedirler: The Practical SQL
|
|
|
|
|
Handbook, Bowman, Judith S., et al.,Addison-Wesley. Others like The
|
|
|
|
|
Complete Reference SQL, Groff et al., McGraw-Hill.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.11) PostgreSQL 2000 y<>l<EFBFBD>na uyumlu mudur?
|
|
|
|
|
|
|
|
|
|
Evet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.12) Gelistirme tak<61>m<EFBFBD>na nas<61>l kat<61>labilirim?
|
|
|
|
|
|
|
|
|
|
<EFBFBD>ncelikle, en son kaynak kodunu indirin ve web sitemizdeki ya da
|
|
|
|
|
dag<EFBFBD>t<EFBFBD>m<EFBFBD>n i<>indeki PostgreSQL Developer belgesini okuyun. Ardindan,
|
|
|
|
|
pgsql-hackers ve pgsql-patches listelerine <20>ye olun. <20><><EFBFBD>nc<6E> olarak da,
|
|
|
|
|
pgsql-pacthes listesine y<>ksek kalitede yamalar g<>nderin.
|
|
|
|
|
|
|
|
|
|
PostgreSQL CVS arsivine erisim izni olan, 10 kadar gelistirici
|
|
|
|
|
bulunmaktadir. Hepsi defalarca, diger kisilerin yaptigindan cok daha
|
|
|
|
|
y<EFBFBD>ksek-kaliteli patchler gondermislerdir. Ayrica biz de bu
|
|
|
|
|
gelistiricilerin ekledikleri yamalarin y<>ksek kalitede olduguna g<>veniyoruz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.13) Bir hata raporunu nas<61>l g<>nderebilirim?
|
|
|
|
|
|
|
|
|
|
PostgreSQL BugTool sayfasina gidiniz. O sayfada bir bug bildirmek icin
|
|
|
|
|
neleri yapman<61>z gerektigi anlatilmistir.
|
|
|
|
|
|
|
|
|
|
Ayr<EFBFBD>ca, ftp://ftp.PostgreSQL.org/pub ftp adresimizde, yeni bir
|
|
|
|
|
PostgreSQL s<>r<EFBFBD>m<EFBFBD> ya da yamasi olup olmadigini kontrol ediniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.14) PostgreSQL, diger DBMS'lerle nas<61>l karsilast<73>r<EFBFBD>labilir?
|
|
|
|
|
|
|
|
|
|
Bir yazilimin g<>c<EFBFBD>n<EFBFBD> <20>l<EFBFBD>mek i<>in <20>esitli yollar vardir: Yazilimin
|
|
|
|
|
<EFBFBD>zellikleri, basar<61>m<EFBFBD>, g<>venilirligi, destegi ve <20>creti.
|
|
|
|
|
|
|
|
|
|
<EFBFBD>zellikler:
|
|
|
|
|
|
|
|
|
|
PostgreSQL mevcut b<>y<EFBFBD>k ticari veritabanlarinin, transaction, subselect,
|
|
|
|
|
trigger, view, foreign key referential integrity ve sophisticated
|
|
|
|
|
locking gibi (user-defined types), rules, inheritance ve lock
|
|
|
|
|
cak<EFBFBD>smalarini d<>s<EFBFBD>rmek icin multi-version uyumluluk <20>zellikleri
|
|
|
|
|
bulunmaktadir.
|
|
|
|
|
|
|
|
|
|
Performans (Ba<42>ar<61>m):
|
|
|
|
|
|
|
|
|
|
PostgreSQL, di<64>er ticari ve a<><61>k kaynak kodlu veritabanlar<61>yla yak<61>n
|
|
|
|
|
ba<EFBFBD>ar<EFBFBD>m<EFBFBD> sa<73>lar. Baz<61> a<><61>lardan daha h<>zl<7A>d<EFBFBD>r, di<64>er a<><61>lardan da
|
|
|
|
|
yava<EFBFBD>t<EFBFBD>r. MySQL ya da daha zay<61>f veritabanlar<61> ile
|
|
|
|
|
kar<EFBFBD><EFBFBD>la<EFBFBD>t<EFBFBD>r<EFBFBD>ld<EFBFBD><EFBFBD><EFBFBD>nda,insert/update islemlerinde, transaction bazl<7A>
|
|
|
|
|
<EFBFBD>al<EFBFBD>st<EFBFBD><EFBFBD><EFBFBD>m<EFBFBD>z i<>in daha yava<76><61>z. MySQL, yukar<61>daki "<22>zellikler" k<>sm<73>nda
|
|
|
|
|
belirtilenlerden hi<68> birine sahip de<64>ildir. Biz, ba<62>ar<61>m<EFBFBD>m<EFBFBD>z<EFBFBD> her
|
|
|
|
|
s<EFBFBD>r<EFBFBD>mde artt<74>rsak da, esneklik ve geli<6C>mi<6D> <20>zellikler i<>in yap<61>lanm<6E>s
|
|
|
|
|
durumday<EFBFBD>z . PostgreSQL'i MySQL ile kar<61><72>la<6C>t<EFBFBD>ran <20>u web sitesine
|
|
|
|
|
bakabilirsiniz: http://openacs.org/why-not-mysql.html
|
|
|
|
|
|
|
|
|
|
G<EFBFBD>venilirlik:
|
|
|
|
|
|
|
|
|
|
DBMSlerin g<>venilir olmas<61> gerketigi, yoksa degerleri olmayacagini
|
|
|
|
|
d<EFBFBD>s<EFBFBD>n<EFBFBD>yoruz <20>ok iyi test edilmis, dengeli <20>al<61>san minimum say<61>da hata
|
|
|
|
|
i<EFBFBD>eren kod sunmaya <20>al<61>s<EFBFBD>yoruz. Her bir s<>r<EFBFBD>m en az 1 ayl<79>k beta
|
|
|
|
|
testlerinden ge<67>irilmektedir. S<>r<EFBFBD>m ge<67>mi<6D>ine bakarsan<61>z, <20>retime haz<61>r,
|
|
|
|
|
dengeli ve kararl<72> kodlar sundugumuzu g<>rebilirsiniz. Bu alanda, diger
|
|
|
|
|
veritaban<EFBFBD> yaZ<61>l<EFBFBD>mlar<61>na <20>st<73>nl<6E>g<EFBFBD>m<EFBFBD>z olduguna inanmaktay<61>z
|
|
|
|
|
|
|
|
|
|
Destek:
|
|
|
|
|
|
|
|
|
|
E-posta listemiz, olusan herhangi bir sorunu <20><>zebilecek b<>y<EFBFBD>k say<61>da
|
|
|
|
|
kullan<EFBFBD>c<EFBFBD> ve gelistirici grubunu i<>erir. Sorununuz i<>in, en az bir
|
|
|
|
|
ticari veritaban<61> kadar rahat <20><>z<EFBFBD>m bulabilirsiniz. Gelistiricilere,
|
|
|
|
|
kullan<EFBFBD>c<EFBFBD> grubuna, belgelere ve kaynak koda direk olarak erisebilme,
|
|
|
|
|
PostgreSQL destegini, diger DBMSlere g<>re daha <20>nemli k<>lar. Gereksinimi
|
|
|
|
|
olanlara, ticari destek verilebilir. (Destek i<>in 1.6 b<>l<EFBFBD>m<EFBFBD>ne bak<61>n<EFBFBD>z.)
|
|
|
|
|
|
|
|
|
|
Fiyat:
|
|
|
|
|
|
|
|
|
|
Ticari ve ticari olmayan t<>m kullan<61>mlar<61>n<EFBFBD>z i<>in PostgreSQL
|
|
|
|
|
<EFBFBD>cretsizdir. Kodumuzu, yukar<61>da belirtilen BSD-stili lisanstaki
|
|
|
|
|
s<EFBFBD>n<EFBFBD>rlamalar hari<72>, <20>r<EFBFBD>n<EFBFBD>n<EFBFBD>z<EFBFBD>n i<>ine ekleyebilirsiniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.15) PostgreSQL'e maddi a<><61>dan nas<61>l destek olabilirim?
|
|
|
|
|
|
|
|
|
|
PostgreSQL, 1996 y<>l<EFBFBD>ndan beri 1.s<>n<EFBFBD>f altyap<61>ya ashiptir. Bunun i<>in,
|
|
|
|
|
y<EFBFBD>llar boyu <20>al<61>s<EFBFBD>p bu altyap<61>y<EFBFBD> olusturup y<>neten Marc Fournier'e
|
|
|
|
|
tesekk<EFBFBD>rler.
|
|
|
|
|
|
|
|
|
|
Bir a<><61>k kaynak kodlu proje i<>in, kaliteli altyap<61> <20>ok <20>nemlidir. Bu
|
|
|
|
|
altyap<EFBFBD>, projenin kesilmesini <20>nler ve projenin ilerlemesini h<>zland<6E>r<EFBFBD>r.
|
|
|
|
|
|
|
|
|
|
Tabii ki bu altyap<61> ucuz degildir. <20>slerin y<>r<EFBFBD>mesi i<>in <20>e<EFBFBD>itli y<>l<EFBFBD>k
|
|
|
|
|
ve anl<6E>k harcamalar<61>m<EFBFBD>z olmaktad<61>r. Eger siz ya da sirketinizin bu
|
|
|
|
|
<EFBFBD>abam<EFBFBD>za bag<61>sta bulunabilecek paras<61> varsa, l<>tfen
|
|
|
|
|
http://www.pgsql.com/pg_goodies adresine gidiniz ve bag<61>sta, hibede
|
|
|
|
|
bulununuz.
|
|
|
|
|
|
|
|
|
|
Web sayfas<61>n<EFBFBD>n PostgreSQL, <20>nc.' den bahsetmesine ragmen, "katk<74>da
|
|
|
|
|
bulunanlar" (contributors) maddesi sadece PostgreSQL projesini
|
|
|
|
|
desteklemek i<>indir ve belirli bir sirketin para kaynag<61> degildir.
|
|
|
|
|
isterseniz, baglant<6E> adresine bir <20>ek g<>nderebilirsiniz.
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Kullan<61>c<EFBFBD>/istemci Sorular<61>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2.1) PostgreSQL icin ODBC s<>r<EFBFBD>c<EFBFBD>leri var m<>?
|
|
|
|
|
|
|
|
|
|
iki tane ODBC s<>r<EFBFBD>c<EFBFBD>s<EFBFBD> bulunmaktad<61>r: PsqlODBC ve OpenLink ODBC.
|
|
|
|
|
|
|
|
|
|
PsqlODBC'i http://gborg.postgresql.org/project/psqlodbc/projdisplay.php
|
|
|
|
|
adresinden indirebilirsiniz.
|
|
|
|
|
|
|
|
|
|
OpenLink ODBC http://www.openlinksw.com adresinden al<61>nabilir.Bu s<>r<EFBFBD>c<EFBFBD>,
|
|
|
|
|
kendi standart ODBC istemci yaz<61>l<EFBFBD>m<EFBFBD> ile <20>al<61>st<73><74><EFBFBD>ndan, destekledikleri
|
|
|
|
|
her platformda (Win, Mac, Unix, VMS) PostgreSQL ODBC bulunmalidir.
|
|
|
|
|
|
|
|
|
|
<EFBFBD>cretsiz s<>r<EFBFBD>m<EFBFBD> olmakla beraber, ticari kalitede destek almak
|
|
|
|
|
isteyenlere satmak isteyeceklerdir. Sorular<61>n<EFBFBD>z<EFBFBD> l<>tfen
|
|
|
|
|
postgres95@openlink.co.uk adresine g<>nderiniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2.2) PostgreSQL'i web sayfalar<61>nda kullanabilmek i<>in hangi
|
|
|
|
|
ara<72>lar bulunmaktad<61>r?
|
|
|
|
|
|
|
|
|
|
http://www.webreview.com adresinde, arka planda veritaban<61> <20>al<61>st<73>ran
|
|
|
|
|
Web sayfalar<61> i<>in giris seviyesinde bilgi bulunmaktad<61>r.
|
|
|
|
|
|
|
|
|
|
Web ile b<>t<EFBFBD>nlesme i<>in, PHP m<>kemmel bir arabirim sunar. http://www.php.net
|
|
|
|
|
|
|
|
|
|
Karma<EFBFBD><EFBFBD>k sorunlar i<>in, <20>o<EFBFBD>u kisi Perl arabirimini ve CGI.pm ya da
|
|
|
|
|
mod_perl kullan<61>r.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2.3) PostgreSQL'in grafik kullan<61>c<EFBFBD> arabirimi var m<>d<EFBFBD>r?
|
|
|
|
|
|
|
|
|
|
<EFBFBD>e<EFBFBD>itli grafik arabirimlerimiz bulunmaktad<61>r. Bunlar<61>n aras<61>nda,
|
|
|
|
|
PgAccess (http://www.pgaccess.org), PgAdmin II (http://www.pgadmin.org,
|
|
|
|
|
sadece Win32 i<>in), RHDB Admin (http://sources.redhat.com/rhdb/ ) ve
|
|
|
|
|
Rekall (http://www.thekompany.com/products/rekall/) bulunmaktad<61>r.
|
|
|
|
|
Ayr<EFBFBD>ca, PostgreSQL i<>in web tabanl<6E> bir arabirim olan PHPPgAdmin (
|
|
|
|
|
http://phppgadmin.sourceforge.net/ ) bulunmaktad<61>r.
|
|
|
|
|
|
|
|
|
|
Daha ayr<79>nt<6E>l<EFBFBD> liste i<>in http://techdocs.postgresql.org/guides/GUITools
|
|
|
|
|
adresine bakabilirsiniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2.4) PostgreSQL ile ileti<74>imi kurabilmek i<>in hangi dilleri
|
|
|
|
|
kullanabilirim?
|
|
|
|
|
|
|
|
|
|
* C (libpq)
|
|
|
|
|
* Embedded C (ecpg)
|
|
|
|
|
* Java (jdbc)
|
|
|
|
|
* Python (PyGreSQL)
|
|
|
|
|
* TCL (libpgtcl)
|
|
|
|
|
|
|
|
|
|
Di<EFBFBD>erleri i<>in, http://gborg.postgresql.org adresindeki
|
|
|
|
|
Drivers/Interfaces b<>l<EFBFBD>m<EFBFBD>ne bakabilirsiniz.
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Y<>netimsel Sorular
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.1) PostgreSQL'i, /usr/local/pgsql dizininden baska dizinlere
|
|
|
|
|
nas<61>l kurabilirim?
|
|
|
|
|
|
|
|
|
|
configure betigini <20>al<61>st<73>r<EFBFBD>rken, --prefix se<73>enegini veriniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.2) postmaster'i baslatt<74>g<EFBFBD>mda, a Bad System Call ya da core
|
|
|
|
|
dumped mesaj<61> al<61>yorum. Neden?
|
|
|
|
|
|
|
|
|
|
Bunun bir<69>ok nedeni olabilir. Ancak ilk kontrol edilmesi gereken sey,
|
|
|
|
|
<EFBFBD>ekirdeginize System V uzant<6E>lar<61>n<EFBFBD>n kurulu olup olmad<61>g<EFBFBD>n<EFBFBD> kontrol
|
|
|
|
|
etmek olabilir. PostgreSQL shared memory ve semaphores i<>in <20>ekirdek
|
|
|
|
|
destegine gereksinim duyar.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3) postmaster'i baslatt<74>g<EFBFBD>mda, a <20>pcMemoryCreate hatas<61>
|
|
|
|
|
al<61>yorum. Neden?
|
|
|
|
|
|
|
|
|
|
Ya <20>ekirdeginizde shared memory desteginiz d<>zg<7A>nce
|
|
|
|
|
yap<EFBFBD>land<EFBFBD>r<EFBFBD>lmam<EFBFBD>st<EFBFBD>r, ya da <20>ekirdeginizdeki mevcut shared memory
|
|
|
|
|
miktar<EFBFBD>n<EFBFBD> b<>y<EFBFBD>tmeniz gerekecektir. Gereksinim duyacag<61>n<EFBFBD>z miktar,
|
|
|
|
|
mimarinize ve postmaster i<>in ayarlad<61>g<EFBFBD>n<EFBFBD>z tampon ile backend islemi
|
|
|
|
|
say<EFBFBD>s<EFBFBD>na bagl<67>d<EFBFBD>r. T<>m sistemler i<>in, tamponlar ve islemlerde <20>ntan<61>ml<6D>
|
|
|
|
|
say<EFBFBD>larla, ~ 1MB kadar yere gereksinmeniz olacaktir.PostgreSQL
|
|
|
|
|
Administrator's Guide' a, shared memory ve semaphorelar hakk<6B>ndaki
|
|
|
|
|
ayr<EFBFBD>nt<EFBFBD>l<EFBFBD> bilgi i<>in bakabilirsiniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.4) postmaster'i baslatt<74>g<EFBFBD>mda, a <20>pcSemaphoreCreate hatas<61>
|
|
|
|
|
al<61>yorum. Neden?
|
|
|
|
|
|
|
|
|
|
Eger hata, "<22>pcSemaphoreCreate: semget failed (No space left on device)"
|
|
|
|
|
ise, <20>ekirdeginiz yeterli semaphore ile yap<61>land<6E>r<EFBFBD>lmam<61>s demektir.
|
|
|
|
|
Postgres, her bir potansiyel backend i<>in bir semaphore gereksinmesi
|
|
|
|
|
duyar. Ge<47>ici bir <20><>z<EFBFBD>m, postmaster<65> backend islemleri i<>in daha az
|
|
|
|
|
miktarda s<>n<EFBFBD>rla baslatmak olabilir. -N i varsa<73>lan deger olan 32'den
|
|
|
|
|
k<EFBFBD><EFBFBD><EFBFBD>k bir degerle baslat<61>n<EFBFBD>z. Daha kal<61>c<EFBFBD> bir <20><>z<EFBFBD>m, <20>ekirde<64>inizin
|
|
|
|
|
SEMMNS ve SEMMNI parametrelerini y<>kseltmek olacakt<6B>r.
|
|
|
|
|
|
|
|
|
|
<EFBFBD>al<EFBFBD><EFBFBD>mayan semaphorelar a<><61>r veritaban<61> islemlerinde <20><>kme yaratabilirler.
|
|
|
|
|
|
|
|
|
|
Eger hata mesaj<61>n<EFBFBD>z baska birsey ise, <20>ekirdeginizde semaphore destegini
|
|
|
|
|
yap<EFBFBD>land<EFBFBD>rmam<EFBFBD>s olabilirsiniz. Shared memory ve semaphorelar hakk<6B>ndaki
|
|
|
|
|
daha ayr<79>nt<6E>l<EFBFBD> bilgi i<>in PostgreSQL Administrator's Guide'a bakabilirsiniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.5) Diger bilgisayarlar<61>n benim PostgreSQL veritaban<61> sunucuma
|
|
|
|
|
baglant<6E>lar<61>n<EFBFBD> nas<61>l kontrol edebilirim?
|
|
|
|
|
|
|
|
|
|
<EFBFBD>n tan<61>ml<6D> olarak, PostgreSQL sadece yerel makineden Unix domain sockets
|
|
|
|
|
kullanarak baglan<61>lmas<61>na izin verir. Diger makineler, postmaster'a -i
|
|
|
|
|
etiketini ge<67>irmezseniz ve $PGDATA_pg_hba.conf dosyas<61>n<EFBFBD> d<>zenleyerek
|
|
|
|
|
host-based authentication'a olanak vermezseniz, baglant<6E> yapamayacaklard<72>r.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.6) Veritabani motorunu daha iyi basarim icin nasil
|
|
|
|
|
ayarlayabilirim?
|
|
|
|
|
|
|
|
|
|
Indexler sorgular<61> h<>zland<6E>rabilir. EXPLAIN komutu, PostgreSQL'in
|
|
|
|
|
sorgunuzu nas<61>l yorumlad<61><64><EFBFBD>n<EFBFBD> ve hangi indexleri kullandigini g<>rmenize
|
|
|
|
|
izin verir.
|
|
|
|
|
|
|
|
|
|
E<EFBFBD>er cok fazla INSERT islemi yapiyorsaniz, bunlar<61> b<>y<EFBFBD>k bir toplu islem
|
|
|
|
|
dosyasi kullan<61>p COPY komutu ile veritabanina girmeyi deneyiniz. Bu,
|
|
|
|
|
tekil <20>NSERTlerden daha h<>zl<7A>d<EFBFBD>r. ikinci olarak, BEG<45>N WORK/COMM<4D>T
|
|
|
|
|
transaction blogu i<>inde olmayan ifadeler kendi transactionlarindaymis
|
|
|
|
|
gibi d<>s<EFBFBD>n<EFBFBD>l<EFBFBD>r. <20>oklu ifadeleri tek bir transaction blo<6C>u i<>inde
|
|
|
|
|
yapabilirsiniz. Bu, transaction overheadini d<><64><EFBFBD>recektir. Tek bir
|
|
|
|
|
transaction blo<6C>u i<>inde birden <20>ok ifadeyi <20>al<61><6C>t<EFBFBD>rmay<61>
|
|
|
|
|
deneyebilirsiniz. Bu, transaction overhead ini d<><64><EFBFBD>r<EFBFBD>r.
|
|
|
|
|
|
|
|
|
|
<EFBFBD>e<EFBFBD>itli ayarlama se<73>enekleri mevcuttur. fsync() i<>lemini, postmaster'<27>
|
|
|
|
|
-o -F se<73>ene<6E>i ile ba<62>latarak devre d<><64><EFBFBD> b<>rakabilirsiniz. Bu i<>lem,
|
|
|
|
|
fsync()'lerin her transactiondan sonra diske flush etmesini engelleyecektir.
|
|
|
|
|
|
|
|
|
|
Ayn<EFBFBD> zamanda, postmaster'i -B se<73>ene<6E>i ile ba<62>lat<61>p, backend i<>lemleri
|
|
|
|
|
taraf<EFBFBD>ndan kullan<61>lan shared memorf buffers say<61>lar<61>n<EFBFBD>
|
|
|
|
|
artt<EFBFBD>rabilirsiniz. Eger bu parametreyi <20>ok y<>ksek tutarsan<61>z,
|
|
|
|
|
<EFBFBD>ekirde<EFBFBD>inizin shared memory b<>lgesindeki limiti a<>ma olas<61>l<EFBFBD><6C><EFBFBD>n<EFBFBD>z
|
|
|
|
|
y<EFBFBD>z<EFBFBD>nden postmaster ba<62>layamayabilir. Her bir tampon (buffer) 8K'd<>r.
|
|
|
|
|
<EFBFBD>ntan<EFBFBD>ml<EFBFBD> say<61> ise 64 tampondur.
|
|
|
|
|
|
|
|
|
|
Ayn<EFBFBD> <20>ekilde, backend'in -S se<73>ene<6E>ini ge<67>ici s<>ralamalar i<>in backend
|
|
|
|
|
s<EFBFBD>re<EFBFBD>leri taraf<61>ndan kullan<61>lacak haf<61>zay<61> artt<74>rmak amac<61>yla
|
|
|
|
|
kullanabilirsiniz. -S se<73>ene<6E>i kilobayt cinsinden de<64>er al<61>r ve <20>n
|
|
|
|
|
tan<EFBFBD>ml<EFBFBD> de<64>eri 512'dir (512 K)
|
|
|
|
|
|
|
|
|
|
Tablolardaki veriyi bir indekse e<>lemek amac<61>yla gruplama i<>in CLUSTER
|
|
|
|
|
komutunu kullanabilirsiniz. Ayr<79>nt<6E>l<EFBFBD> bilgi i<>in CLUSTER komutunun
|
|
|
|
|
yard<EFBFBD>m sayfas<61>na bakabilirsiniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.7) Hangi hata ay<61>klama <20>zellikleri bulunmaktad<61>r?
|
|
|
|
|
|
|
|
|
|
PostgreSQL, hata ay<61>klama amac<61>yla kullan<61>labilecek durum bilgisi rapor
|
|
|
|
|
eden <20>e<EFBFBD>itli <20>zeliklere sahiptir.
|
|
|
|
|
|
|
|
|
|
<EFBFBD>ncelikle, configure beti<74>ini --enable-cassert se<73>ene<6E>iyle
|
|
|
|
|
<EFBFBD>al<EFBFBD><EFBFBD>t<EFBFBD>r<EFBFBD>rsan<EFBFBD>z, bir <20>ok assert() backend cal<61><6C>mas<61>n<EFBFBD> g<>zlemler ve
|
|
|
|
|
beklenmeyen bir durumda program<61> durdurur.
|
|
|
|
|
|
|
|
|
|
Postmaster ve postgres <20>e<EFBFBD>itli hata ay<61>klama se<73>eneklerine sahiptir.
|
|
|
|
|
<EFBFBD>ncelikle, postmaster'i ba<62>latt<74><74><EFBFBD>n<EFBFBD>zda, standart <20><>kt<6B>y<EFBFBD> ve hatalar<61>
|
|
|
|
|
bir log dosyas<61>na y<>nlendirdi<64>inize emin olun:
|
|
|
|
|
|
|
|
|
|
cd /usr/local/pgsql
|
|
|
|
|
./bin/postmaster >server.log 2>&1 &
|
|
|
|
|
|
|
|
|
|
Bu i<>lem PostgreSQL ana dizinine server.log dosyas<61> yerle<6C>tirecektir. Bu
|
|
|
|
|
dosya sunucunun ya<79>ad<61><64><EFBFBD> sorunlar ya da hatalar hakk<6B>nda yararl<72>
|
|
|
|
|
bilgiler i<>erir. -d se<73>ene<6E>i, hata ay<61>klama seviyesini belirten bir
|
|
|
|
|
rakam ile kullan<61>l<EFBFBD>r. Y<>ksek hata ay<61>klama seviyelerinin b<>y<EFBFBD>k log
|
|
|
|
|
dosyalar<EFBFBD> olu<6C>turaca<63><61>n<EFBFBD> unutmay<61>n<EFBFBD>z.
|
|
|
|
|
|
|
|
|
|
E<EFBFBD>er postmaster <20>al<61><6C>m<EFBFBD>yorsa, postgres backend'ini komut sat<61>r<EFBFBD>ndan
|
|
|
|
|
<EFBFBD>al<EFBFBD><EFBFBD>t<EFBFBD>rabilir ve SQL ifadenizi direk olarak yazabilirsiniz. Bu sadece
|
|
|
|
|
hata ay<61>klama amac<61>yla <20>nerilir. Burada, noktal<61> virg<72>l<EFBFBD>n de<64>il de yeni
|
|
|
|
|
bir sat<61>r<EFBFBD>n sorguyu sonland<6E>rd<72><64><EFBFBD>n<EFBFBD> unutmay<61>n<EFBFBD>z. E<>er hata ay<61>klama
|
|
|
|
|
sembolleri ile derlediyseniz, ne oldu<64>unu g<>rmek i<>in bir hata
|
|
|
|
|
ay<EFBFBD>klay<EFBFBD>c<EFBFBD> kullanabilirsiniz. backend postmasterdan ba<62>lat<61>lmad<61><64><EFBFBD>ndan,
|
|
|
|
|
e<EFBFBD>de<EFBFBD>er bir ortamda <20>al<61><6C>mamaktad<61>r ve locking/backend etkile<6C>im
|
|
|
|
|
sorunlar<EFBFBD> artabilir.
|
|
|
|
|
|
|
|
|
|
E<EFBFBD>er postmaster <20>al<61><6C><EFBFBD>yorsa, bir pencerede psql'i <20>al<61><6C>t<EFBFBD>r<EFBFBD>n ve psql
|
|
|
|
|
taraf<EFBFBD>ndan kullan<61>lan postgres s<>recinin s<>re<72> numaras<61>n<EFBFBD> (PID) bulun.
|
|
|
|
|
Postgres s<>reci ile ili<6C>kilendirmek i<>in bir hata ay<61>klar<61>c<EFBFBD> kullan<61>n.
|
|
|
|
|
Sorgular<EFBFBD> psql arac<61>l<EFBFBD><6C><EFBFBD> ile <20>al<61><6C>t<EFBFBD>rabilirsiniz. E<>er postgres
|
|
|
|
|
ba<EFBFBD>lang<EFBFBD>c<EFBFBD>nda hata ay<61>klamak istiyorsan<61>z, PGOPTIONS="-W n" se<73>ene<6E>ini
|
|
|
|
|
ayarlayabilir ve psql'i ba<62>latabilirsiniz. Bu i<>lem, ba<62>lang<6E>c<EFBFBD>n n
|
|
|
|
|
saniye kadar gecikmesini sa<73>layacakt<6B>r; b<>ylece hata ay<61>klay<61>c<EFBFBD>y<EFBFBD> s<>rece
|
|
|
|
|
ili<EFBFBD>kilendirdikten sonra ba<62>lang<6E><67> s<>recinin devam etmesini
|
|
|
|
|
sa<EFBFBD>layabilirsiniz.
|
|
|
|
|
|
|
|
|
|
postgres program<61> hata ay<61>klama ve ba<62>ar<61>m <20>l<EFBFBD><6C>mleri i<>in -s, -A ve -t
|
|
|
|
|
se<EFBFBD>eneklerine sahiptir.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.8) Baglanmaya <20>al<61>s<EFBFBD>ken, neden "Sorry, too many clients"
|
|
|
|
|
hatas<61>n<EFBFBD> al<61>yorum?
|
|
|
|
|
|
|
|
|
|
Postmaster'in e<>zamanl<6E> olarak ba<62>latabilece<63>i backend s<>re<72>leri
|
|
|
|
|
s<EFBFBD>n<EFBFBD>rlar<EFBFBD>n<EFBFBD> artt<74>rman<61>z gerekmektedir.
|
|
|
|
|
|
|
|
|
|
<EFBFBD>n tan<61>ml<6D> de<64>er 32 s<>re<72>tir. Bunu, postmaster'i uygun -N de<64>eri ile ya
|
|
|
|
|
da postgresql.conf dosyas<61>n<EFBFBD> d<>zenleyerek yeniden ba<62>latmakla
|
|
|
|
|
artt<EFBFBD>rabilirsiniz.
|
|
|
|
|
|
|
|
|
|
E<EFBFBD>er -N de<64>erini 32'den b<>y<EFBFBD>k yapacaksan<61>z, ayn<79> zamanda -B de<64>erini de
|
|
|
|
|
de<EFBFBD>i<EFBFBD>tirmeniz gerekti<74>ini unutmay<61>n. -B -N'nin en az 2 kat<61> kadar
|
|
|
|
|
olmal<EFBFBD>d<EFBFBD>r; daha iyi ba<62>ar<61>m i<>in bu say<61>y<EFBFBD> daha da artt<74>rmal<61>s<EFBFBD>n<EFBFBD>z.
|
|
|
|
|
Y<EFBFBD>ksek say<61>daki backend s<>re<72>leri i<>in, <20>e<EFBFBD>itli <20>ekirdek yap<61>land<6E>rma
|
|
|
|
|
parametrelerini artt<74>rman<61>z gerekecektir. Yap<61>lmas<61> gerekenler, SHMMAX,
|
|
|
|
|
SEMMNS, SEMMNI, NPROC, MAXUPRC ve a<><61>labilecek dosyalar<61>n maksimum
|
|
|
|
|
say<EFBFBD>s<EFBFBD> olan NFILE ve NINODE de<64>erlerini kar<61><72>t<EFBFBD>rmakt<6B>r. Bunun nedeni,
|
|
|
|
|
PostgreSQL'in izin verilen backend s<>re<72>lerinin say<61>s<EFBFBD> <20>zerinde bir
|
|
|
|
|
s<EFBFBD>n<EFBFBD>r<EFBFBD> olmas<61>d<EFBFBD>r. B<>ylelikle sistem kaynaklar<61>n<EFBFBD>n d<><64><EFBFBD>na <20><>k<EFBFBD>lmayacakt<6B>r.
|
|
|
|
|
|
|
|
|
|
PostgreSQL'in 6.5 s<>r<EFBFBD>m<EFBFBD>ne kadar, en fazla backend say<61>s<EFBFBD> 64 idi ve bunu
|
|
|
|
|
de<EFBFBD>i<EFBFBD>tirmek i<>in include/storage/sinvaladt.h dosyas<61> i<>indeki
|
|
|
|
|
MaxBAckendid sabitini de<64>i<EFBFBD>tirdek sonra yaz<61>l<EFBFBD>m<EFBFBD> yeniden derlemek
|
|
|
|
|
gerekiyordu.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.9) pgsql_tmp dizinin i<>indeki dosyalar nelerdir?
|
|
|
|
|
|
|
|
|
|
Sorgu <20>al<61>st<73>r<EFBFBD>c<EFBFBD> (query executer) taraf<61>ndan yarat<61>lan ge<67>ici
|
|
|
|
|
dosyalard<EFBFBD>r. <20>rnegin, bir s<>ralama ORDER BY ile yapilacaksa ve s<>ralama
|
|
|
|
|
backend'in -s parametresinin izin verdiginden daha fazla alana
|
|
|
|
|
gereksinim duyuyorsa, ekstra veriyi tutmak i<>in ge<67>ici dosyalar yarat<61>l<EFBFBD>r.
|
|
|
|
|
|
|
|
|
|
Ge<EFBFBD>ici dosyalar, eger s<>ralama s<>ras<61>nda backend g<><67>mezse otomatik
|
|
|
|
|
olarak silinecektir. Eger <20>al<61>san durumda bir backendiniz yoksa,
|
|
|
|
|
pg_tempNNN.NN dosyalar<61>n<EFBFBD> silmeniz g<>venlidir..
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.10) PostgreSQL s<>r<EFBFBD>mlerini y<>kselmek i<>in neden bir
|
|
|
|
|
dump/reload i<>lemi ger<65>ekle<6C>tirmek zorunday<61>m?
|
|
|
|
|
|
|
|
|
|
PostgreSQL tak<61>m<EFBFBD> ara s<>r<EFBFBD>mlerde sadece k<><6B><EFBFBD>k de<64>i<EFBFBD>iklikler yapmaktad<61>r;
|
|
|
|
|
bu y<>zden 7.2 s<>r<EFBFBD>m<EFBFBD>nden 7.2.1'e y<>kseltmek dump/restore i<>lemi
|
|
|
|
|
gerekmemektedir. Ancak, esas s<>r<EFBFBD>mlerde (<28>rnek: 7.2'den 7.3'e)
|
|
|
|
|
<EFBFBD>o<EFBFBD>unlukla sistem tablolar<61>n<EFBFBD>n ve veri dosyalar<61>n<EFBFBD>n i<> yap<61>s<EFBFBD>
|
|
|
|
|
de<EFBFBD>i<EFBFBD>tirilir. Bu de<64>i<EFBFBD>iklikler <20>o<EFBFBD>unlukla karma<6D><61>kt<6B>r; dolay<61>s<EFBFBD>yla veri
|
|
|
|
|
dosyalar<EFBFBD>n<EFBFBD>n geriye d<>n<EFBFBD>k uyumlulu<6C>u i<>lemlerini yapm<70>yoruz. Dump
|
|
|
|
|
i<EFBFBD>lemi, veriyi genel bi<62>imde alaca<63><61>ndan yeniden y<>kleme esnas<61>nda veri,
|
|
|
|
|
yeni i<> bi<62>ime uygun <20>ekilde yerle<6C>tirilecektir.
|
|
|
|
|
|
|
|
|
|
Disk bi<62>iminin de<64>i<EFBFBD>medi<64>i s<>r<EFBFBD>mlerde, pg_upgrade beti<74>i g<>ncellemenin
|
|
|
|
|
bir dump/restore gerektirmeden yap<61>lmas<61>n<EFBFBD> sa<73>layacakt<6B>r. pg_upgrade
|
|
|
|
|
beti<EFBFBD>inin o s<>r<EFBFBD>m i<>in bulunup bulunmad<61><64><EFBFBD>n<EFBFBD> s<>r<EFBFBD>m notlar<61> i<>inde
|
|
|
|
|
bulabilirsiniz.
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<20><>letimsel Sorular
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.1) Binary cursor ve normal cursor arasindaki fark nedir?
|
|
|
|
|
|
|
|
|
|
DECLARE yard<72>m sayfasina bakiniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.2) Sorgunun sadece ilk birka<6B> sat<61>r<EFBFBD>n<EFBFBD> nasil SELECT edebilirim?
|
|
|
|
|
|
|
|
|
|
FETCH yard<72>m sayfasina bakiniz, aya da SELECT ... LIMIT.... kullan<61>n<EFBFBD>z.
|
|
|
|
|
|
|
|
|
|
The entire query may have to be evaluated, even if you only want the
|
|
|
|
|
first few rows. Consider a query that has an ORDER BY. <20>f there is an
|
|
|
|
|
index that matches the ORDER BY, PostgreSQL may be able to evaluate only
|
|
|
|
|
the first few records requested, or the entire query may have to be
|
|
|
|
|
evaluated until the desired rows have been generated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.3) psql'in i<>inde g<>rd<72>g<EFBFBD>m tablolarin ya da diger seylerin
|
|
|
|
|
listesini nasil alabilirim?
|
|
|
|
|
|
|
|
|
|
pgsql/src/bin/psql/describe.c i<>indeki psql kaynak kodunu
|
|
|
|
|
okuyabilirsiniz. Bu kod, psql'in \ ile baslayan komutlar<61>n<EFBFBD>n <20><>kt<6B>s<EFBFBD>n<EFBFBD>
|
|
|
|
|
olusturan SQL komutlarini i<>erir. Ayn<79> zamanda, psql'i -E se<73>ene<6E>i ile
|
|
|
|
|
ba<EFBFBD>lat<EFBFBD>p, verdi<64>iniz komutlar<61> <20>al<61><6C>t<EFBFBD>rmak i<>in yapt<70><74><EFBFBD> sorgular<61>n
|
|
|
|
|
<EFBFBD><EFBFBD>kt<EFBFBD>lar<EFBFBD>n<EFBFBD> g<>rebilirsiniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.4) Bir tablodan bir kolonu nas<61>l kald<6C>rabilirim?
|
|
|
|
|
|
|
|
|
|
Bu <20>zellik (ALTER TABLE DROP COLUMN) 7.3 s<>r<EFBFBD>m<EFBFBD> ile gelmi<6D>tir. Eski
|
|
|
|
|
s<EFBFBD>r<EFBFBD>mlerde a<>a<EFBFBD><61>dakileri uygulamal<61>s<EFBFBD>n<EFBFBD>z:
|
|
|
|
|
|
|
|
|
|
BEGIN;
|
|
|
|
|
LOCK TABLE old_table;
|
|
|
|
|
SELECT ... -- select all columns but the one you want to remove
|
|
|
|
|
INTO TABLE new_table
|
|
|
|
|
FROM old_table;
|
|
|
|
|
DROP TABLE old_table;
|
|
|
|
|
ALTER TABLE new_table RENAME TO old_table;
|
|
|
|
|
COMMIT;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.5) Bir sat<61>r, tablo ve veritaban<61> icin en fazla b<>y<EFBFBD>kl<6B>k nedir?
|
|
|
|
|
|
|
|
|
|
S<EFBFBD>n<EFBFBD>rlar:
|
|
|
|
|
|
|
|
|
|
Veritabani icin en fazla b<>y<EFBFBD>kl<6B>k nedir?
|
|
|
|
|
S<EFBFBD>n<EFBFBD>rs<EFBFBD>z (4 TB'l<>k veritaban<61> bulunmaktad<61>r)
|
|
|
|
|
|
|
|
|
|
Bir tablo icin en fazla b<>y<EFBFBD>kl<6B>k nedir?
|
|
|
|
|
16 TB
|
|
|
|
|
|
|
|
|
|
Bir sat<61>r i<>in en fazla b<>y<EFBFBD>kl<6B>k nedir?
|
|
|
|
|
1.6 TB
|
|
|
|
|
|
|
|
|
|
Bir alan i<>in en fazla b<>y<EFBFBD>kl<6B>k nedir?
|
|
|
|
|
1 GB
|
|
|
|
|
|
|
|
|
|
Tabloda en fazla sat<61>r say<61>s<EFBFBD> ka<6B>t<EFBFBD>r?
|
|
|
|
|
S<EFBFBD>n<EFBFBD>rs<EFBFBD>z
|
|
|
|
|
|
|
|
|
|
Bir tabloda olabilecek en fazla kolon say<61>s<EFBFBD> ka<6B>t<EFBFBD>r?
|
|
|
|
|
Kolon tiplerine ba<62>l<EFBFBD> olarak 250-1600
|
|
|
|
|
|
|
|
|
|
Bir tabloda olabilecek en fazla index say<61>s<EFBFBD> ka<6B>t<EFBFBD>r?
|
|
|
|
|
s<EFBFBD>n<EFBFBD>rs<EFBFBD>z
|
|
|
|
|
|
|
|
|
|
These are the limits:
|
|
|
|
|
|
|
|
|
|
Maximum size for a database? unlimited (4 TB databases exist)
|
|
|
|
|
Maximum size for a table? 16 TB
|
|
|
|
|
Maximum size for a row? 1.6TB
|
|
|
|
|
Maximum size for a field? 1 GB
|
|
|
|
|
Maximum number of rows in a table? unlimited
|
|
|
|
|
Maximum number of columns in a table? 250-1600 depending on column types
|
|
|
|
|
Maximum number of indexes on a table? unlimited
|
|
|
|
|
|
|
|
|
|
Of course, these are not actually unlimited, but limited to available
|
|
|
|
|
disk space and memory/swap space. Performance may suffer when these
|
|
|
|
|
values get unusually large.
|
|
|
|
|
|
|
|
|
|
The maximum table size of 16 TB does not require large file support from
|
|
|
|
|
the operating system. Large tables are stored as multiple 1 GB files so
|
|
|
|
|
file system size limits are not important.
|
|
|
|
|
|
|
|
|
|
The maximum table size and maximum number of columns can be increased if
|
|
|
|
|
the default block size is increased to 32k.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.6) How much database disk space is required to store data from
|
|
|
|
|
a typical text file?
|
|
|
|
|
|
|
|
|
|
A PostgreSQL database may require up to five times the disk space to
|
|
|
|
|
store data from a text file.
|
|
|
|
|
|
|
|
|
|
As an example, consider a file of 100,000 lines with an integer and text
|
|
|
|
|
description on each line. Suppose the text string avergages twenty bytes
|
|
|
|
|
in length. The flat file would be 2.8 MB. The size of the PostgreSQL
|
|
|
|
|
database file containing this data can be estimated as 6.4 MB:
|
|
|
|
|
|
|
|
|
|
36 bytes: each row header (approximate)
|
|
|
|
|
24 bytes: one int field and one text field
|
|
|
|
|
+ 4 bytes: pointer on page to tuple
|
|
|
|
|
----------------------------------------
|
|
|
|
|
64 bytes per row
|
|
|
|
|
|
|
|
|
|
The data page size in PostgreSQL is 8192 bytes (8 KB), so:
|
|
|
|
|
|
|
|
|
|
8192 bytes per page
|
|
|
|
|
------------------- = 128 rows per database page (rounded down)
|
|
|
|
|
64 bytes per row
|
|
|
|
|
|
|
|
|
|
100000 data rows
|
|
|
|
|
-------------------- = 782 database pages (rounded up)
|
|
|
|
|
128 rows per page
|
|
|
|
|
|
|
|
|
|
782 database pages * 8192 bytes per page = 6,406,144 bytes (6.4 MB)
|
|
|
|
|
|
|
|
|
|
Indexes do not require as much overhead, but do contain the data that is
|
|
|
|
|
being indexed, so they can be large also.
|
|
|
|
|
|
|
|
|
|
NULLs are stored in bitmaps, so they use very little space.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.7) How do I find out what tables, indexes, databases, and
|
|
|
|
|
users are defined?
|
|
|
|
|
|
|
|
|
|
/psql/ has a variety of backslash commands to show such information. Use
|
|
|
|
|
\? to see them. There are also system tables beginning with /pg_/ that
|
|
|
|
|
describe these too. Also, /psql -l/ will list all databases.
|
|
|
|
|
|
|
|
|
|
Also try the file /pgsql/src/tutorial/syscat.source/. It illustrates
|
|
|
|
|
many of the SELECTs needed to get information from the database system
|
|
|
|
|
tables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.8) My queries are slow or don't make use of the indexes. Why?
|
|
|
|
|
|
|
|
|
|
Indexes are not automatically used by every query. Indexes are only used
|
|
|
|
|
if the table is larger than a minimum size, and the query selects only a
|
|
|
|
|
small percentage of the rows in the table. This is because the random
|
|
|
|
|
disk access caused by an index scan can be slower than a straight read
|
|
|
|
|
through the table, or sequential scan.
|
|
|
|
|
|
|
|
|
|
To determine if an index should be used, PostgreSQL must have statistics
|
|
|
|
|
about the table. These statistics are collected using VACUUM ANALYZE, or
|
|
|
|
|
simply ANALYZE. Using statistics, the optimizer knows how many rows are
|
|
|
|
|
in the table, and can better determine if indexes should be used.
|
|
|
|
|
Statistics are also valuable in determining optimal join order and join
|
|
|
|
|
methods. Statistics collection should be performed periodically as the
|
|
|
|
|
contents of the table change.
|
|
|
|
|
|
|
|
|
|
Indexes are normally not used for ORDER BY or to perform joins. A
|
|
|
|
|
sequential scan followed by an explicit sort is usually faster than an
|
|
|
|
|
index scan of a large table.
|
|
|
|
|
|
|
|
|
|
However, LIMIT combined with ORDER BY often will use an index because
|
|
|
|
|
only a small portion of the table is returned. In fact, though MAX() and
|
|
|
|
|
MIN() don't use indexes, it is possible to retrieve such values using an
|
|
|
|
|
index with ORDER BY and LIMIT:
|
|
|
|
|
|
|
|
|
|
SELECT col
|
|
|
|
|
FROM tab
|
|
|
|
|
ORDER BY col [ DESC ]
|
|
|
|
|
LIMIT 1;
|
|
|
|
|
|
|
|
|
|
If you believe the optimizer is incorrect in choosing a sequential scan,
|
|
|
|
|
use |SET enable_seqscan TO 'off'| and run tests to see if an index scan
|
|
|
|
|
is indeed faster.
|
|
|
|
|
|
|
|
|
|
When using wild-card operators such as LIKE or /~/, indexes can only be
|
|
|
|
|
used in certain circumstances:
|
|
|
|
|
|
|
|
|
|
* The beginning of the search string must be anchored to the start
|
|
|
|
|
of the string, i.e.
|
|
|
|
|
o LIKE patterns must not start with /%/.
|
|
|
|
|
o /~/ (regular expression) patterns must start with /^/.
|
|
|
|
|
* The search string can not start with a character class, e.g. [a-e].
|
|
|
|
|
* Case-insensitive searches such as ILIKE and /~*/ do not utilise
|
|
|
|
|
indexes. Instead, use functional indexes, which are described in
|
|
|
|
|
section 4.12 <#4.12>.
|
|
|
|
|
* The default /C/ locale must be used during /initdb/.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.9) How do I see how the query optimizer is evaluating my query?
|
|
|
|
|
|
|
|
|
|
See the EXPLAIN manual page.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.10) What is an R-tree index?
|
|
|
|
|
|
|
|
|
|
An R-tree index is used for indexing spatial data. A hash index can't
|
|
|
|
|
handle range searches. A B-tree index only handles range searches in a
|
|
|
|
|
single dimension. R-trees can handle multi-dimensional data. For
|
|
|
|
|
example, if an R-tree index can be built on an attribute of type
|
|
|
|
|
/point/, the system can more efficiently answer queries such as "select
|
|
|
|
|
all points within a bounding rectangle."
|
|
|
|
|
|
|
|
|
|
The canonical paper that describes the original R-tree design is:
|
|
|
|
|
|
|
|
|
|
Guttman, A. "R-trees: A Dynamic Index Structure for Spatial Searching."
|
|
|
|
|
Proceedings of the 1984 ACM SIGMOD Int'l Conf on Mgmt of Data, 45-57.
|
|
|
|
|
|
|
|
|
|
You can also find this paper in Stonebraker's "Readings in Database
|
|
|
|
|
Systems".
|
|
|
|
|
|
|
|
|
|
Built-in R-trees can handle polygons and boxes. In theory, R-trees can
|
|
|
|
|
be extended to handle higher number of dimensions. In practice,
|
|
|
|
|
extending R-trees requires a bit of work and we don't currently have any
|
|
|
|
|
documentation on how to do it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.11) What is the Genetic Query Optimizer?
|
|
|
|
|
|
|
|
|
|
The GEQO module speeds query optimization when joining many tables by
|
|
|
|
|
means of a Genetic Algorithm (GA). It allows the handling of large join
|
|
|
|
|
queries through nonexhaustive search.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.12) How do I perform regular expression searches and
|
|
|
|
|
case-insensitive regular expression searches? How do I use an
|
|
|
|
|
index for case-insensitive searches?
|
|
|
|
|
|
|
|
|
|
The /~/ operator does regular expression matching, and /~*/ does
|
|
|
|
|
case-insensitive regular expression matching. The case-insensitive
|
|
|
|
|
variant of LIKE is called ILIKE.
|
|
|
|
|
|
|
|
|
|
Case-insensitive equality comparisons are normally expressed as:
|
|
|
|
|
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM tab
|
|
|
|
|
WHERE lower(col) = 'abc';
|
|
|
|
|
|
|
|
|
|
This will not use an standard index. However, if you create a functional
|
|
|
|
|
index, it will be used:
|
|
|
|
|
|
|
|
|
|
CREATE INDEX tabindex ON tab (lower(col));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.13) In a query, how do I detect if a field is NULL?
|
|
|
|
|
|
|
|
|
|
You test the column with IS NULL and IS NOT NULL.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.14) What is the difference between the various character types?
|
|
|
|
|
|
|
|
|
|
Type Internal Name Notes
|
|
|
|
|
--------------------------------------------------
|
|
|
|
|
VARCHAR(n) varchar size specifies maximum length, no padding
|
|
|
|
|
CHAR(n) bpchar blank padded to the specified fixed length
|
|
|
|
|
TEXT text no specific upper limit on length
|
|
|
|
|
BYTEA bytea variable-length byte array (null-byte safe)
|
|
|
|
|
"char" char one character
|
|
|
|
|
|
|
|
|
|
You will see the internal name when examining system catalogs and in
|
|
|
|
|
some error messages.
|
|
|
|
|
|
|
|
|
|
The first four types above are "varlena" types (i.e., the first four
|
|
|
|
|
bytes on disk are the length, followed by the data). Thus the actual
|
|
|
|
|
space used is slightly greater than the declared size. However, these
|
|
|
|
|
data types are also subject to compression or being stored out-of-line
|
|
|
|
|
by TOAST, so the space on disk might also be less than expected.
|
|
|
|
|
|
|
|
|
|
VARCHAR(n) is best when storing variable-length strings and it limits
|
|
|
|
|
how long a string can be. TEXT is for strings of unlimited length, with
|
|
|
|
|
a maximum of one gigabyte.
|
|
|
|
|
|
|
|
|
|
CHAR(n) is for storing strings that are all the same length. CHAR(n)
|
|
|
|
|
pads with blanks to the specified length, while VARCHAR(n) only stores
|
|
|
|
|
the characters supplied. BYTEA is for storing binary data, particularly
|
|
|
|
|
values that include NULL bytes. All the types described here have
|
|
|
|
|
similar performance characteristics.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.15.1) How do I create a serial/auto-incrementing field?
|
|
|
|
|
|
|
|
|
|
PostgreSQL supports a SERIAL data type. It auto-creates a sequence and
|
|
|
|
|
index on the column. For example, this:
|
|
|
|
|
|
|
|
|
|
CREATE TABLE person (
|
|
|
|
|
id SERIAL,
|
|
|
|
|
name TEXT
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
is automatically translated into this:
|
|
|
|
|
|
|
|
|
|
CREATE SEQUENCE person_id_seq;
|
|
|
|
|
CREATE TABLE person (
|
|
|
|
|
id INT4 NOT NULL DEFAULT nextval('person_id_seq'),
|
|
|
|
|
name TEXT
|
|
|
|
|
);
|
|
|
|
|
CREATE UNIQUE INDEX person_id_key ON person ( id );
|
|
|
|
|
|
|
|
|
|
See the /create_sequence/ manual page for more information about
|
|
|
|
|
sequences. You can also use each row's /OID/ field as a unique value.
|
|
|
|
|
However, if you need to dump and reload the database, you need to use
|
|
|
|
|
/pg_dump/'s /-o/ option or COPY WITH OIDS option to preserve the OIDs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.15.2) How do I get the value of a SERIAL insert?
|
|
|
|
|
|
|
|
|
|
One approach is to retrieve the next SERIAL value from the sequence
|
|
|
|
|
object with the /nextval()/ function /before/ inserting and then insert
|
|
|
|
|
it explicitly. Using the example table in 4.15.1 <#4.15.1>, an example
|
|
|
|
|
in a pseudo-language would look like this:
|
|
|
|
|
|
|
|
|
|
new_id = execute("SELECT nextval('person_id_seq')");
|
|
|
|
|
execute("INSERT INTO person (id, name) VALUES (new_id, 'Blaise Pascal')");
|
|
|
|
|
|
|
|
|
|
You would then also have the new value stored in |new_id| for use in
|
|
|
|
|
other queries (e.g., as a foreign key to the |person| table). Note that
|
|
|
|
|
the name of the automatically created SEQUENCE object will be named
|
|
|
|
|
</table/>_</serialcolumn/>_/seq/, where /table/ and /serialcolumn/ are
|
|
|
|
|
the names of your table and your SERIAL column, respectively.
|
|
|
|
|
|
|
|
|
|
Alternatively, you could retrieve the assigned SERIAL value with the
|
|
|
|
|
/currval()/ function /after/ it was inserted by default, e.g.,
|
|
|
|
|
|
|
|
|
|
execute("INSERT INTO person (name) VALUES ('Blaise Pascal')");
|
|
|
|
|
new_id = execute("SELECT currval('person_id_seq')");
|
|
|
|
|
|
|
|
|
|
Finally, you could use the OID <#4.16> returned from the INSERT
|
|
|
|
|
statement to look up the default value, though this is probably the
|
|
|
|
|
least portable approach. In Perl, using DBI with Edmund Mergl's DBD::Pg
|
|
|
|
|
module, the oid value is made available via /$sth->{pg_oid_status}/
|
|
|
|
|
after /$sth->execute()/.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.15.3) Don't /currval()/ and /nextval()/ lead to a race
|
|
|
|
|
condition with other users?
|
|
|
|
|
|
|
|
|
|
No. /currval()/ returns the current value assigned by your backend, not
|
|
|
|
|
by all users.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.15.4) Why aren't my sequence numbers reused on transaction
|
|
|
|
|
abort? Why are there gaps in the numbering of my sequence/SERIAL
|
|
|
|
|
column?
|
|
|
|
|
|
|
|
|
|
To improve concurrency, sequence values are given out to running
|
|
|
|
|
transactions as needed and are not locked until the transaction
|
|
|
|
|
completes. This causes gaps in numbering from aborted transactions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.16) What is an OID? What is a TID?
|
|
|
|
|
|
|
|
|
|
OIDs are PostgreSQL's answer to unique row ids. Every row that is
|
|
|
|
|
created in PostgreSQL gets a unique OID. All OIDs generated during
|
|
|
|
|
/initdb/ are less than 16384 (from /include/access/transam.h/). All
|
|
|
|
|
user-created OIDs are equal to or greater than this. By default, all
|
|
|
|
|
these OIDs are unique not only within a table or database, but unique
|
|
|
|
|
within the entire PostgreSQL installation.
|
|
|
|
|
|
|
|
|
|
PostgreSQL uses OIDs in its internal system tables to link rows between
|
|
|
|
|
tables. These OIDs can be used to identify specific user rows and used
|
|
|
|
|
in joins. It is recommended you use column type OID to store OID values.
|
|
|
|
|
You can create an index on the OID field for faster access.
|
|
|
|
|
|
|
|
|
|
OIDs are assigned to all new rows from a central area that is used by
|
|
|
|
|
all databases. If you want to change the OID to something else, or if
|
|
|
|
|
you want to make a copy of the table, with the original OIDs, there is
|
|
|
|
|
no reason you can't do it:
|
|
|
|
|
|
|
|
|
|
CREATE TABLE new_table(old_oid oid, mycol int);
|
|
|
|
|
SELECT old_oid, mycol INTO new FROM old;
|
|
|
|
|
COPY new TO '/tmp/pgtable';
|
|
|
|
|
DELETE FROM new;
|
|
|
|
|
COPY new WITH OIDS FROM '/tmp/pgtable';
|
|
|
|
|
|
|
|
|
|
OIDs are stored as 4-byte integers, and will overflow at 4 billion. No
|
|
|
|
|
one has reported this ever happening, and we plan to have the limit
|
|
|
|
|
removed before anyone does.
|
|
|
|
|
|
|
|
|
|
TIDs are used to identify specific physical rows with block and offset
|
|
|
|
|
values. TIDs change after rows are modified or reloaded. They are used
|
|
|
|
|
by index entries to point to physical rows.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.17) What is the meaning of some of the terms used in PostgreSQL?
|
|
|
|
|
|
|
|
|
|
Some of the source code and older documentation use terms that have more
|
|
|
|
|
common usage. Here are some:
|
|
|
|
|
|
|
|
|
|
* table, relation, class
|
|
|
|
|
* row, record, tuple
|
|
|
|
|
* column, field, attribute
|
|
|
|
|
* retrieve, select
|
|
|
|
|
* replace, update
|
|
|
|
|
* append, insert
|
|
|
|
|
* OID, serial value
|
|
|
|
|
* portal, cursor
|
|
|
|
|
* range variable, table name, table alias
|
|
|
|
|
|
|
|
|
|
A list of general database terms can be found at:
|
|
|
|
|
http://hea-www.harvard.edu/MST/simul/software/docs/pkgs/pgsql/glossary/glossary.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.18) Why do I get the error /"ERROR: Memory exhausted in
|
|
|
|
|
AllocSetAlloc()"/?
|
|
|
|
|
|
|
|
|
|
You probably have run out of virtual memory on your system, or your
|
|
|
|
|
kernel has a low limit for certain resources. Try this before starting
|
|
|
|
|
/postmaster/:
|
|
|
|
|
|
|
|
|
|
ulimit -d 262144
|
|
|
|
|
limit datasize 256m
|
|
|
|
|
|
|
|
|
|
Depending on your shell, only one of these may succeed, but it will set
|
|
|
|
|
your process data segment limit much higher and perhaps allow the query
|
|
|
|
|
to complete. This command applies to the current process, and all
|
|
|
|
|
subprocesses created after the command is run. If you are having a
|
|
|
|
|
problem with the SQL client because the backend is returning too much
|
|
|
|
|
data, try it before starting the client.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.19) How do I tell what PostgreSQL version I am running?
|
|
|
|
|
|
|
|
|
|
From /psql/, type |SELECT version();|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.20) Why does my large-object operations get /"invalid large
|
|
|
|
|
obj descriptor"/?
|
|
|
|
|
|
|
|
|
|
You need to put |BEGIN WORK| and |COMMIT| around any use of a large
|
|
|
|
|
object handle, that is, surrounding |lo_open| ... |lo_close.|
|
|
|
|
|
|
|
|
|
|
Currently PostgreSQL enforces the rule by closing large object handles
|
|
|
|
|
at transaction commit. So the first attempt to do anything with the
|
|
|
|
|
handle will draw /invalid large obj descriptor/. So code that used to
|
|
|
|
|
work (at least most of the time) will now generate that error message if
|
|
|
|
|
you fail to use a transaction.
|
|
|
|
|
|
|
|
|
|
If you are using a client interface like ODBC you may need to set
|
|
|
|
|
|auto-commit off.|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.21) How do I create a column that will default to the current
|
|
|
|
|
time?
|
|
|
|
|
|
|
|
|
|
Use /CURRENT_TIMESTAMP/:
|
|
|
|
|
|
|
|
|
|
|CREATE TABLE test (x int, modtime timestamp DEFAULT CURRENT_TIMESTAMP );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.22) Why are my subqueries using |IN| so slow?
|
|
|
|
|
|
|
|
|
|
Currently, we join subqueries to outer queries by sequentially scanning
|
|
|
|
|
the result of the subquery for each row of the outer query. If the
|
|
|
|
|
subquery returns only a few rows and the outer query returns many rows,
|
|
|
|
|
|IN| is fastest. To speed up other queries, replace |IN| with |EXISTS|:
|
|
|
|
|
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM tab
|
|
|
|
|
WHERE col IN (SELECT subcol FROM subtab);
|
|
|
|
|
|
|
|
|
|
to:
|
|
|
|
|
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM tab
|
|
|
|
|
WHERE EXISTS (SELECT subcol FROM subtab WHERE subcol = col);
|
|
|
|
|
|
|
|
|
|
For this to be fast, |subcol| should be an indexed column. This
|
|
|
|
|
preformance problem will be fixed in 7.4.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.23) How do I perform an outer join?
|
|
|
|
|
|
|
|
|
|
PostgreSQL supports outer joins using the SQL standard syntax. Here are
|
|
|
|
|
two examples:
|
|
|
|
|
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM t1 LEFT OUTER JOIN t2 ON (t1.col = t2.col);
|
|
|
|
|
|
|
|
|
|
or
|
|
|
|
|
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM t1 LEFT OUTER JOIN t2 USING (col);
|
|
|
|
|
|
|
|
|
|
These identical queries join t1.col to t2.col, and also return any
|
|
|
|
|
unjoined rows in t1 (those with no match in t2). A RIGHT join would add
|
|
|
|
|
unjoined rows of t2. A FULL join would return the matched rows plus all
|
|
|
|
|
unjoined rows from t1 and t2. The word OUTER is optional and is assumed
|
|
|
|
|
in LEFT, RIGHT, and FULL joins. Ordinary joins are called INNER joins.
|
|
|
|
|
|
|
|
|
|
In previous releases, outer joins can be simulated using UNION and NOT
|
|
|
|
|
IN. For example, when joining /tab1/ and /tab2/, the following query
|
|
|
|
|
does an /outer/ join of the two tables:
|
|
|
|
|
|
|
|
|
|
SELECT tab1.col1, tab2.col2
|
|
|
|
|
FROM tab1, tab2
|
|
|
|
|
WHERE tab1.col1 = tab2.col1
|
|
|
|
|
UNION ALL
|
|
|
|
|
SELECT tab1.col1, NULL
|
|
|
|
|
FROM tab1
|
|
|
|
|
WHERE tab1.col1 NOT IN (SELECT tab2.col1 FROM tab2)
|
|
|
|
|
ORDER BY col1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.24) How do I perform queries using multiple databases?
|
|
|
|
|
|
|
|
|
|
There is no way to query a database other than the current one. Because
|
|
|
|
|
PostgreSQL loads database-specific system catalogs, it is uncertain how
|
|
|
|
|
a cross-database query should even behave.
|
|
|
|
|
|
|
|
|
|
/contrib/dblink/ allows cross-database queries using function calls. Of
|
|
|
|
|
course, a client can make simultaneous connections to different
|
|
|
|
|
databases and merge the results on the client side.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.25) How do I return multiple rows or columns from a function?
|
|
|
|
|
|
|
|
|
|
In 7.3, you can easily return multiple rows or columns from a function,
|
|
|
|
|
http://techdocs.postgresql.org/guides/SetReturningFunctions
|
|
|
|
|
<http://techdocs.postgresql.org/guides/SetReturningFunctions>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.26) Why can't I reliably create/drop temporary tables in
|
|
|
|
|
PL/PgSQL functions?
|
|
|
|
|
|
|
|
|
|
PL/PgSQL caches function contents, and an unfortunate side effect is
|
|
|
|
|
that if a PL/PgSQL function accesses a temporary table, and that table
|
|
|
|
|
is later dropped and recreated, and the function called again, the
|
|
|
|
|
function will fail because the cached function contents still point to
|
|
|
|
|
the old temporary table. The solution is to use EXECUTE for temporary
|
|
|
|
|
table access in PL/PgSQL. This will cause the query to be reparsed every
|
|
|
|
|
time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.27) What replication options are available?
|
|
|
|
|
|
|
|
|
|
There are several master/slave replication options available. These
|
|
|
|
|
allow only the master to make database changes and the slave can only do
|
|
|
|
|
database reads. The bottom of
|
|
|
|
|
http://gborg.PostgreSQL.org/genpage?replication_research
|
|
|
|
|
<http://gborg.postgresql.org/genpage?replication_research> lists them. A
|
|
|
|
|
multi-master replication solution is being worked on at
|
|
|
|
|
http://gborg.PostgreSQL.org/project/pgreplication/projdisplay.php
|
|
|
|
|
<http://gborg.postgresql.org/project/pgreplication/projdisplay.php>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.28) What encryption options are available?
|
|
|
|
|
|
|
|
|
|
* /contrib/pgcrypto/ contains many encryption functions for use in
|
|
|
|
|
SQL queries.
|
|
|
|
|
* The only way to encrypt transmission from the client to the server
|
|
|
|
|
is by using /hostssl/ in /pg_hba.conf/.
|
|
|
|
|
* Database user passwords are automatically encrypted when stored in
|
|
|
|
|
version 7.3. In previous versions, you must enable the option
|
|
|
|
|
/PASSWORD_ENCRYPTION/ in /postgresql.conf/.
|
|
|
|
|
* The server can run using an encrypted file system.
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Extending PostgreSQL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5.1) I wrote a user-defined function. When I run it in /psql/,
|
|
|
|
|
why does it dump core?
|
|
|
|
|
|
|
|
|
|
The problem could be a number of things. Try testing your user-defined
|
|
|
|
|
function in a stand-alone test program first.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5.2) How can I contribute some nifty new types and functions to
|
|
|
|
|
PostgreSQL?
|
|
|
|
|
|
|
|
|
|
Send your extensions to the /pgsql-hackers/ mailing list, and they will
|
|
|
|
|
eventually end up in the /contrib// subdirectory.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5.3) Bir tuple d<>nd<6E>rmek i<>in bir C fonksiyonunu nas<61>l yazar<61>m?
|
|
|
|
|
|
|
|
|
|
PostgreSQL 7.3 s<>r<EFBFBD>m<EFBFBD> ile birlikte, C, PL/PgSQL ve SQL kullan<61>larak
|
|
|
|
|
tablo-d<>nd<6E>ren fonksiyonlar tamamen desteklenmektedir. Ayr<79>nt<6E>l<EFBFBD> bilgi
|
|
|
|
|
i<EFBFBD>in "Programmer's Guide" a bakabilrisiniz. Bir <20>rne<6E>i
|
|
|
|
|
/contrib/tablefunc/ i<>inde bulabilirsiniz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5.4) Bir kaynak dosyas<61>nda de<64>i<EFBFBD>iklik yapt<70>m. Yeniden derlememe
|
|
|
|
|
ra<72>men de<64>i<EFBFBD>iklik ge<67>erli olmuyor. Neden?
|
|
|
|
|
|
|
|
|
|
/Makefile'lar/ include dosyalar<61> i<>in tam bir ba<62><61>ml<6D>l<EFBFBD>k i<>ermezler.
|
|
|
|
|
<EFBFBD>ncelikle /make clean/, ard<72>ndan da baska bir /make/ i<>lemi yapman<61>z
|
|
|
|
|
gerekir. GCC kullan<61>yorsaniz, /configure/ beti<74>inin /--enable-depend/
|
|
|
|
|
se<EFBFBD>ene<EFBFBD>ini, derleyicinin ba<62><61>ml<6D>l<EFBFBD>klar<61> otomatik olarak hesaplamas<61> i<>in
|
|
|
|
|
kullanabilirsiniz.
|
|
|
|
|
|