summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2005-05-16 02:50:58 +0000
committerBruce Momjian2005-05-16 02:50:58 +0000
commit390d460138b66a3dddd4fc6288366c3ddbe0c710 (patch)
tree866d40b60ad3a52cd6925787082cd4c9a0a9de85
parentfd4d6853b71aa079bd1dcaf2f6c1af301f4ba96e (diff)
Update Chinese FAQ to xhtml.
-rw-r--r--doc/FAQ_DEV59
-rw-r--r--doc/FAQ_chinese15
-rw-r--r--doc/src/FAQ/FAQ_DEV.html55
-rw-r--r--doc/src/FAQ/FAQ_chinese.html1569
4 files changed, 819 insertions, 879 deletions
diff --git a/doc/FAQ_DEV b/doc/FAQ_DEV
index 21cf7ab11f4..9b74eb855e9 100644
--- a/doc/FAQ_DEV
+++ b/doc/FAQ_DEV
@@ -1,7 +1,7 @@
Developer's Frequently Asked Questions (FAQ) for PostgreSQL
- Last updated: Fri May 6 13:47:54 EDT 2005
+ Last updated: Sat May 14 12:26:01 EDT 2005
Current maintainer: Bruce Momjian ([email protected])
@@ -15,8 +15,8 @@ General Questions
1.2) What development environment is required to develop code?
1.3) What areas need work?
1.4) What do I do after choosing an item to work on?
- 1.5) Where can I learn more about the code?
- 1.6) I've developed a patch, what next?
+ 1.5) I've developed a patch, what next?
+ 1.6) Where can I learn more about the code?
1.7) How do I download/update the current source tree?
1.8) How do I test my changes?
1.9) What tools are available for developers?
@@ -94,35 +94,42 @@ General Questions
Send an email to pgsql-hackers with a proposal for what you want to do
(assuming your contribution is not trivial). Working in isolation is
- not advisable: others may be working on the same TODO item; you may
- have misunderstood the TODO item; your approach may benefit from the
- review of others.
+ not advisable because others might be working on the same TODO item,
+ or you might have misunderstood the TODO item. In the email, discuss
+ both the internal implementation method you plan to use, and any
+ user-visible changes (new syntax, etc). For complex patches, it is
+ important to get community feeback on your proposal before starting
+ work. Failure to do so might mean your patch is rejected.
A web site is maintained for patches that are ready to be applied,
http://momjian.postgresql.org/cgi-bin/pgpatches, and those that are
being kept for the next release,
http://momjian.postgresql.org/cgi-bin/pgpatches2.
- 1.5) Where can I learn more about the code?
-
- Other than documentation in the source tree itself, you can find some
- papers/presentations discussing the code at
- http://www.postgresql.org/developer.
-
- 1.6) I've developed a patch, what next?
+ 1.5) I've developed a patch, what next?
Generate the patch in contextual diff format. If you are unfamiliar
- with this, you may find the script src/tools/makediff/difforig useful.
+ with this, you might find the script src/tools/makediff/difforig
+ useful.
Ensure that your patch is generated against the most recent version of
the code. If it is a patch adding new functionality, the most recent
- version is cvs HEAD; if it is a bug fix, this will be the most
+ version is CVS HEAD; if it is a bug fix, this will be the most
recently version of the branch which suffers from the bug (for more on
branches in PostgreSQL, see 1.15).
Finally, submit the patch to [email protected]. It will be
- reviewed by other contributors to the project and may be either
- accepted or sent back for further work.
+ reviewed by other contributors to the project and will be either
+ accepted or sent back for further work. Also, please try to include
+ documentation changes as part of the patch. If you can't do that, let
+ us know and we will manually update the documentation when the patch
+ is applied.
+
+ 1.6) Where can I learn more about the code?
+
+ Other than documentation in the source tree itself, you can find some
+ papers/presentations discussing the code at
+ http://www.postgresql.org/developer.
1.7) How do I download/update the current source tree?
@@ -130,7 +137,7 @@ General Questions
developers can just get the most recent source tree snapshot from
ftp://ftp.postgresql.org.
- Regular developers may want to take advantage of anonymous access to
+ Regular developers might want to take advantage of anonymous access to
our source code management system. The source tree is currently hosted
in CVS. For details of how to obtain the source from CVS see
http://developer.postgresql.org/docs/postgres/cvs.html.
@@ -156,7 +163,7 @@ General Questions
test suite. To do this, issue "make check" in the root directory of
the source tree. If any tests failure, investigate.
- If you've deliberately changed existing behavior, this change may
+ If you've deliberately changed existing behavior, this change might
cause a regression test failure but not any actual regression. If so,
you should also patch the regression test suite.
@@ -625,10 +632,10 @@ Technical Questions
values you want changed. It returns a palloc'ed tuple, which you pass
to heap_replace(). You can delete tuples by passing the tuple's t_self
to heap_destroy(). You use t_self for heap_update() too. Remember,
- tuples can be either system cache copies, which may go away after you
- call ReleaseSysCache(), or read directly from disk buffers, which go
- away when you heap_getnext(), heap_endscan, or ReleaseBuffer(), in the
- heap_fetch() case. Or it may be a palloc'ed tuple, that you must
+ tuples can be either system cache copies, which might go away after
+ you call ReleaseSysCache(), or read directly from disk buffers, which
+ go away when you heap_getnext(), heap_endscan, or ReleaseBuffer(), in
+ the heap_fetch() case. Or it may be a palloc'ed tuple, that you must
pfree() when finished.
2.2) Why are table, column, type, function, view names sometimes referenced
@@ -729,8 +736,8 @@ typedef struct nameData
routines in src/backend/nodes used to create, copy, read, and output
those structures (in particular, the files copyfuncs.c and
equalfuncs.c. Make sure you add support for your new field to these
- files. Find any other places the structure may need code for your new
- field. mkid is helpful with this (see 1.9).
+ files. Find any other places the structure might need code for your
+ new field. mkid is helpful with this (see 1.9).
2.5) Why do we use palloc() and pfree() to allocate memory?
@@ -786,7 +793,7 @@ typedef struct nameData
with debugging symbols, you can use a debugger to see what is
happening. Because the backend was not started from postmaster, it is
not running in an identical environment and locking/backend
- interaction problems may not be duplicated.
+ interaction problems might not be duplicated.
If the postmaster is running, start psql in one window, then find the
PID of the postgres process used by psql using SELECT
diff --git a/doc/FAQ_chinese b/doc/FAQ_chinese
index dd159e0b11d..e39c0c77a9f 100644
--- a/doc/FAQ_chinese
+++ b/doc/FAQ_chinese
@@ -88,11 +88,8 @@
4.22) Ϊʲôʹ�� IN ���Ӳ�ѯ��ô����
4.23) ��ν��� outer join �������ӣ���
4.24) ���ʹ���漰������ݿ�IJ�ѯ��
-
4.25) ����ú������ض��л���У�
-
4.26) Ϊʲô�� PL/PgSQL �����в��ܿɿ��ش�����ɾ����ʱ����
-
4.27) ����Щ���ݸ���ѡ�
4.28) ����Щ���ݼ���ѡ�
@@ -702,17 +699,13 @@
��ʹ��ͨ������������� LIKE �� ~ ʱ������ֻ�����ض��������ʹ�ã�
* �ַ����Ŀ�ʼ���ֱ�������ͨ�ַ�����Ҳ����˵��
-
* LIKE ģʽ������ % ��ͷ��
* ~ ���������ʽ��ģʽ������ ^ ��ͷ��
+ * �ַ���������ƥ�����ַ���ģʽ���ͷ������ [a-e]��
+ * ��Сд�޹صIJ��ң��� ILIKE �� ~* �Ȳ�ʹ���������������� 4.12
+ ���������������
+ * ���� initdb ʱ�������ȱʡ�ı������� C locale��
- �ַ���������ƥ�����ַ���ģʽ���ͷ������ [a-e]��
-
- ��Сд�޹صIJ��ң��� ILIKE �� ~* �Ȳ�ʹ���������������� 4.12
- ���������������
-
- ���� initdb ʱ�������ȱʡ�ı������� C locale��
-
4.9) ����β��ܿ�����ѯ�Ż��������������ҵIJ�ѯ�ģ�
�ο� EXPLAIN �ֲ�ҳ��
diff --git a/doc/src/FAQ/FAQ_DEV.html b/doc/src/FAQ/FAQ_DEV.html
index cc0f8ad142e..9a863498829 100644
--- a/doc/src/FAQ/FAQ_DEV.html
+++ b/doc/src/FAQ/FAQ_DEV.html
@@ -13,7 +13,7 @@
<H1>Developer's Frequently Asked Questions (FAQ) for
PostgreSQL</H1>
- <P>Last updated: Fri May 6 13:47:54 EDT 2005</P>
+ <P>Last updated: Sat May 14 12:26:01 EDT 2005</P>
<P>Current maintainer: Bruce Momjian (<A href=
@@ -34,8 +34,8 @@
<A href="#1.3">1.3</A>) What areas need work?<BR>
<A href="#1.4">1.4</A>) What do I do after choosing an item to
work on?<BR>
- <A href="#1.5">1.5</A>) Where can I learn more about the code?<BR>
- <A href="#1.6">1.6</A>) I've developed a patch, what next?<BR>
+ <A href="#1.5">1.5</A>) I've developed a patch, what next?<BR>
+ <A href="#1.6">1.6</A>) Where can I learn more about the code?<BR>
<A href="#1.7">1.7</A>) How do I download/update the current
source tree?<BR>
<A href="#1.8">1.8</A>) How do I test my changes?<BR>
@@ -139,9 +139,13 @@
<P>Send an email to pgsql-hackers with a proposal for what you want
to do (assuming your contribution is not trivial). Working in
- isolation is not advisable: others may be working on the same TODO
- item; you may have misunderstood the TODO item; your approach may
- benefit from the review of others.</P>
+ isolation is not advisable because others might be working on the same
+ TODO item, or you might have misunderstood the TODO item. In the
+ email, discuss both the internal implementation method you plan to
+ use, and any user-visible changes (new syntax, etc). For complex
+ patches, it is important to get community feeback on your proposal
+ before starting work. Failure to do so might mean your patch is
+ rejected.</P>
<P>A web site is maintained for patches that are ready to be applied,
<a href="http://momjian.postgresql.org/cgi-bin/pgpatches">
@@ -150,30 +154,33 @@
<a href="http://momjian.postgresql.org/cgi-bin/pgpatches2">
http://momjian.postgresql.org/cgi-bin/pgpatches2</a>.</P>
- <H3><A name="1.5">1.5</A>) Where can I learn more about the
- code?</H3>
-
- <P>Other than documentation in the source tree itself, you can find
- some papers/presentations discussing the code at <A href=
- "http://www.postgresql.org/developer">
- http://www.postgresql.org/developer</A>.</P>
-
- <H3><A name="1.6">1.6</A>) I've developed a patch, what next?</H3>
+ <H3><A name="1.5">1.5</A>) I've developed a patch, what next?</H3>
<P>Generate the patch in contextual diff format. If you are
- unfamiliar with this, you may find the script
+ unfamiliar with this, you might find the script
<I>src/tools/makediff/difforig</I> useful.</P>
<P>Ensure that your patch is generated against the most recent
version of the code. If it is a patch adding new functionality, the
- most recent version is cvs HEAD; if it is a bug fix, this will be
+ most recent version is CVS HEAD; if it is a bug fix, this will be
the most recently version of the branch which suffers from the bug
(for more on branches in PostgreSQL, see <A href=
"#1.15">1.15</A>).</P>
<P>Finally, submit the patch to [email protected]. It
- will be reviewed by other contributors to the project and may be
- either accepted or sent back for further work.</P>
+ will be reviewed by other contributors to the project and will be
+ either accepted or sent back for further work. Also, please try to
+ include documentation changes as part of the patch. If you can't do
+ that, let us know and we will manually update the documentation when
+ the patch is applied.</P>
+
+ <H3><A name="1.6">1.6</A>) Where can I learn more about the
+ code?</H3>
+
+ <P>Other than documentation in the source tree itself, you can find
+ some papers/presentations discussing the code at <A href=
+ "http://www.postgresql.org/developer">
+ http://www.postgresql.org/developer</A>.</P>
<H3><A name="1.7">1.7</A>) How do I download/update the current
source tree?</H3>
@@ -183,7 +190,7 @@
<A href=
"ftp://ftp.postgresql.org">ftp://ftp.postgresql.org</A>.</P>
- <P>Regular developers may want to take advantage of anonymous
+ <P>Regular developers might want to take advantage of anonymous
access to our source code management system. The source tree is
currently hosted in CVS. For details of how to obtain the source
from CVS see <A href=
@@ -214,7 +221,7 @@
investigate.</P>
<P>If you've deliberately changed existing behavior, this change
- may cause a regression test failure but not any actual regression.
+ might cause a regression test failure but not any actual regression.
If so, you should also patch the regression test suite.</P>
<P><B>Other run time testing</B></P>
@@ -769,7 +776,7 @@
delete tuples by passing the tuple's <I>t_self</I> to
<I>heap_destroy().</I> You use <I>t_self</I> for
<I>heap_update()</I> too. Remember, tuples can be either system
- cache copies, which may go away after you call
+ cache copies, which might go away after you call
<I>ReleaseSysCache()</I>, or read directly from disk buffers, which
go away when you <I>heap_getnext()</I>, <I>heap_endscan</I>, or
<I>ReleaseBuffer()</I>, in the <I>heap_fetch()</I> case. Or it may
@@ -904,7 +911,7 @@
to create, copy, read, and output those structures (in particular,
the files <I>copyfuncs.c</I> and <I>equalfuncs.c</I>. Make sure you
add support for your new field to these files. Find any other
- places the structure may need code for your new field. <I>mkid</I>
+ places the structure might need code for your new field. <I>mkid</I>
is helpful with this (see <A href="#1.9">1.9</A>).</P>
<H3><A name="2.5">2.5</A>) Why do we use <I>palloc</I>() and
@@ -969,7 +976,7 @@
symbols, you can use a debugger to see what is happening. Because
the backend was not started from <I>postmaster</I>, it is not
running in an identical environment and locking/backend interaction
- problems may not be duplicated.</P>
+ problems might not be duplicated.</P>
<P>If the <I>postmaster</I> is running, start <I>psql</I> in one
window, then find the <SMALL>PID</SMALL> of the <I>postgres</I>
diff --git a/doc/src/FAQ/FAQ_chinese.html b/doc/src/FAQ/FAQ_chinese.html
index 76fc5ed74fb..20b8b7ca17b 100644
--- a/doc/src/FAQ/FAQ_chinese.html
+++ b/doc/src/FAQ/FAQ_chinese.html
@@ -1,531 +1,441 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0063)file://I:\Wlzhang\MyDoc\postgresql\FAQcn.files\postgres-faq.htm -->
-<!-- saved from url=(0046)http://laser.zhengmai.com.cn/postgres-faq.html --><HTML><HEAD><TITLE>PostgreSQL
- FAQ-ch</TITLE>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=gb2312">
- <META content="Microsoft FrontPage 4.0" name="GENERATOR">
- </HEAD>
- <BODY aLink="#0000ff" bgColor="#ffffff" link="#ff0000" text="#000000" vLink="#a00000">
- <H1>PostgreSQL �������⣨FAQ��</H1>
- ������£�2003 �� 01 �� 06 �� ����һ 22:27:35 CST
- <P>Ŀǰά����Ա��Bruce Momjian (<A href="mailto:[email protected]">[email protected]</A>)
- <BR>
- ���İ�ά����Ա����ΰƽ ��[email protected]
- ��<P>���ĵ������°汾������<a href="http://www.postgresql.org/files/documentation/faqs/FAQ.html">http://www.postgresql.org/files/documentation/faqs/FAQ.html</a>
- �鿴��<P>����ϵͳƽ̨��ص�������<a href="http://www.postgresql.org/docs/faq/">http://www.postgresql.org/docs/faq/</a>��ش�<br>
- <HR>
- <CENTER>
- <H2>��������</H2>
- </CENTER>
- <a href="#1.1">1.1</a>)
- PostgreSQL ��ʲô������ô������
- <BR>
- <a href="#1.2">1.2</a>)
- PostgreSQL �İ�Ȩ��ʲô?
- <BR>
- <A href="#1.3">1.3</A>)
- PostgreSQL ������ʲô Unix ƽ̨�ϣ�
- <BR>
- <A href="#1.4">1.4</A>) ���õķ� Unix
- ƽ̨����Щ��
- <BR>
- <A href="#1.5">1.5</A>) �Ҵ������ܵõ�
- PostgreSQL��
- <BR>
- <A href="#1.6">1.6</A>) �Ҵ������ܵõ���
- PostgreSQL ��֧�֣�
- <BR>
- <A href="#1.7">1.7</A>)
- PostgreSQL ���µİ汾��ʲô��
- <BR>
- <A href="#1.8">1.8</A>) ����Щ���õ�
- PostgreSQL ���ĵ���
- <BR>
- <A href="#1.9">1.9</A>) ������˽���֪�� BUG
- ��ȱʧ�����ԣ�
- <BR>
- <A href="#1.10">1.10</A>) ��Ӧ������ѧϰ
- SQL ��
- <BR>
- <A href="#1.11">1.11</A>)
- PostgreSQL �� Y2K ���ݵ���
- <BR>
- <A href="#1.12">1.12</A>)
- ��Ӧ���������뿪�����飿
- <BR>
- <A href="#1.13">1.13</A>)
- ��Ӧ�������ύһ�� BUG ���棿
- <BR>
- <A href="#1.14">1.14</A>)
- PostgreSQL ������ DBMS ���������<br>
- <a href="#1.15">1.15</a>) ��Ӧ����������
- PostgreSQL ��
- <CENTER>
- <H2>�û��ͻ�������</H2>
- </CENTER>
- <A href="#2.1">2.1</A>) ��
- PostgreSQL �� ODBC ��������ô��
- <BR>
- <A href="#2.2">2.2</A>) ��ʲô���߿��԰�
- PostgreSQL ���� Web ҳ�棿
- <BR>
- <A href="#2.3">2.3</A>)
- PostgreSQL ӵ��ͼ���û�������
- <BR>
- <A href="#2.4">2.4</A>)
- ���ǿ�����ʲô���Ժ� PostgreSQL �򽻵���
- <CENTER>
- <H2>ϵͳ��������</H2>
- </CENTER>
- <a href="#3.1">3.1</a>) �������ܰ�
- PostgreSQL װ�� /usr/local/pgsql ����ĵط���
- <BR>
- <a href="#3.2">3.2</a>) ��������
- postmaster ʱ������<I> Bad System Call</I>��ϵͳ���ô����� Core Dumped ����Ϊʲô��
- <BR>
- <a href="#3.3">3.3</a>) ������ͼ����
- postmaster ʱ������ <I>IpcMemoryCreate</I> ����Ϊʲô��
- <BR>
- <a href="#3.4">3.4</a>) ������ͼ����
- postmaster ʱ������ <I>IpcSemaphoreCreate</I> ����Ϊʲô��
- <BR>
- <a href="#3.5">3.5</a>)
- ����ο��������������������ӣ�
- <BR>
- <a href="#3.6">3.6</a>)
- �������������ݿ������Ի�ø��õ����ܣ�
- <BR>
- <a href="#3.7">3.7</a>)
- PostgreSQL ����Ի��ʲô���ĵ������ԣ�
- <BR>
- <a href="#3.8">3.8</a>)
- Ϊʲô����ͼ���ӵ�¼ʱ�յ���Sorry, too many clients�� ��Ϣ��<br>
- <a href="#3.9">3.9</a>)
- pgsql_tmp Ŀ¼�ﶼ��Щʲô��<br>
- <a href="#3.10">3.10</a>) ΪʲôҪ������
- PostgreSQL �����汾ʱ�� dump �� restore ��
- <CENTER>
- <H2>��������</H2>
- </CENTER>
- <a href="#4.1">4.1</a>)
- �������α����ͨ�α�֮���������ʲô��
- <BR>
- <a href="#4.2">4.2</a>)
- ���ֻѡ��һ����ѯ�����ͷ���У�
- <BR>
- <a href="#4.3">4.3</a>)
- ����λ�ȡһ�����ݿ��б����б������������������� <I>psql </I>�￴���Ķ�����
- <BR>
- <a href="#4.4">4.4</a>)
- �����ӱ�����ɾ��һ�У�
- <BR>
- <a href="#4.5">4.5</a>)
- һ�У�һ������һ��������ߴ��Ƕ��٣�
- <BR>
- <a href="#4.6">4.6</a>)
- �洢һ�����͵��ı��ļ����������Ҫ���ٴ��̿ռ䣿
- <BR>
- <a href="#4.7">4.7</a>)
- ��β鿴�������������ݿ��Լ��û��Ķ��壿
- <BR>
- <a href="#4.8">4.8</a>)
- �ҵIJ�ѯ��������û������������Ϊʲô��
- <BR>
- <a href="#4.9">4.9</a>)
- ����β��ܿ�����ѯ�Ż��������������ҵIJ�ѯ�ģ�
- <BR>
- <a href="#4.10">4.10</a>) R-tree
- ������ʲô��
- <BR>
- <a href="#4.11">4.11</a>)
- ʲô�ǻ����ѯ�Ż���Genetic Query Optimization����
- <BR>
- <a href="#4.12">4.12</a>)
- ���������������ʽ�����ʹ�Сд�޹ص��������ʽ���ң����������������д�Сд�޹ز��ң�
- <BR>
- <a href="#4.13">4.13</a>)
- ��һ����ѯ����������һ���ֶ��Ƿ�Ϊ NULL��
- <BR>
- <a href="#4.14">4.14</a>)
- �����ַ�����֮����ʲô��ͬ��
- <BR>
- <a href="#4.15.1">4.15.1</a>)
- ����������һ�����к�/�Զ��������ֶΣ�
- <BR>
- <a href="#4.15.2">4.15.2</a>)
- ����λ��һ����������кŵ�ֵ��
- <BR>
- <a href="#4.15.3">4.15.3</a>) ʹ��
- currval() �� nextval() �ᵼ�º������û������������race condition����<br>
- <a href="#4.15.4">4.15.4</a>)
- Ϊʲô���������쳣��ֹ���������к��أ�Ϊʲô�����к��ֶε�ȡֵ�д��ڼ���أ�
- <BR>
- <a href="#4.16">4.16</a>) ʲô��
- OID��ʲô�� TID ��
- <BR>
- <a href="#4.17">4.17</a>)
- PostgreSQL ʹ�õ�һЩ����ĺ�����ʲô��
- <BR>
- <a href="#4.18">4.18</a>)
- Ϊʲô���յ�����<i>ERROR: Memory exhausted in AllocSetAlloc()</i>����<br>
- <a href="#4.19">4.19</a>)
- ����β���֪�������е� PostgreSQL �İ汾��
- <BR>
- <a href="#4.20">4.20</a>)
- Ϊʲô�ҵĴ����������´���<I>invalid large obj descriptor�����Ƿ��Ĵ������������</I>��
- <BR>
- <a href="#4.21">4.21</a>)
- ����δ���һ��ȱʡֵ�ǵ�ǰʱ����ֶΣ�
- <BR>
- <a href="#4.22">4.22</a>) Ϊʲôʹ�� <TT>IN</TT>
- ���Ӳ�ѯ��ô����
- <BR>
- <a href="#4.23">4.23</a>) ����
- outer join �������ӣ���<br>
- <a href="#4.24">4.24</a>)
- ���ʹ���漰������ݿ�IJ�ѯ��<br>
- <CENTER>
- </CENTER>
- <a href="#4.25">4.25</a>)
- ����ú������ض��л���У�<br>
- <CENTER>
- </CENTER>
- <a href="#4.26">4.26</a>) Ϊʲô��
- PL/PgSQL �����в��ܿɿ��ش�����ɾ����ʱ����<br>
- <CENTER>
- </CENTER>
- <a href="#4.27">4.27</a>)
- ����Щ���ݸ���ѡ�<br>
- <a href="#4.28">4.28</a>)
- ����Щ���ݼ���ѡ�
- <CENTER>
- <H2>��չ PostgreSQL</H2>
- </CENTER>
- <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>
- <CENTER>
- <H2>��������</H2>
- </CENTER>
- <H4><A name="1.1"></A>1.1) PostgreSQL ��ʲô������ô������</H4>
- PostgreSQL ���� <I>Post-Gres-Q-L</I><i> ��</i>
- <p>PostgreSQL ����һ�� DBMS ���о�ԭ�� POSTGRES ���ݿ����ϵͳ����ǿ�档PostgreSQL �ڱ��� POSTGRES
- ��ǿ�������ģ�ͺͷḻ���������͵Ļ����ϣ���һ����չ�˵� SQL �Ӽ�ȡ����ԭ�ȵ� PostQuel ��ѯ���ԡ�PostgreSQL
- �����ɵIJ�������Դ���붼���Ի�á�</p>
- <P>PostgreSQL �Ŀ����ɲμ� PostgreSQL �����ʼ��б���һ��������ԱС����С�Ŀǰ��Э������ Marc G. Fournier ��<A href="mailto:[email protected]">[email protected]</A>
- ������������μ���μ�1.6�ڣ�������������ڸ��� PostgreSQL �����п�����
- <P>
- PostgreSQL 1.01 �������� Andrew Yu �� Jolly
- Chen����������������Ϊ��ֲ�����ԣ����Ժ���ǿ�������˴������ס�PostgreSQL �������Դ Postgres�����ڼ��ݴ�ѧ��������У�� Michael
- Stonebraker ���ڵ�ָ���£��������о������������ͱ��ְԱ��ɵġ�
- <P>�����������ڲ������������� Postgres���� 1995 �꣬�������� SQL ���ܺ��������ָij� Postgres95���� 1996��ĩ���Ÿ���Ϊ
- PostgreSQL��
- <H4><A name="1.2"></A>1.2) PostgreSQL �İ�Ȩ��ʲô?</H4>
- PostgreSQL ������İ�ȨԼ����
- <P>
- PostgreSQL ���ݿ����ϵͳ
- <P>
- ��PostgreSQL Data Base Management System��<P>���ְ�Ȩ��c��1996-2002��PostgreSQL ȫ�򿪷�С��<br>
- ���ְ�Ȩ��c��1994-6 ���ݴ�ѧ����
- <P>��Portions copyright (c) 1996-2002, PostgreSQL Global Development Group<br>
- &nbsp;Portions Copyright (c) 1994-6 Regents of the University of California��
- <P>
- ����Ϊ�κ�Ŀ��ʹ�ã��������޸ĺͷַ���������������ĵ�������ȡ�κη��ã���������ǩ����˶�������֤����ǰ��������İ�Ȩ�����ͱ����Լ������������ֳ��������п����С�
- <P>
- ��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.��
- <P>
- ���κ�����£����ݴ�ѧ�����е���ʹ�ô����������ĵ������µĶ��κε����˵�ֱ�ӵģ���ӵģ�����ģ����ӵĻ������������𻵣�����������ʧ�����Σ���ʹ���ݴ�ѧ�Ѿ���������Щ��ʧ�Ŀ�����ʱҲ����ˡ�
- <P>
- ��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.��
- <P>
- ���ݴ�ѧ��ȷ�����κα�֤����������������ijһ�ض���;����ҵ�������������֤�������ṩ����������ǻ��ڡ������ǡ��Ļ����ģ�������ݴ�ѧû�������ṩά����֧�֣����£���ǿ�����޸ĵķ���<P>��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.��<br>
- <br>
- ������� BSD ��Ȩ������һ������Ŀ�Դ��Ȩ����������Դ�����ʹ��δ���κ����ơ�����ϲ�������Ҳ�����ı�����
- <H4><A name="1.3"></A>1.3) PostgreSQL ������ʲô Unix ƽ̨�ϣ�</H4>
- <p>һ��˵����һ���ִ��� UNIX ���ݵ�ƽ̨�������� PostgreSQL ���ڰ�װָ�����г��˷���ʱ������ȷ���Ե�ƽ̨��</p>
- <UL>
- </UL>
- <H4><A name="1.4"></A>1.4) ���õķ� Unix ƽ̨����Щ��</H4>
- �ͻ���
- <p>�� libpq C �⣬psql�������ӿںͿͻ���Ӧ�ó������ɿ����� MS Windows ƽ̨�������ǿ��ܵġ���������£��ͻ����� MS Windows
- �����У�����ͨ�� TCP/IP ��һ������������֧�ֵ� Unix ƽ̨�ϵķ���������ͨѶ�������汾�а���һ���ļ� win32.mak �������� Win32
- libpq ��� psql ��PostgreSQL Ҳ���Ժ� ODBC �ͻ���ͨѶ��</p>
- <p>������</p>
- <P>���ݿ���������ڿ���ͨ�� Cygwin ��Cygnus �� Unix/NT ��ֲ���� Windows NT �� Win2k �����С����ķ����汾��� See <i>pgsql/doc/FAQ_MSWIN</i>
- ��� <a href="http://www.PostgreSQL.org/docs/faq-mswin.html">http://www.PostgreSQL.org/docs/faq-mswin.html</a>
- ��
- <P>��ֲ�� MS Win NT/2000/XP �ı�����Ĺ������ڽ��С�
- <H4><A name="1.5"></A>1.5) �Ҵ������ܵõ� PostgreSQL��</H4>
- <P>PostgreSQL ��������FTPվ���� <a href="ftp://ftp.PostgreSQL.org/pub">ftp://ftp.PostgreSQL.org/pub</a>������վ����Բο�������վ����ҳ��
- <H4><A name="1.6"></A>1.6) �Ҵ������ܵõ��� PostgreSQL ��֧�֣�</H4>
- <P>��Ҫ���ʼ��б��ǣ�<A href="mailto:[email protected]">[email protected]</A>�����������������й�
- PostgreSQL �����⡣Ҫ�����б�����һ���ʼ����ݣ����������У�Ϊ
- <PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; subscribe
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end</PRE>
- ���ʼ��� <A href="mailto:[email protected]">[email protected]</A>
- ��
- <P>�����Ի�ȡժҪ�б���Ҫ��������б������ʼ�����<A href="mailto:[email protected]">[email protected]</A>��������Ϊ��
- <PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; subscribe
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end</PRE>
- ÿ�����б��ﵽ��Լ 30k ����Ϣ����ʱ��ժҪ�ͷ��͸�����б��ij�Ա��
- <P>�����Բμӳ����ʼ��б���Ҫ��������б�������һ���ʼ��� <A href="mailto:[email protected]">[email protected]</A>������Ϊ��
- <PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; subscribe
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end</PRE>
- �����Բμӿ�����Ա�ʼ��б���Ҫ��������б�������һ���ʼ��� <A href="mailto:[email protected]">[email protected]</A>������Ϊ��
- <PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; subscribe
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end</PRE>
- �����Ĺ��� PostgreSQL �ʼ��б���������Ϣ������ PostgreSQL �� WWW ��ҳ�ҵ��� <BLOCKQUOTE><A href="http://postgresql.org/">http://postgresql.org/</A></BLOCKQUOTE>
- �� EFNet �ﻹ��һ�� IRC Ƶ����Ƶ�� #PostgreSQL������ unix ����<TT>irc -c '#PostgreSQL' "$USER"
- irc.phoenix.net</TT>
- <P>��ҵ֧�ֹ�˾���б��� <a href="http://www.PostgreSQL.org/users-lounge/commercial-support.html">http://www.PostgreSQL.org/users-lounge/commercial-support.html</a>
- ��
- <H4><A name="1.7"></A>1.7) PostgreSQL ���µİ汾��ʲô��</H4>
- PostgreSQL ���µİ汾�ǰ汾 7.2.3������ע������Ӧ���� 7.3.1 �ˡ���
- <P>���Ǽƻ�ÿ�ĸ��·���һ����Ҫ�汾��
- <H4><A name="1.8"></A>1.8) ����Щ���õ� PostgreSQL ���ĵ���</H4>
- �ڷ���������һЩ�ֲᣬ�ֲ�ҳ��һЩС�IJ������ӡ��μ� /doc Ŀ¼������ע��ӦΪ $PGHOME/doc�����㻹����������� PostgreSQL
- ���ֲᣬ�� <a href="http://www.PostgreSQL.org/users-lounge/docs/">http://www.PostgreSQL.org/users-lounge/docs/</a>
- ��<P>����������&nbsp;PostgreSQL ���������ṩ���� <a href="http://www.PostgreSQL.org/docs/awbook.html">
- http://www.PostgreSQL.org/docs/awbook.html</a> �� <a href="http://www.commandprompt.com/ppbook/">
- http://www.commandprompt.com/ppbook/</a> ���� <a href="http://www.ca.PostgreSQL.org/books/">
- http://www.ca.PostgreSQL.org/books/</a> ���й��� PostgreSQL �Ŀɹ��鼮���б����� <a href="http://techdocs.PostgreSQL.org/">
- http://techdocs.PostgreSQL.org/</a>
- ���ռ����й� PostgreSQL �ļ������¡�
- <P><I>psql</I>
- ��һЩ������ \d �����ʾ�������ͣ����������������ۼ��ȵ���Ϣ��
- <P>���ǵ� web վ�����������ĵ���<H4><A name="1.9"></A>1.9)
- ������˽���֪�� BUG ��ȱʧ�����ԣ�</H4>
- PostgreSQL ֧��һ����չ�˵� SQL-92 ���Ӽ����������ǵ� <A href="http://www.postgresql.org/docs/todo.html">
- TODO</A> <A href="http://www.postgresql.org/docs/todo.html"></A>�б�����ȡһ����֪���棬ȱʧ���Ժ�δ���ƻ���
- <H4><A name="1.10"></A>1.10) ��Ӧ������ѧϰ SQL��</H4>
- �� <A href="http://www.postgresql.org/docs/awbook.html">http://www.postgresql.org/docs/awbook.html</A>
- �Ĺ��� PostgreSQL ������� SQL������ע�������ص������ˡ����� <a href="http://www.commandprompt.com/ppbook/">
- http://www.commandprompt.com/ppbook</a> ������һ������ PostgreSQL ���顣��<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&nbsp;</a>
- �� <a href="http://sqlcourse.com/">http://sqlcourse.com</a>
- ��һ�����������Ž̡̳�
- <P>��һ���� "Teach Yourself SQL in 21 Days, Second Edition"��21��ѧ��SQL���ڶ��棩���� <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, Bowman, Judith S., et al., Addison-Wesley �� </I>
- ��������<I> The Complete Reference SQL, Groff et al., McGraw-Hill ��</I>
- <H4><A name="1.11"></A>1.11) PostgreSQL �� Y2K ���ݵ���</H4>
- �ǣ����Ǻ����׿��� 2000 AD ֮��� 2000 BC ֮ǰ�����ڡ�
- <H4><A name="1.12"></A>1.12) ��Ӧ���������뿪�����飿</H4>
- ���ȣ��������µ�Դ���벢�Ķ����� web վ��򷢲����е� PostgreSQL �������ĵ�����Σ����� pgsql-hackers ��
- pgsql-patches �ʼ��б����������� pgsql-patches �ύ�������IJ�������
- <P>���ڴ����ʮ�������� PostgreSQL CVS �鵵 <FONT size="-1">COMMIT</FONT> ��Ȩ�ޡ����Ƕ��Ѿ��ύ�˷dz���������IJ����ˣ����������е��ύ�˺��Ѹ��Ͻ��࣬�����������������ύ�IJ������Ǹ������ġ�<H4><A name="1.13"></A>1.13)
- ��Ӧ�������ύһ��BUG���棿</H4>
- ����� <a href="http://www.PostgreSQL.org/bugs/bugs.php">http://www.PostgreSQL.org/bugs/bugs.php</a>
- �� PostgreSQL BugTool ҳ��, �������������ύһ��BUG�����ָ�ϡ�
- <P>ͬ��ҲҪ�������ǵ� ftp վ�� <A href="ftp://ftp.postgresql.org/pub">ftp://ftp.postgreSQL.org/pub</A>������û�и��µ�
- PostgreSQL �汾�򲹶���
- <H4><A name="1.14"></A>1.14) PostgreSQL ������ DBMS ���������</H4>
- ���������кü��ַ��������ԣ����ܣ��ɿ��ԣ�֧�ֺͼ۸�
- <DL>
- <DT><B>����</B>
- <DD>
- PostgreSQL ӵ�д������� DBMS
- ���������ԣ����磺�����Ӳ�ѯ������������ͼ������ο������Ժ͸��ӵ����ȡ����ǻ���һЩ����û�е����ԣ����û��������ͣ��̳У�����Ͷ�汾���п����Լ����������õȡ�
- <BR>
- &nbsp; <DT><B>����</B>
- <DD>
- PostgreSQL ���������úͿ�Դ�����ݿ�������Ƶ����ܡ���ijЩ�������ȽϿ죬������һЩ�������Ƚ������� MySQL ����������ݿ�ϵͳ�Ƚϣ�������
- insert/update ʱ������Ϊ����������������Ȼ MySQL �����������������<I>���� </I>����������κ����ԡ����ǵ���Ҫ�����ǿɿ��Ժ����ԣ�����������ÿ�η���ʱ���ϵظĽ����ܡ���һ������Ȥ����ҳ�Ƚ���
- PostgreSQL �� MySQL <A href="http://openacs.org/why-not-mysql.html">http://openacs.org/why-not-mysql.html</A>��<br>
- <DT><B>�ɿ���</B>
- <DD>
- ����֪�� DBMS �����ǿɿ��ģ���������һ���ö�û�С�����Ŭ��������������������Եģ��ȶ��ij������ٵĴ��롣ÿ���汾������һ���µ� beta
- ���ԣ��������ǵķ�����ʷ��ʾ���ǿ����ṩ�ȶ��ģ��ι̵ģ�����������ʹ�õİ汾�������������ⷽ�����������������ݿ��������൱�ġ�
- <BR>
- &nbsp; <DT><B>֧��</B>
- <DD>
- ���ǵ��ʼ��б��ṩһ���dz���Ŀ�����Ա���û������԰���������������κ����⡣���Dz��ܱ�֤�϶��ܽ�����⣬���֮�£����� DBMS
- Ҳ���������ܹ��ṩ���������ֱ���뿪����Ա���û�Ⱥ���ֲ��Դ����Ӵ��� PostgreSQL ��֧�ֱ����� DBMS
- ��Ҫ�á�����һЩ��ҵ�Ե�Ԥ��װ��֧�֣����Ը��ṩ����Щ��Ҫ���ˡ�������֧�� FAQ ���� 1.6 С�ڡ���
- <BR>
- &nbsp; <DT><B>�۸�</B>
- <DD>
- ���Ƕ��κ���;����ѣ��������úͷ�����Ŀ�ġ�����Բ������Ƶ�����IJ�Ʒ��������ǵĴ��룬������Щ����������İ�Ȩ������������ BSD ���İ�Ȩ�⡣
- </DL>
- <h4><a name="1.15"></a>1.15) ��Ӧ���������� PostgreSQL ��</h4>
- <p>�Դ�1996�꿪ʼ��PostgreSQL
- �Ѿ�����һ���������֯����ЩӦ�ù鹦�� Marc
- Fournier�����������˲�����Щ��һֱ���������֯��</p>
- <p>����һ����Դ��Ŀ��˵������������ʩ�Ƿdz���Ҫ�ġ����ܷ�ֹ���������ӳ���Ŀǰ���Ļ��ҡ�</p>
- <p>��Ȼ�������֯����ת�ɱ����ơ�ά����ǰ���и����¶ȵġ�һ���ԵĿ�֧������������Ĺ�˾�ܽ��о�����֧��������ҵ������� <a href="http://store.pgsql.com/shopping/">
- http://store.pgsql.com/shopping/</a> �������</p>
- <p>��Ȼ����ҳ�ἰ�� PostgreSQL ��˾����Щ������������֧�� PostgreSQL
- ��Ŀ����������������û���ض��Ĺ�˾�������Ը�⣬Ҳ�����ʼ�֧Ʊ����ϵ��ַ��</p>
- <HR>
- <CENTER>
- <H2>�û��ͻ�������</H2>
- </CENTER>
- <H4><A name="2.1"></A>2.1) �� PostgreSQL �� ODBC ����ô��</H4>
- ������ ODBC �������Ի�ã�PsqlODBC �� OpenLink ODBC.<P>������<a href="http://gborg.postgresql.org/project/psqlodbc/projdisplay.php">http://gborg.postgresql.org/project/psqlodbc/projdisplay.php</a>
- ���� PsqlODBC ��
- <P>OpenLink ODBC ���Դ� <A href="http://www.openlinksw.com/">http://www.openlinksw.com/</A>
- ��á��������ǵı�׼ ODBC �ͻ����������ݣ������������κ�����֧�ֵĿͻ���ƽ̨��Win, Mac, Unix, VMS����ʹ�� PostgreSQL
- ODBC��
- <P>���ǿ��ܽ������Ʒ���۸���Щ��Ҫ��ҵ֧�ֵ��û�������������һ�� freeware �������������İ汾���Եõ�����ѯ�� <A href="mailto:[email protected]">
- [email protected]</A>��
- <H4><A name="2.2"></A>2.2) ��ʲô���߿��԰� PostgreSQL ���� Web ҳ�棿</H4>
- һ�����������ݿ�Ϊ��̨��ͦ������ վ���ǣ�<a href="http://www.webreview.com">http://www.webreview.com</a>
- ��
- <P>���� Web ���ɣ�PHP ��һ�����õĽӿڡ����ڣ�<A href="http://www.php.net/">http://www.php.net/</A>
- ��
- <P>���ڸ��ӵ����񣬺ܶ��˲��� Perl �ӿں� CGI.pm �� mod_perl ��
- <H4><A name="2.3"></A>2.3) PostgreSQL ӵ��ͼ���û�������</H4>
- �ǵġ��м��������� PostgreSQL ��ͼ�νӿڡ�����PgAccess��<a href="http://www.pgaccess.com">http://www.pgaccess.com</a>)��PgAdmin
- II ��<a href="http://www.pgadmin.org">http://www.pgadmin.org</a>����������Win32����
- RHDB Admin (<a href="http://sources.redhat.com/rhdb/">http://sources.redhat.com/rhdb/</a>��
- �Լ� Rekall ��<a href="http://www.thekompany.com/products/rekall/">http://www.thekompany.com/products/rekall/</a>��
- ר�е�/proprietary)������PHPPgAdmin ��<a href="http://phppgadmin.sourceforge.net/">http://phppgadmin.sourceforge.net/��</a>
- ��һ������ web �� PostgreSQL ���ʽӿڡ�
- <p>������һ��������ͼ���û����棬��Ϊ PgAccess ����Ҳ����������������������ҳ�� <a href="http://www.pgaccess.org/">http://www.pgaccess.org/</a>��</p>
- <H4><A name="2.4"></A>2.4) ���ǿ�����ʲô���Ժ� PostgreSQL �򽻵���</H4>
- <p>��������еı�����Զ��з��� PostgreSQL �Ľӿڡ����������Ե���չģ���б���</p>
- <p>PostgreSQL �������а��������½ӿڣ�</p>
- <ul>
- <li>
- C (libpq)
- <li>
- Embedded C (ecpg)
- <li>
- Java (jdbc)
- <li>
- Python (PyGreSQL)
- <li>
- TCL (libpgtcl)</li>
- </ul>
- <p>�����Ľӿ��� <a href="http://gborg.postgresql.org">http://gborg.postgresql.org</a> �ϵ� <i>Drivers/Interfaces</i>
- С�ڡ�</p>
- <HR>
- <CENTER>
- <H2>ϵͳ��������</H2>
- </CENTER>
- <H4><A name="3.1"></A>3.1) �������ܰ� PostgreSQL װ�� /usr/local/pgsql ����ĵط���</H4>
- <p>������ configure ʱ���� --prefix ѡ�</p>
- <H4><A name="3.2"></A>3.2) �������� postmaster ʱ������<I> Bad System Call</I>��ϵͳ���ô����� Core
- Dumped ����Ϊʲô��</H4>
- <p>������Ǻܶ෽������⣬���ȼ�����ϵͳ�����Ƿ�֧�� System V ��չ��PostgreSQL ��Ҫ�ں�֧�ֹ����ڴ���źŵơ�</p>
- <H4><A name="3.3"></A>3.3) ������ͼ���� postmaster ʱ������ <I>IpcMemoryCreate</I> ����Ϊʲô��</H4>
- ��Ҫô��û�����ں�����ȷ���ù����ڴ棬Ҫô������Ҫ��������ں˵Ŀ��ù����ڴ档��Ҫ�Ĺ����ڴ���������ȡ���������ϵ�ṹ����������� postmaster
- ����ʱʹ�õĻ������ͺ�˽�����Ŀ���Դ����ϵͳ��ʹ��ȱʡ�������ͽ�����Ŀʱ����������Ҫ~1MB���йع����ڴ���źŵƵ���ϸ��Ϣ��ο� <a href="http://www.postgresql.org/idocs/index.php?kernel-resources.html">
- PostgreSQL Administrator's Guide</a> ��
- <H4><A name="3.4"></A>3.4) ������ͼ���� postmaster ʱ������ <I>IpcSemaphoreCreate</I> ����Ϊʲô��</H4>
- <p>���������Ϣ�� <I>IpcSemaphoreCreate: semget failed (No space left on device)</I>����ôԭ��������ں�û�������㹻���źŵ���Դ��Postgres
- ��ÿ��DZ�ڵĺ�̨���̶���Ҫһ���źŵơ�һ����ʱ�Ľ���������ԱȽ��ٵĺ�̨������������������ postmaster��ʹ�ÿ��� <I>-N</I> ��һ������ȱʡֵ
- 32 �IJ������� postmaster�������õĽ�������ǼӴ�����ں˵� <FONT size="-1">SEMMNS</FONT> �� <FONT size="-1">
- SEMMNI</FONT> ������</p>
- <p>�����ݿ�������ܴ�ʱ���źŵƲ����ÿ��ܵ���ϵͳ������</p>
- <P>���������Ϣ��������ʲô����������ܾ͸���û�����ں����������źŵ�֧�֡��йع����ڴ���źŵƵ���ϸ��Ϣ��ο� <a href="http://www.postgresql.org/idocs/index.php?kernel-resources.html">
- PostgreSQL Administrator's Guide</a> ��<H4><A name="3.5"></A>3.5)
- ����ο��������������������ӣ�</H4>
- <p>ȱʡʱ��PostgreSQL ֻ����ͨ�� unix ���׽������Ա��������ӡ�������ʹ�� <I>-i</I> �������� <I>postmaster</I>��<B>����</B>ͨ����Ӧ�ı༭
- <I>$PGDATA/pg_hba.conf</I> �ļ���������Ϊ������ host-based ������֤���������������Dz�������Ļ������ӵġ�����������
- TCP/IP ���ӡ�</p>
- <H4><A name="3.6"></A>3.6) �������������ݿ������Ի�ø��õ����ܣ�</H4>
- <p>��Ȼ���������Լ��ٲ�ѯ��<FONT size="-1">EXPLAIN</FONT> ����������۲� PostgreSQL
- ��ν�����IJ�ѯ���Լ�ʹ������Щ������</p>
- <P>�����������һ�� <FONT size="-1">INSERT</FONT>������ʹ�� <FONT size="-1">COPY</FONT> �����Դ������ķ�ʽ���С��������ȵ�����һ����
- <FONT size="-1">INSERT </FONT>��öࡣ��Σ�û�д��� <FONT size="-1">BEGIN WORK/COMMIT</FONT>
- �����֮�����䱻��Ϊ����ͬһ������������һ����������洦���������䡣�������Լ�����������Ķ��⿪����ͬ�����������������ݸı�ʱ����ɾ�����ؽ�������
- <P>���м������ڵ�ѡ�����ʹ�á������ͨ���� <I>-o -F</I> ѡ������ postmaster ����ֹ fsync()������������ÿ���������� <I>fsync()
- </I>
- ������ˢ�µ������ϡ�
- <P>
- �㻹����ʹ�� postmaster -B ѡ�����Ӻ�˽���ʹ�õĹ����ڴ滺�����Ŀ������������������õ�̫��postmaster
- �����޷���������Ϊ���Ѿ�����������ں��ڹ����ڴ�ռ��ϵ����ơ�ÿ���������� 8K ����ȱʡ 64 ����������<P>
- �㻹����ʹ�ú�̨���̵� -S ѡ��������ÿ����̨����������ʱ�����õ�����ڴ�������-S ֵ����K�ֽڼƵģ�ȱʡ�� 512 ��Ҳ����˵��512K����<P>�㻹����ʹ�� <FONT size="-1">
- CLUSTER</FONT> �������ѱ�������ݰ���ij���������оۼ���š����� CLUSTER ���ֲ�ҳ��ȡ����ϸ�ڡ�
- <H4><a name="3.7"></a>3.7) PostgreSQL ����Ի��ʲô���ĵ������ԣ�</H4>
- <p>PostgreSQL �м����������ڱ���״̬��Ϣ����Щ��Ϣ���ܶԵ�����;���а�����</p>
- <P>���ȣ�ͨ������ --enable-cassert ѡ������ configure���кܶ� <I>assert()</I>
- ��غ�̨���̺��ڷ���ijЩδ��Ԥ�ϵ�����ʱֹͣ�������С�
- <P>postmaster �� postgres ����һЩ���õ�ѡ����ȣ��������� postmaster
- ʱ��ȷ����ѱ�׼����ͱ�׼�������������һ����־�ļ���ȥ�ˣ���
- <PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd /usr/local/pgsql
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ./bin/postmaster &gt;server.log 2&gt;&amp;1 &amp;</PRE>
- �������� PostgreSQL ����Ŀ¼�����һ�� server.log �ļ�������ļ���������������������ʹ����������Ϣ��postmaster ��һ��
- -d ѡ���ѡ���������ǻ�ø����ϸ�ڻ㱨��-d ѡ�����һ�����ֱ������Լ�����Ҫ������Ǹߵĵ��Լ�����ܻ����ɾ޴����־�ļ���<P>��� postmaster
- û�����У������ֱ���������������� postgres ��̨���̣�Ȼ��ֱ�Ӽ��� SQL ��䡣����<B>ֻ</B>
- �Ƽ��ڵ��Ե�ʱ����ô�ɡ���ע����ʱ�û����޶����Ƿֺű�ʾ����β���������ŵ��Է��ű��룬�����ʹ��һ���������ۿ�������ʲô���顣��Ϊ��̨����û����
- postmaster �����ģ������Ǻ�ʵ�ʵ����л���һ�£���������/��̨����������ܲ������֡�
- <P>��� postmaster �Ѿ����У�����һ������������ <I>psql</I>��Ȼ���ҳ� <I>psql</I> ��Ӧ�� <I>postgres</I> ���̵�
- <FONT size="-1">PID</FONT>��ʹ��һ����������������� <I>postgres </I><FONT size="-1">PID</FONT>
- �ϡ�������ڵ����������öϵ㲢�Ҵ� <I>psql</I> ��ִ�в�ѯ��������ڵ��� <I>postgres</I> �����������������
- PGOPTIONS="-W n"��Ȼ������ <I>psql</I>�����������������ӳ� <I>n</I>
- �룬������Ϳ��Ը���һ�����������Ҹ�������˳��Ĺ��̡�
- <P>
- postgres ������ -s��-A���� -t ѡ������ڵ��Ժ����ܲ�����ʱ��dz����á�
- <P>�㻹���Դ� profiling ֧�ֱ����̨���Ա�۲���Щ����ռ�õ�ִ��ʱ��϶ࡣprofile �ļ������� pgsql/data/base/dbname
- Ŀ¼�¡��ͻ��� profile �ļ������ڿͻ��˵�ǰĿ¼�¡��� Linux ��֧�� profiling Ҫ�ڱ���ʱ����<i>-DLINUX_PROFILE </i>
- ��<H4><a name="3.8"></a>3.8)
- Ϊʲô����ͼ���ӵ�¼ʱ�յ���Sorry, too many clients����Ϣ��</H4>
- <p>����Ҫ���� postmaster ����ʱ֧�ֵIJ�����̨��������</p>
- <P>ȱʡ������ 32 ���̡������ͨ�������ʵ��� <I>-N</I> ֵ�������� postmaster ���������Ŀ�������޸� <i>postgresql.conf</i>
- ���
- <P>Ҫע�������� <I>-N</I> ����Ϊ���� 32�������ͬ������ <I>-B</I>��������ȱʡ�� 64��-B ���������� -N
- ������������Ϊ�˸��õ����ܿ���Ҫ���Ǹ�����Ҫ�󡣶��ڴ���Ŀ�ĺ�˽��̣�����ܻ��ᷢ���㻹��Ҫ�������� Unix
- �ں����ò���ֵ��Ҫ���Ķ������������ڴ������ߴ磬<FONT size="-1">SHMMAX</FONT>���źŵƵ������Ŀ��<FONT size="-1">SEMMNS</FONT>
- �� <FONT size="-1">SEMMNI</FONT>�����Ľ�������<FONT size="-1">NPROC</FONT>�����û�����������<FONT size="-1">MAXUPRC</FONT>���Լ����ļ��������Ŀ��<FONT size="-1">NFILE</FONT>
- �� <FONT size="-1">NINODE</FONT>
- ��Postgres �������ĺ�̨�����������Ƶ�ԭ����Ϊ��ȷ�����ϵͳ�����ù���Դ��<P>�� Postgres ���� 6.5 �İ汾������̨������ȱʡ��
- 64�����Ҷ������޸�������Ҫ�޸� <I>include/storage/sinvaladt.h</I> ��� MaxBackendId ������Ȼ������
- BUILD��
- <H4><a name="3.9"></a>3.9) pgsql_tmp Ŀ¼�ﶼ��Щʲô��</H4>
- <p>��Ŀ¼�±����˲�ѯִ�������ɵ���ʱ�ļ������磬�����ҪΪ���� <FONT size="-1">ORDER BY</FONT> ���������򣬲���������Ҫ�Ⱥ�̨��
- -S ���������ĸ���Ŀռ䣬��ô�ͻᴴ��һ����ʱ�ļ��������������ݡ�</p>
- <P>��ʱ�ļ�Ӧ���Զ�ɾ���������������������к�̨�����˾Ϳ�����������ֹͣ������ postmaster ����ɾ����Щ�ļ���
- <BR>
- <h4><a name="3.10"></a>3.10) ΪʲôҪ������ PostgreSQL �����汾ʱ�� dump �� restore ��</h4>
- <p>
- PostgreSQL �������ÿ��С�����������˽��ٵ��޸�,��˴� 7.2 ������ 7.2.1 ����Ҫ dump �� restore��������Ҫ�������������
- 7.2 �� 7.3��ͨ�����޸�ϵͳ�������ݱ����ڲ���ʽ����Щ�仯һ��Ƚϸ��ӣ�������Dz�ά�����ļ��������ݡ�dump
- �����ݰ���ͨ�õĸ�ʽ����������Ա����¼��ز�ʹ���µ��ڲ���ʽ��</p>
- <p>
- �����ļ���ʽû�б仯�������������� <i>pg_upgrade</i> �ű���������Ҫ�� dump �� restor������˵��script ��ָ�� <i>pg_upgrade</i>
- �Ըô������Ƿ���á�</p>
- <P>
- <HR>
- <CENTER>
- <H2>��������</H2>
- </CENTER>
- <H4><A name="4.1"></A>4.1)
- �������α����ͨ�α�֮���������ʲô��</H4>
- ���� <FONT size="-1">DECLARE</FONT> �ֲ�ҳ��ȡ��Ϣ��
- <H4><a name="4.2"></a>4.2)���ֻ <FONT size="-1">SELECT</FONT> һ����ѯ�����ͷ���У�</H4>
- ���� <FONT size="-1">FETCH</FONT>
- �ֲ�ҳ������ʹ�� SELECT ... LIMIT....
- <P>��ʹ��ֻ��Ҫ��ͷ�ļ��У�Ҳ���漰��������ѯ������ʹ�ô��� <FONT size="-1">ORDER BY</FONT> �IJ�ѯ�������һ�������� <FONT size="-1">
- ORDER BY</FONT> ƥ�䣬PostgreSQL ���ܾ�ֻ����Ҫ���ͷ������¼�����򽫶�������ѯ���д���ֱ��������Ҫ���С�
- <H4><a name="4.3"></a>4.3) ����λ�ȡһ�������б������������������� <I>psql</I> �￴���Ķ�����</H4>
- ������Ķ� <I>psql</I> ��Դ�����ļ�<I>pgsql/src/bin/psql/describe.c</I> ��������Ϊ���� psql
- �ķ�б������������ SQL ����㻹���Դ� <I>-E</I> ѡ������ <I>psql</I>������������ӡ��ִ����������������õIJ�ѯ��
- <H4><a name="4.4"></a>4.4) �����ӱ�����ɾ��һ�У�</H4>
- <P>7.3 �������� <FONT size="-1">ALTER TABLE DROP COLUMN</FONT>����֧�ִ���ܡ�����ǰ�İ汾�У�������������</P>
- <PRE> BEGIN;
+<!-- saved from url=(0046)http://laser.zhengmai.com.cn/postgres-faq.html -->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta name="generator" content="HTML Tidy for BSD/OS (vers 1st July 2002), see www.w3.org" />
+
+ <title>PostgreSQL FAQ-ch</title>
+ <meta http-equiv="Content-Type" content="text/html; CHARSET=gb2312" />
+ <meta content="Microsoft FrontPage 4.0" name="GENERATOR" />
+ </head>
+
+ <body alink="#0000ff" bgcolor="#ffffff" link="#ff0000" text="#000000" vlink="#A00000">
+ <h1>PostgreSQL �������⣨FAQ��</h1>
+ ������£�2003 �� 01 �� 06 �� ����һ 22:27:35 CST
+
+ <p>Ŀǰά����Ա��Bruce Momjian (<a href="mailto:[email protected]">[email protected]</a>)<br />
+ ���İ�ά����Ա����ΰƽ ��[email protected] ��</p>
+
+ <p>���ĵ������°汾������<a href="http://www.postgresql.org/files/documentation/faqs/FAQ.html">http://www.postgresql.org/files/documentation/faqs/FAQ.html</a> �鿴��</p>
+
+ <p>����ϵͳƽ̨��ص�������<a href="http://www.postgresql.org/docs/faq/">http://www.postgresql.org/docs/faq/</a>��ش�<br />
+ </p>
+ <hr />
+
+ <center>
+ <h2>��������</h2>
+ </center>
+ <a href="#1.1">1.1</a>) PostgreSQL ��ʲô������ô������ <br />
+ <a href="#1.2">1.2</a>) PostgreSQL �İ�Ȩ��ʲô? <br />
+ <a href="#1.3">1.3</a>) PostgreSQL ������ʲô Unix ƽ̨�ϣ� <br />
+ <a href="#1.4">1.4</a>) ���õķ� Unix ƽ̨����Щ�� <br />
+ <a href="#1.5">1.5</a>) �Ҵ������ܵõ� PostgreSQL�� <br />
+ <a href="#1.6">1.6</a>) �Ҵ������ܵõ��� PostgreSQL ��֧�֣� <br />
+ <a href="#1.7">1.7</a>) PostgreSQL ���µİ汾��ʲô�� <br />
+ <a href="#1.8">1.8</a>) ����Щ���õ� PostgreSQL ���ĵ��� <br />
+ <a href="#1.9">1.9</a>) ������˽���֪�� BUG ��ȱʧ�����ԣ� <br />
+ <a href="#1.10">1.10</a>) ��Ӧ������ѧϰ SQL �� <br />
+ <a href="#1.11">1.11</a>) PostgreSQL �� Y2K ���ݵ��� <br />
+ <a href="#1.12">1.12</a>) ��Ӧ���������뿪�����飿 <br />
+ <a href="#1.13">1.13</a>) ��Ӧ�������ύһ�� BUG ���棿 <br />
+ <a href="#1.14">1.14</a>) PostgreSQL ������ DBMS ���������<br />
+ <a href="#1.15">1.15</a>) ��Ӧ���������� PostgreSQL ��
+
+ <center>
+ <h2>�û��ͻ�������</h2>
+ </center>
+ <a href="#2.1">2.1</a>) �� PostgreSQL �� ODBC ��������ô�� <br />
+ <a href="#2.2">2.2</a>) ��ʲô���߿��԰� PostgreSQL ���� Web ҳ�棿 <br />
+ <a href="#2.3">2.3</a>) PostgreSQL ӵ��ͼ���û������� <br />
+ <a href="#2.4">2.4</a>) ���ǿ�����ʲô���Ժ� PostgreSQL �򽻵���
+
+ <center>
+ <h2>ϵͳ��������</h2>
+ </center>
+ <a href="#3.1">3.1</a>) �������ܰ� PostgreSQL װ�� /usr/local/pgsql ����ĵط��� <br />
+ <a href="#3.2">3.2</a>) �������� postmaster ʱ������ <i>Bad System Call</i>��ϵͳ���ô����� Core Dumped ����Ϊʲô�� <br />
+ <a href="#3.3">3.3</a>) ������ͼ���� postmaster ʱ������ <i>IpcMemoryCreate</i> ����Ϊʲô�� <br />
+ <a href="#3.4">3.4</a>) ������ͼ���� postmaster ʱ������ <i>IpcSemaphoreCreate</i> ����Ϊʲô�� <br />
+ <a href="#3.5">3.5</a>) ����ο��������������������ӣ� <br />
+ <a href="#3.6">3.6</a>) �������������ݿ������Ի�ø��õ����ܣ� <br />
+ <a href="#3.7">3.7</a>) PostgreSQL ����Ի��ʲô���ĵ������ԣ� <br />
+ <a href="#3.8">3.8</a>) Ϊʲô����ͼ���ӵ�¼ʱ�յ���Sorry, too many clients�� ��Ϣ��<br />
+ <a href="#3.9">3.9</a>) pgsql_tmp Ŀ¼�ﶼ��Щʲô��<br />
+ <a href="#3.10">3.10</a>) ΪʲôҪ������ PostgreSQL �����汾ʱ�� dump �� restore ��
+
+ <center>
+ <h2>��������</h2>
+ </center>
+ <a href="#4.1">4.1</a>) �������α����ͨ�α�֮���������ʲô�� <br />
+ <a href="#4.2">4.2</a>) ���ֻѡ��һ����ѯ�����ͷ���У� <br />
+ <a href="#4.3">4.3</a>) ����λ�ȡһ�����ݿ��б����б������������������� <i>psql</i> �￴���Ķ����� <br />
+ <a href="#4.4">4.4</a>) �����ӱ�����ɾ��һ�У� <br />
+ <a href="#4.5">4.5</a>) һ�У�һ������һ��������ߴ��Ƕ��٣� <br />
+ <a href="#4.6">4.6</a>) �洢һ�����͵��ı��ļ����������Ҫ���ٴ��̿ռ䣿 <br />
+ <a href="#4.7">4.7</a>) ��β鿴�������������ݿ��Լ��û��Ķ��壿 <br />
+ <a href="#4.8">4.8</a>) �ҵIJ�ѯ��������û������������Ϊʲô�� <br />
+ <a href="#4.9">4.9</a>) ����β��ܿ�����ѯ�Ż��������������ҵIJ�ѯ�ģ� <br />
+ <a href="#4.10">4.10</a>) R-tree ������ʲô�� <br />
+ <a href="#4.11">4.11</a>) ʲô�ǻ����ѯ�Ż���Genetic Query Optimization���� <br />
+ <a href="#4.12">4.12</a>) ���������������ʽ�����ʹ�Сд�޹ص��������ʽ���ң����������������д�Сд�޹ز��ң� <br />
+ <a href="#4.13">4.13</a>) ��һ����ѯ����������һ���ֶ��Ƿ�Ϊ NULL�� <br />
+ <a href="#4.14">4.14</a>) �����ַ�����֮����ʲô��ͬ�� <br />
+ <a href="#4.15.1">4.15.1</a>) ����������һ�����к�/�Զ��������ֶΣ� <br />
+ <a href="#4.15.2">4.15.2</a>) ����λ��һ����������кŵ�ֵ�� <br />
+ <a href="#4.15.3">4.15.3</a>) ʹ�� currval() �� nextval() �ᵼ�º������û������������race condition����<br />
+ <a href="#4.15.4">4.15.4</a>) Ϊʲô���������쳣��ֹ���������к��أ�Ϊʲô�����к��ֶε�ȡֵ�д��ڼ���أ� <br />
+ <a href="#4.16">4.16</a>) ʲô�� OID��ʲô�� TID �� <br />
+ <a href="#4.17">4.17</a>) PostgreSQL ʹ�õ�һЩ����ĺ�����ʲô�� <br />
+ <a href="#4.18">4.18</a>) Ϊʲô���յ�����<i>ERROR: Memory exhausted in AllocSetAlloc()</i>����<br />
+ <a href="#4.19">4.19</a>) ����β���֪�������е� PostgreSQL �İ汾�� <br />
+ <a href="#4.20">4.20</a>) Ϊʲô�ҵĴ����������´���<i>invalid large obj descriptor�����Ƿ��Ĵ������������</i>�� <br />
+ <a href="#4.21">4.21</a>) ����δ���һ��ȱʡֵ�ǵ�ǰʱ����ֶΣ� <br />
+ <a href="#4.22">4.22</a>) Ϊʲôʹ�� <tt>IN</tt> ���Ӳ�ѯ��ô���� <br />
+ <a href="#4.23">4.23</a>) ��ν��� outer join �������ӣ���<br />
+ <a href="#4.24">4.24</a>) ���ʹ���漰������ݿ�IJ�ѯ��<br />
+ <a href="#4.25">4.25</a>) ����ú������ض��л���У�<br />
+ <a href="#4.26">4.26</a>) Ϊʲô�� PL/PgSQL �����в��ܿɿ��ش�����ɾ����ʱ����<br />
+ <a href="#4.27">4.27</a>) ����Щ���ݸ���ѡ�<br />
+ <a href="#4.28">4.28</a>) ����Щ���ݼ���ѡ�
+
+ <center>
+ <h2>��չ PostgreSQL</h2>
+ </center>
+ <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 />
+
+ <center>
+ <h2>��������</h2>
+ </center>
+
+ <h4><a id="1.1" name="1.1"></a>1.1) PostgreSQL ��ʲô������ô������</h4>
+ PostgreSQL ���� <i>Post-Gres-Q-L</i> <i>��</i>
+
+ <p>PostgreSQL ����һ�� DBMS ���о�ԭ�� POSTGRES ���ݿ����ϵͳ����ǿ�档PostgreSQL �ڱ��� POSTGRES ��ǿ�������ģ�ͺͷḻ���������͵Ļ����ϣ���һ����չ�˵� SQL �Ӽ�ȡ����ԭ�ȵ� PostQuel ��ѯ���ԡ�PostgreSQL �����ɵIJ�������Դ���붼���Ի�á�</p>
+
+ <p>PostgreSQL �Ŀ����ɲμ� PostgreSQL �����ʼ��б���һ��������ԱС����С�Ŀǰ��Э������ Marc G. Fournier ��<a href="mailto:[email protected]">[email protected]</a> ������������μ���μ�1.6�ڣ�������������ڸ��� PostgreSQL �����п�����</p>
+
+ <p>PostgreSQL 1.01 �������� Andrew Yu �� Jolly Chen����������������Ϊ��ֲ�����ԣ����Ժ���ǿ�������˴������ס�PostgreSQL �������Դ Postgres�����ڼ��ݴ�ѧ��������У�� Michael Stonebraker ���ڵ�ָ���£��������о������������ͱ��ְԱ��ɵġ�</p>
+
+ <p>�����������ڲ������������� Postgres���� 1995 �꣬�������� SQL ���ܺ��������ָij� Postgres95���� 1996��ĩ���Ÿ���Ϊ PostgreSQL��</p>
+
+ <h4><a id="1.2" name="1.2"></a>1.2) PostgreSQL �İ�Ȩ��ʲô?</h4>
+ PostgreSQL ������İ�ȨԼ����
+
+ <p>PostgreSQL ���ݿ����ϵͳ</p>
+
+ <p>��PostgreSQL Data Base Management System��</p>
+
+ <p>���ְ�Ȩ��c��1996-2002��PostgreSQL ȫ�򿪷�С��<br />
+ ���ְ�Ȩ��c��1994-6 ���ݴ�ѧ����</p>
+
+ <p>��Portions copyright (c) 1996-2002, PostgreSQL Global Development Group<br />
+ �Portions Copyright (c) 1994-6 Regents of the University of California��</p>
+
+ <p>����Ϊ�κ�Ŀ��ʹ�ã��������޸ĺͷַ���������������ĵ�������ȡ�κη��ã���������ǩ����˶�������֤����ǰ��������İ�Ȩ�����ͱ����Լ������������ֳ��������п����С�</p>
+
+ <p>��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.��</p>
+
+ <p>���κ�����£����ݴ�ѧ�����е���ʹ�ô����������ĵ������µĶ��κε����˵�ֱ�ӵģ���ӵģ�����ģ����ӵĻ������������𻵣�����������ʧ�����Σ���ʹ���ݴ�ѧ�Ѿ���������Щ��ʧ�Ŀ�����ʱҲ����ˡ�</p>
+
+ <p>��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.��</p>
+
+ <p>���ݴ�ѧ��ȷ�����κα�֤����������������ijһ�ض���;����ҵ�������������֤�������ṩ����������ǻ��ڡ������ǡ��Ļ����ģ�������ݴ�ѧû�������ṩά����֧�֣����£���ǿ�����޸ĵķ���</p>
+
+ <p>��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.��<br />
+ <br />
+ ������� BSD ��Ȩ������һ������Ŀ�Դ��Ȩ����������Դ�����ʹ��δ���κ����ơ�����ϲ�������Ҳ�����ı�����</p>
+
+ <h4><a id="1.3" name="1.3"></a>1.3) PostgreSQL ������ʲô Unix ƽ̨�ϣ�</h4>
+
+ <p>һ��˵����һ���ִ��� UNIX ���ݵ�ƽ̨�������� PostgreSQL ���ڰ�װָ�����г��˷���ʱ������ȷ���Ե�ƽ̨��</p>
+
+ <h4><a id="1.4" name="1.4"></a>1.4) ���õķ� Unix ƽ̨����Щ��</h4>
+ �ͻ���
+
+ <p>�� libpq C �⣬psql�������ӿںͿͻ���Ӧ�ó������ɿ����� MS Windows ƽ̨�������ǿ��ܵġ���������£��ͻ����� MS Windows �����У�����ͨ�� TCP/IP ��һ������������֧�ֵ� Unix ƽ̨�ϵķ���������ͨѶ�������汾�а���һ���ļ� win32.mak �������� Win32 libpq ��� psql ��PostgreSQL Ҳ���Ժ� ODBC �ͻ���ͨѶ��</p>
+
+ <p>������</p>
+
+ <p>���ݿ���������ڿ���ͨ�� Cygwin ��Cygnus �� Unix/NT ��ֲ���� Windows NT �� Win2k �����С����ķ����汾��� See <i>pgsql/doc/FAQ_MSWIN</i> �ļ��� <a href="http://www.PostgreSQL.org/docs/faq-mswin.html">http://www.PostgreSQL.org/docs/faq-mswin.html</a> ��</p>
+
+ <p>��ֲ�� MS Win NT/2000/XP �ı�����Ĺ������ڽ��С�</p>
+
+ <h4><a id="1.5" name="1.5"></a>1.5) �Ҵ������ܵõ� PostgreSQL��</h4>
+
+ <p>PostgreSQL ��������FTPվ���� <a href="ftp://ftp.PostgreSQL.org/pub">ftp://ftp.PostgreSQL.org/pub</a>������վ����Բο�������վ����ҳ��</p>
+
+ <h4><a id="1.6" name="1.6"></a>1.6) �Ҵ������ܵõ��� PostgreSQL ��֧�֣�</h4>
+
+ <p>��Ҫ���ʼ��б��ǣ�<a href="mailto:[email protected]">[email protected]</a>�����������������й� PostgreSQL �����⡣Ҫ�����б�����һ���ʼ����ݣ����������У�Ϊ</p>
+<pre>
+ subscribe
+ end
+</pre>
+ ���ʼ��� <a href="mailto:[email protected]">[email protected]</a> ��
+
+ <p>�����Ի�ȡժҪ�б���Ҫ��������б������ʼ�����<a href="mailto:[email protected]">[email protected]</a>��������Ϊ��</p>
+<pre>
+ subscribe
+ end
+</pre>
+ ÿ�����б��ﵽ��Լ 30k ����Ϣ����ʱ��ժҪ�ͷ��͸�����б��ij�Ա��
+
+ <p>�����Բμӳ����ʼ��б���Ҫ��������б�������һ���ʼ��� <a href="mailto:[email protected]">[email protected]</a>������Ϊ��</p>
+<pre>
+ subscribe
+ end
+</pre>
+ �����Բμӿ�����Ա�ʼ��б���Ҫ��������б�������һ���ʼ��� <a href="mailto:[email protected]">[email protected]</a>������Ϊ��
+<pre>
+ subscribe
+ end
+</pre>
+ �����Ĺ��� PostgreSQL �ʼ��б���������Ϣ������ PostgreSQL �� WWW ��ҳ�ҵ���
+
+ <blockquote>
+ <a href="http://postgresql.org/">http://postgresql.org/</a>
+ </blockquote>
+ �� EFNet �ﻹ��һ�� IRC Ƶ����Ƶ�� #PostgreSQL������ unix ����<tt>irc -c '#PostgreSQL' "$USER" irc.phoenix.net</tt>
+
+ <p>��ҵ֧�ֹ�˾���б��� <a href="http://www.PostgreSQL.org/users-lounge/commercial-support.html">http://www.PostgreSQL.org/users-lounge/commercial-support.html</a> ��</p>
+
+ <h4><a id="1.7" name="1.7"></a>1.7) PostgreSQL ���µİ汾��ʲô��</h4>
+ PostgreSQL ���µİ汾�ǰ汾 7.2.3������ע������Ӧ���� 7.3.1 �ˡ���
+
+ <p>���Ǽƻ�ÿ�ĸ��·���һ����Ҫ�汾��</p>
+
+ <h4><a id="1.8" name="1.8"></a>1.8) ����Щ���õ� PostgreSQL ���ĵ���</h4>
+ �ڷ���������һЩ�ֲᣬ�ֲ�ҳ��һЩС�IJ������ӡ��μ� /doc Ŀ¼������ע��ӦΪ $PGHOME/doc�����㻹����������� PostgreSQL ���ֲᣬ�� <a href="http://www.PostgreSQL.org/users-lounge/docs/">http://www.PostgreSQL.org/users-lounge/docs/</a> ��
+
+ <p>���������ڠPostgreSQL ���������ṩ���� <a href="http://www.PostgreSQL.org/docs/awbook.html">http://www.PostgreSQL.org/docs/awbook.html</a> �� <a href="http://www.commandprompt.com/ppbook/">http://www.commandprompt.com/ppbook/</a> ���� <a href="http://www.ca.PostgreSQL.org/books/">http://www.ca.PostgreSQL.org/books/</a> ���й��� PostgreSQL �Ŀɹ��鼮���б����� <a href="http://techdocs.PostgreSQL.org/">http://techdocs.PostgreSQL.org/</a> ���ռ����й� PostgreSQL �ļ������¡�</p>
+
+ <p><i>psql</i> ��һЩ������ \d �����ʾ�������ͣ����������������ۼ��ȵ���Ϣ��</p>
+
+ <p>���ǵ� web վ�����������ĵ���</p>
+
+ <h4><a id="1.9" name="1.9"></a>1.9) ������˽���֪�� BUG ��ȱʧ�����ԣ�</h4>
+ PostgreSQL ֧��һ����չ�˵� SQL-92 ���Ӽ����������ǵ� <a href="http://www.postgresql.org/docs/todo.html">TODO</a> <a href="http://www.postgresql.org/docs/todo.html"></a>�б�����ȡһ����֪���棬ȱʧ���Ժ�δ���ƻ���
+
+ <h4><a id="1.10" name="1.10"></a>1.10) ��Ӧ������ѧϰ SQL��</h4>
+ �� <a href="http://www.postgresql.org/docs/awbook.html">http://www.postgresql.org/docs/awbook.html</a> �Ĺ��� PostgreSQL ������� SQL������ע�������ص������ˡ����� <a href="http://www.commandprompt.com/ppbook/">http://www.commandprompt.com/ppbook</a> ������һ������ PostgreSQL ���顣��<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>��һ���� "Teach Yourself SQL in 21 Days, Second Edition"��21��ѧ��SQL���ڶ��棩���� <a href="http://members.tripod.com/er4ebus/sql/index.htm">http://members.tripod.com/er4ebus/sql/index.htm</a></p>
+
+ <p>���ǵ������û�ϲ�� <i>The Practical SQL Handbook, Bowman, Judith S., et al., Addison-Wesley ��</i> �������� <i>The Complete Reference SQL, Groff et al., McGraw-Hill ��</i></p>
+
+ <h4><a id="1.11" name="1.11"></a>1.11) PostgreSQL �� Y2K ���ݵ���</h4>
+ �ǣ����Ǻ����׿��� 2000 AD ֮��� 2000 BC ֮ǰ�����ڡ�
+
+ <h4><a id="1.12" name="1.12"></a>1.12) ��Ӧ���������뿪�����飿</h4>
+ ���ȣ��������µ�Դ���벢�Ķ����� web վ��򷢲����е� PostgreSQL �������ĵ�����Σ����� pgsql-hackers �� pgsql-patches �ʼ��б����������� pgsql-patches �ύ�������IJ�������
+
+ <p>���ڴ����ʮ�������� PostgreSQL CVS �鵵 <font size="-1">COMMIT</font> ��Ȩ�ޡ����Ƕ��Ѿ��ύ�˷dz���������IJ����ˣ����������е��ύ�˺��Ѹ��Ͻ��࣬�����������������ύ�IJ������Ǹ������ġ�</p>
+
+ <h4><a id="1.13" name="1.13"></a>1.13) ��Ӧ�������ύһ��BUG���棿</h4>
+ ����� <a href="http://www.PostgreSQL.org/bugs/bugs.php">http://www.PostgreSQL.org/bugs/bugs.php</a> �� PostgreSQL BugTool ҳ��, �������������ύһ��BUG�����ָ�ϡ�
+
+ <p>ͬ��ҲҪ�������ǵ� ftp վ�� <a href="ftp://ftp.postgresql.org/pub">ftp://ftp.postgreSQL.org/pub</a>������û�и��µ� PostgreSQL �汾�򲹶���</p>
+
+ <h4><a id="1.14" name="1.14"></a>1.14) PostgreSQL ������ DBMS ���������</h4>
+ ���������кü��ַ��������ԣ����ܣ��ɿ��ԣ�֧�ֺͼ۸�
+
+ <dl>
+ <dt><b>����</b></dt>
+
+ <dd>PostgreSQL ӵ�д������� DBMS ���������ԣ����磺�����Ӳ�ѯ������������ͼ������ο������Ժ͸��ӵ����ȡ����ǻ���һЩ����û�е����ԣ����û��������ͣ��̳У�����Ͷ�汾���п����Լ����������õȡ�<br />
+ �</dd>
+
+ <dt><b>����</b></dt>
+
+ <dd>PostgreSQL ���������úͿ�Դ�����ݿ�������Ƶ����ܡ���ijЩ�������ȽϿ죬������һЩ�������Ƚ������� MySQL ����������ݿ�ϵͳ�Ƚϣ������� insert/update ʱ������Ϊ����������������Ȼ MySQL �����������������<i>����</i> ����������κ����ԡ����ǵ���Ҫ�����ǿɿ��Ժ����ԣ�����������ÿ�η���ʱ���ϵظĽ����ܡ���һ������Ȥ����ҳ�Ƚ��� PostgreSQL �� MySQL <a href="http://openacs.org/why-not-mysql.html">http://openacs.org/why-not-mysql.html</a>��<br />
+ </dd>
+
+ <dt><b>�ɿ���</b></dt>
+
+ <dd>����֪�� DBMS �����ǿɿ��ģ���������һ���ö�û�С�����Ŭ��������������������Եģ��ȶ��ij������ٵĴ��롣ÿ���汾������һ���µ� beta ���ԣ��������ǵķ�����ʷ��ʾ���ǿ����ṩ�ȶ��ģ��ι̵ģ�����������ʹ�õİ汾�������������ⷽ�����������������ݿ��������൱�ġ�<br />
+ �</dd>
+
+ <dt><b>֧��</b></dt>
+
+ <dd>���ǵ��ʼ��б��ṩһ���dz���Ŀ�����Ա���û������԰���������������κ����⡣���Dz��ܱ�֤�϶��ܽ�����⣬���֮�£����� DBMS Ҳ���������ܹ��ṩ���������ֱ���뿪����Ա���û�Ⱥ���ֲ��Դ����Ӵ��� PostgreSQL ��֧�ֱ����� DBMS ��Ҫ�á�����һЩ��ҵ�Ե�Ԥ��װ��֧�֣����Ը��ṩ����Щ��Ҫ���ˡ�������֧�� FAQ ���� 1.6 С�ڡ���<br />
+ �</dd>
+
+ <dt><b>�۸�</b></dt>
+
+ <dd>���Ƕ��κ���;����ѣ��������úͷ�����Ŀ�ġ�����Բ������Ƶ�����IJ�Ʒ��������ǵĴ��룬������Щ����������İ�Ȩ������������ BSD ���İ�Ȩ�⡣</dd>
+ </dl>
+
+ <h4><a id="1.15" name="1.15"></a>1.15) ��Ӧ���������� PostgreSQL ��</h4>
+
+ <p>�Դ�1996�꿪ʼ��PostgreSQL �Ѿ�����һ���������֯����ЩӦ�ù鹦�� Marc Fournier�����������˲�����Щ��һֱ���������֯��</p>
+
+ <p>����һ����Դ��Ŀ��˵������������ʩ�Ƿdz���Ҫ�ġ����ܷ�ֹ���������ӳ���Ŀǰ���Ļ��ҡ�</p>
+
+ <p>��Ȼ�������֯����ת�ɱ����ơ�ά����ǰ���и����¶ȵġ�һ���ԵĿ�֧������������Ĺ�˾�ܽ��о�����֧��������ҵ������� <a href="http://store.pgsql.com/shopping/">http://store.pgsql.com/shopping/</a> ���о�����</p>
+
+ <p>��Ȼ����ҳ�ἰ�� PostgreSQL ��˾����Щ������������֧�� PostgreSQL ��Ŀ����������������û���ض��Ĺ�˾�������Ը�⣬Ҳ�����ʼ�֧Ʊ����ϵ��ַ��</p>
+ <hr />
+
+ <center>
+ <h2>�û��ͻ�������</h2>
+ </center>
+
+ <h4><a id="2.1" name="2.1"></a>2.1) �� PostgreSQL �� ODBC ����ô��</h4>
+ ������ ODBC �������Ի�ã�PsqlODBC �� OpenLink ODBC.
+
+ <p>������<a href="http://gborg.postgresql.org/project/psqlodbc/projdisplay.php">http://gborg.postgresql.org/project/psqlodbc/projdisplay.php</a> ���� PsqlODBC ��</p>
+
+ <p>OpenLink ODBC ���Դ� <a href="http://www.openlinksw.com/">http://www.openlinksw.com/</a> ��á��������ǵı�׼ ODBC �ͻ����������ݣ������������κ�����֧�ֵĿͻ���ƽ̨��Win, Mac, Unix, VMS����ʹ�� PostgreSQL ODBC��</p>
+
+ <p>���ǿ��ܽ������Ʒ���۸���Щ��Ҫ��ҵ֧�ֵ��û�������������һ�� freeware �������������İ汾���Եõ�����ѯ�� <a href="mailto:[email protected]">[email protected]</a>��</p>
+
+ <h4><a id="2.2" name="2.2"></a>2.2) ��ʲô���߿��԰� PostgreSQL ���� Web ҳ�棿</h4>
+ һ�����������ݿ�Ϊ��̨��ͦ������ վ���ǣ�<a href="http://www.webreview.com">http://www.webreview.com</a> ��
+
+ <p>���� Web ���ɣ�PHP ��һ�����õĽӿڡ����ڣ�<a href="http://www.php.net/">http://www.php.net/</a> ��</p>
+
+ <p>���ڸ��ӵ����񣬺ܶ��˲��� Perl �ӿں� CGI.pm �� mod_perl ��</p>
+
+ <h4><a id="2.3" name="2.3"></a>2.3) PostgreSQL ӵ��ͼ���û�������</h4>
+ �ǵġ��м��������� PostgreSQL ��ͼ�νӿڡ�����PgAccess��<a href="http://www.pgaccess.com">http://www.pgaccess.com</a>)��PgAdmin II ��<a href="http://www.pgadmin.org">http://www.pgadmin.org</a>����������Win32���� RHDB Admin (<a href="http://sources.redhat.com/rhdb/">http://sources.redhat.com/rhdb/</a>�� �Լ� Rekall ��<a href="http://www.thekompany.com/products/rekall/">http://www.thekompany.com/products/rekall/</a>�� ר�е�/proprietary)������PHPPgAdmin ��<a href="http://phppgadmin.sourceforge.net/">http://phppgadmin.sourceforge.net/��</a> ��һ������ web �� PostgreSQL ���ʽӿڡ�
+
+ <p>������һ��������ͼ���û����棬��Ϊ PgAccess ����Ҳ����������������������ҳ�� <a href="http://www.pgaccess.org/">http://www.pgaccess.org/</a>��</p>
+
+ <h4><a id="2.4" name="2.4"></a>2.4) ���ǿ�����ʲô���Ժ� PostgreSQL �򽻵���</h4>
+
+ <p>��������еı�����Զ��з��� PostgreSQL �Ľӿڡ����������Ե���չģ���б���</p>
+
+ <p>PostgreSQL �������а��������½ӿڣ�</p>
+
+ <ul>
+ <li>C (libpq)</li>
+
+ <li>Embedded C (ecpg)</li>
+
+ <li>Java (jdbc)</li>
+
+ <li>Python (PyGreSQL)</li>
+
+ <li>TCL (libpgtcl)</li>
+ </ul>
+
+ <p>�����Ľӿ��� <a href="http://gborg.postgresql.org">http://gborg.postgresql.org</a> �ϵ� <i>Drivers/Interfaces</i> С�ڡ�</p>
+ <hr />
+
+ <center>
+ <h2>ϵͳ��������</h2>
+ </center>
+
+ <h4><a id="3.1" name="3.1"></a>3.1) �������ܰ� PostgreSQL װ�� /usr/local/pgsql ����ĵط���</h4>
+
+ <p>������ configure ʱ���� --prefix ѡ�</p>
+
+ <h4><a id="3.2" name="3.2"></a>3.2) �������� postmaster ʱ������ <i>Bad System Call</i>��ϵͳ���ô����� Core Dumped ����Ϊʲô��</h4>
+
+ <p>������Ǻܶ෽������⣬���ȼ�����ϵͳ�����Ƿ�֧�� System V ��չ��PostgreSQL ��Ҫ�ں�֧�ֹ����ڴ���źŵơ�</p>
+
+ <h4><a id="3.3" name="3.3"></a>3.3) ������ͼ���� postmaster ʱ������ <i>IpcMemoryCreate</i> ����Ϊʲô��</h4>
+ ��Ҫô��û�����ں�����ȷ���ù����ڴ棬Ҫô������Ҫ��������ں˵Ŀ��ù����ڴ档��Ҫ�Ĺ����ڴ���������ȡ���������ϵ�ṹ����������� postmaster ����ʱʹ�õĻ������ͺ�˽�����Ŀ���Դ����ϵͳ��ʹ��ȱʡ�������ͽ�����Ŀʱ����������Ҫ~1MB���йع����ڴ���źŵƵ���ϸ��Ϣ��ο� <a href="http://www.postgresql.org/idocs/index.php?kernel-resources.html">PostgreSQL Administrator's Guide</a> ��
+
+ <h4><a id="3.4" name="3.4"></a>3.4) ������ͼ���� postmaster ʱ������ <i>IpcSemaphoreCreate</i> ����Ϊʲô��</h4>
+
+ <p>���������Ϣ�� <i>IpcSemaphoreCreate: semget failed (No space left on device)</i>����ôԭ��������ں�û�������㹻���źŵ���Դ��Postgres ��ÿ��DZ�ڵĺ�̨���̶���Ҫһ���źŵơ�һ����ʱ�Ľ���������ԱȽ��ٵĺ�̨������������������ postmaster��ʹ�ÿ��� <i>-N</i> ��һ������ȱʡֵ 32 �IJ������� postmaster�������õĽ�������ǼӴ�����ں˵� <font size="-1">SEMMNS</font> �� <font size="-1">SEMMNI</font> ������</p>
+
+ <p>�����ݿ�������ܴ�ʱ���źŵƲ����ÿ��ܵ���ϵͳ������</p>
+
+ <p>���������Ϣ��������ʲô����������ܾ͸���û�����ں����������źŵ�֧�֡��йع����ڴ���źŵƵ���ϸ��Ϣ��ο� <a href="http://www.postgresql.org/idocs/index.php?kernel-resources.html">PostgreSQL Administrator's Guide</a> ��</p>
+
+ <h4><a id="3.5" name="3.5"></a>3.5) ����ο��������������������ӣ�</h4>
+
+ <p>ȱʡʱ��PostgreSQL ֻ����ͨ�� unix ���׽������Ա��������ӡ�������ʹ�� <i>-i</i> �������� <i>postmaster</i>��<b>����</b>ͨ����Ӧ�ı༭ <i>$PGDATA/pg_hba.conf</i> �ļ���������Ϊ������ host-based ������֤���������������Dz�������Ļ������ӵġ����������� TCP/IP ���ӡ�</p>
+
+ <h4><a id="3.6" name="3.6"></a>3.6) �������������ݿ������Ի�ø��õ����ܣ�</h4>
+
+ <p>��Ȼ���������Լ��ٲ�ѯ��<font size="-1">EXPLAIN</font> ����������۲� PostgreSQL ��ν�����IJ�ѯ���Լ�ʹ������Щ������</p>
+
+ <p>�����������һ�� <font size="-1">INSERT</font>������ʹ�� <font size="-1">COPY</font> �����Դ������ķ�ʽ���С��������ȵ�����һ���� <font size="-1">INSERT</font> ��öࡣ��Σ�û�д��� <font size="-1">BEGIN WORK/COMMIT</font> �����֮�����䱻��Ϊ����ͬһ������������һ����������洦���������䡣�������Լ�����������Ķ��⿪����ͬ�����������������ݸı�ʱ����ɾ�����ؽ�������</p>
+
+ <p>���м������ڵ�ѡ�����ʹ�á������ͨ���� <i>-o -F</i> ѡ������ postmaster ����ֹ fsync()������������ÿ���������� <i>fsync()</i> ������ˢ�µ������ϡ�</p>
+
+ <p>�㻹����ʹ�� postmaster -B ѡ�����Ӻ�˽���ʹ�õĹ����ڴ滺�����Ŀ������������������õ�̫��postmaster �����޷���������Ϊ���Ѿ�����������ں��ڹ����ڴ�ռ��ϵ����ơ�ÿ���������� 8K ����ȱʡ 64 ����������</p>
+
+ <p>�㻹����ʹ�ú�̨���̵� -S ѡ��������ÿ����̨����������ʱ�����õ�����ڴ�������-S ֵ����K�ֽڼƵģ�ȱʡ�� 512 ��Ҳ����˵��512K����</p>
+
+ <p>�㻹����ʹ�� <font size="-1">CLUSTER</font> �������ѱ�������ݰ���ij���������оۼ���š����� CLUSTER ���ֲ�ҳ��ȡ����ϸ�ڡ�</p>
+
+ <h4><a id="3.7" name="3.7"></a>3.7) PostgreSQL ����Ի��ʲô���ĵ������ԣ�</h4>
+
+ <p>PostgreSQL �м����������ڱ���״̬��Ϣ����Щ��Ϣ���ܶԵ�����;���а�����</p>
+
+ <p>���ȣ�ͨ������ --enable-cassert ѡ������ configure���кܶ� <i>assert()</i> ��غ�̨���̺��ڷ���ijЩδ��Ԥ�ϵ�����ʱֹͣ�������С�</p>
+
+ <p>postmaster �� postgres ����һЩ���õ�ѡ����ȣ��������� postmaster ʱ��ȷ����ѱ�׼����ͱ�׼�������������һ����־�ļ���ȥ�ˣ���</p>
+<pre>
+ cd /usr/local/pgsql
+ ./bin/postmaster &gt;server.log 2&gt;&amp;1 &amp;
+</pre>
+ �������� PostgreSQL ����Ŀ¼�����һ�� server.log �ļ�������ļ���������������������ʹ����������Ϣ��postmaster ��һ�� -d ѡ���ѡ���������ǻ�ø����ϸ�ڻ㱨��-d ѡ�����һ�����ֱ������Լ�����Ҫ������Ǹߵĵ��Լ�����ܻ����ɾ޴����־�ļ���
+
+ <p>��� postmaster û�����У������ֱ���������������� postgres ��̨���̣�Ȼ��ֱ�Ӽ��� SQL ��䡣����<b>ֻ</b> �Ƽ��ڵ��Ե�ʱ����ô�ɡ���ע����ʱ�û����޶����Ƿֺű�ʾ����β���������ŵ��Է��ű��룬�����ʹ��һ���������ۿ�������ʲô���顣��Ϊ��̨����û���� postmaster �����ģ������Ǻ�ʵ�ʵ����л���һ�£���������/��̨����������ܲ������֡�</p>
+
+ <p>��� postmaster �Ѿ����У�����һ������������ <i>psql</i>��Ȼ���ҳ� <i>psql</i> ��Ӧ�� <i>postgres</i> ���̵� <font size="-1">PID</font>��ʹ��һ����������������� <i>postgres</i> <font size="-1">PID</font> �ϡ�������ڵ����������öϵ㲢�Ҵ� <i>psql</i> ��ִ�в�ѯ��������ڵ��� <i>postgres</i> ����������������� PGOPTIONS="-W n"��Ȼ������ <i>psql</i>�����������������ӳ� <i>n</i> �룬������Ϳ��Ը���һ�����������Ҹ�������˳��Ĺ��̡�</p>
+
+ <p>postgres ������ -s��-A���� -t ѡ������ڵ��Ժ����ܲ�����ʱ��dz����á�</p>
+
+ <p>�㻹���Դ� profiling ֧�ֱ����̨���Ա�۲���Щ����ռ�õ�ִ��ʱ��϶ࡣprofile �ļ������� pgsql/data/base/dbname Ŀ¼�¡��ͻ��� profile �ļ������ڿͻ��˵�ǰĿ¼�¡��� Linux ��֧�� profiling Ҫ�ڱ���ʱ����<i>-DLINUX_PROFILE</i> ��</p>
+
+ <h4><a id="3.8" name="3.8"></a>3.8) Ϊʲô����ͼ���ӵ�¼ʱ�յ���Sorry, too many clients����Ϣ��</h4>
+
+ <p>����Ҫ���� postmaster ����ʱ֧�ֵIJ�����̨��������</p>
+
+ <p>ȱʡ������ 32 ���̡������ͨ�������ʵ��� <i>-N</i> ֵ�������� postmaster ���������Ŀ�������޸� <i>postgresql.conf</i> �ļ���</p>
+
+ <p>Ҫע�������� <i>-N</i> ����Ϊ���� 32�������ͬ������ <i>-B</i>��������ȱʡ�� 64��-B ���������� -N ������������Ϊ�˸��õ����ܿ���Ҫ���Ǹ�����Ҫ�󡣶��ڴ���Ŀ�ĺ�˽��̣�����ܻ��ᷢ���㻹��Ҫ�������� Unix �ں����ò���ֵ��Ҫ���Ķ������������ڴ������ߴ磬<font size="-1">SHMMAX</font>���źŵƵ������Ŀ��<font size="-1">SEMMNS</font> �� <font size="-1">SEMMNI</font>�����Ľ�������<font size="-1">NPROC</font>�����û�����������<font size="-1">MAXUPRC</font>���Լ����ļ��������Ŀ��<font size="-1">NFILE</font> �� <font size="-1">NINODE</font> ��Postgres �������ĺ�̨�����������Ƶ�ԭ����Ϊ��ȷ�����ϵͳ�����ù���Դ��</p>
+
+ <p>�� Postgres ���� 6.5 �İ汾������̨������ȱʡ�� 64�����Ҷ������޸�������Ҫ�޸� <i>include/storage/sinvaladt.h</i> ��� MaxBackendId ������Ȼ������ BUILD��</p>
+
+ <h4><a id="3.9" name="3.9"></a>3.9) pgsql_tmp Ŀ¼�ﶼ��Щʲô��</h4>
+
+ <p>��Ŀ¼�±����˲�ѯִ�������ɵ���ʱ�ļ������磬�����ҪΪ���� <font size="-1">ORDER BY</font> ���������򣬲���������Ҫ�Ⱥ�̨�� -S ���������ĸ���Ŀռ䣬��ô�ͻᴴ��һ����ʱ�ļ��������������ݡ�</p>
+
+ <p>��ʱ�ļ�Ӧ���Զ�ɾ���������������������к�̨�����˾Ϳ�����������ֹͣ������ postmaster ����ɾ����Щ�ļ���<br />
+ </p>
+
+ <h4><a id="3.10" name="3.10"></a>3.10) ΪʲôҪ������ PostgreSQL �����汾ʱ�� dump �� restore ��</h4>
+
+ <p>PostgreSQL �������ÿ��С�����������˽��ٵ��޸�,��˴� 7.2 ������ 7.2.1 ����Ҫ dump �� restore��������Ҫ������������� 7.2 �� 7.3��ͨ�����޸�ϵͳ�������ݱ����ڲ���ʽ����Щ�仯һ��Ƚϸ��ӣ�������Dz�ά�����ļ��������ݡ�dump �����ݰ���ͨ�õĸ�ʽ����������Ա����¼��ز�ʹ���µ��ڲ���ʽ��</p>
+
+ <p>�����ļ���ʽû�б仯�������������� <i>pg_upgrade</i> �ű���������Ҫ�� dump �� restor������˵��script ��ָ�� <i>pg_upgrade</i> �Ըô������Ƿ���á�</p>
+ <hr />
+
+ <center>
+ <h2>��������</h2>
+ </center>
+
+ <h4><a id="4.1" name="4.1"></a>4.1) �������α����ͨ�α�֮���������ʲô��</h4>
+ ���� <font size="-1">DECLARE</font> �ֲ�ҳ��ȡ��Ϣ��
+
+ <h4><a id="4.2" name="4.2"></a>4.2)���ֻ <font size="-1">SELECT</font> һ����ѯ�����ͷ���У�</h4>
+ ���� <font size="-1">FETCH</font> �ֲ�ҳ������ʹ�� SELECT ... LIMIT....
+
+ <p>��ʹ��ֻ��Ҫ��ͷ�ļ��У�Ҳ���漰��������ѯ������ʹ�ô��� <font size="-1">ORDER BY</font> �IJ�ѯ�������һ�������� <font size="-1">ORDER BY</font> ƥ�䣬PostgreSQL ���ܾ�ֻ����Ҫ���ͷ������¼�����򽫶�������ѯ���д���ֱ��������Ҫ���С�</p>
+
+ <h4><a id="4.3" name="4.3"></a>4.3) ����λ�ȡһ�������б������������������� <i>psql</i> �￴���Ķ�����</h4>
+ ������Ķ� <i>psql</i> ��Դ�����ļ�<i>pgsql/src/bin/psql/describe.c</i> ��������Ϊ���� psql �ķ�б������������ SQL ����㻹���Դ� <i>-E</i> ѡ������ <i>psql</i>������������ӡ��ִ����������������õIJ�ѯ��
+
+ <h4><a id="4.4" name="4.4"></a>4.4) �����ӱ�����ɾ��һ�У�</h4>
+
+ <p>7.3 �������� <font size="-1">ALTER TABLE DROP COLUMN</font>����֧�ִ���ܡ�����ǰ�İ汾�У�������������</p>
+<pre>
+ BEGIN;
LOCK TABLE old_table;
SELECT ... -- select all columns but the one you want to remove
INTO TABLE new_table
@@ -533,24 +443,31 @@
DROP TABLE old_table;
ALTER TABLE new_table RENAME TO old_table;
COMMIT;
-</PRE>
- <H4><a name="4.5"></a>4.5) һ�У�һ������һ��������ߴ��Ƕ��٣�</H4>
- ������һЩ���ƣ�<PRE> һ�����ݿ����ߴ磿&nbsp;&nbsp;&nbsp;�����ƣ����� 1TB �����ݿ⣩
- һ���������ߴ磿&nbsp;&nbsp;&nbsp; 16TB
- һ�е����ߴ磿&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.6TB
+</pre>
+
+ <h4><a id="4.5" name="4.5"></a>4.5) һ�У�һ������һ��������ߴ��Ƕ��٣�</h4>
+ ������һЩ���ƣ�
+<pre>
+ һ�����ݿ����ߴ磿 �����ƣ����� 1TB �����ݿ⣩
+ һ���������ߴ磿 16TB
+ һ�е����ߴ磿 1.6TB
һ���ֶε����ߴ�? 1GB
- һ���������������&nbsp;&nbsp;&nbsp;&nbsp; ������
- һ���������������&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;���������й�,250-1600
- һ��������������������������</PRE>
- ��Ȼ��ʵ����û�������������ƣ�����Ҫ�ܿ��ô��̿ռ䡢�����ڴ�/����������Լ��
- <P>
- �������ߴ� 16 TB ����Ҫ����ϵͳ�Դ��ļ���֧�֡�����ö�� 1
- GB ���ļ��洢������ļ�ϵͳ�ߴ�������Dz���Ҫ�ġ�
- <P>���ȱʡ�Ŀ��С������ 32K �����ı��ߴ����������������ӡ�</P>
- <H4><a name="4.6"></a>4.6)�洢һ�����͵�ƽ���ļ����������Ҫ���ٴ��̿ռ䣿</H4>
- һ�� Postgres ���ݿ���������Ҫ�൱����һ��ƽ���ļ���洢��ͬ���ݵ�5���Ĵ��̿ռ䡣
- <P>���磬������һ�� 100,000 �е��ļ���ÿ����һ��������һ���ı������������ı�����ƽ������λ20�ֽڡ�ƽ���ļ�ռ��&nbsp;2.8 MB�������Щ���ݵ�
- PostgreSQL ���ݿ��ļ���Լ�� 6.4 MB:<PRE> 36 �ֽ�: ÿ�е�ͷ������ֵ��
+ һ��������������� ������
+ һ��������������� ���������й�,250-1600
+ һ��������������������������
+</pre>
+ ��Ȼ��ʵ����û�������������ƣ�����Ҫ�ܿ��ô��̿ռ䡢�����ڴ�/����������Լ��
+
+ <p>�������ߴ� 16 TB ����Ҫ����ϵͳ�Դ��ļ���֧�֡�����ö�� 1 GB ���ļ��洢������ļ�ϵͳ�ߴ�������Dz���Ҫ�ġ�</p>
+
+ <p>���ȱʡ�Ŀ��С������ 32K �����ı��ߴ����������������ӡ�</p>
+
+ <h4><a id="4.6" name="4.6"></a>4.6)�洢һ�����͵�ƽ���ļ����������Ҫ���ٴ��̿ռ䣿</h4>
+ һ�� Postgres ���ݿ���������Ҫ�൱����һ��ƽ���ļ���洢��ͬ���ݵ�5���Ĵ��̿ռ䡣
+
+ <p>���磬������һ�� 100,000 �е��ļ���ÿ����һ��������һ���ı������������ı�����ƽ������λ20�ֽڡ�ƽ���ļ�ռ�à2.8 MB�������Щ���ݵ� PostgreSQL ���ݿ��ļ���Լ�� 6.4 MB:</p>
+<pre>
+ 36 �ֽ�: ÿ�е�ͷ������ֵ��
24 �ֽ�: һ��int�ֶκ�һ���ı����ֶ�
+ 4 �ֽ�: ҳ����ָ��Ԫ���ָ��
----------------------------------------
@@ -567,277 +484,293 @@
128 ��ÿҳ
782 ����ҳ * 8192 �ֽ�/ҳ = 6,406,144 �ֽڣ�6.4 MB��
-</PRE>
- <P>��������Ҫ��ô��Ķ������ģ���Ҳȷʵ���������������ݣ��������Ҳ���ܴܺ�</P>
- <P>��ֵ�����λͼ�У����ռ�ú��ٵĿռ䡣</P>
- <H4><a name="4.7"></a>4.7)
- ��β鿴�������������ݿ��Լ��û��Ķ��壿</H4>
- <I>&nbsp;psql</I> �����෴б������������ʾ��Щ��Ϣ���� \? ����������Щ���� pg_ ��ͷ��ϵͳ��Ҳ��������Щ��Ϣ�� psql -l
- �����г����е����ݿ⡣
- <P>Ҳ���������ļ� <I>pgsql/src/tutorial/syscat.source</I>������ʾ����������ݿ�ϵͳ�����ȡ��Ϣ��Ҫ�� <FONT size="-1">
- SELECT</FONT>��
- <H4><a name="4.8"></a>4.8) �ҵIJ�ѯ��������û������������Ϊʲô��</H4>
- <P>
- ����ÿ����ѯ�����Զ�ʹ��������ֻ���ڱ��Ĵ�С����һ����Сֵ�����Ҳ�ѯֻѡ����н�С��������ʱ����ʹ��������������Ϊ����ɨ��������漴���̴�ȡ���ܱ�ֱ�ӵض�ȡ����˳��ɨ�裩������Ϊ���ж��Ƿ�ʹ��������PostgreSQL
- �������йر���ͳ��ֵ����Щͳ��ֵ����ʹ�� VACUUM ANALYZE���� ANALYZE
- ��á�ʹ��ͳ��ֵ���Ż���֪�������ж����У����ܹ����õ��ж��Ƿ�����������ͳ��ֵ��ȷ���Ż�������˳������ӷ���Ҳ�����á��ڱ������ݷ����仯ʱ��Ӧ���ڽ���ͳ��ֵ�Ļ�ȡ��
- <P>
- ����ͨ�������� ORDER BY ��ִ�����ӡ���һ�������һ��˳��ɨ�裬����һ����ʽ������ͨ��������ɨ��Ҫ�졣
- <P>���ǣ��� LIMIT �� ORDER BY ���ʹ��ʱ������ʹ����������Ϊֻ�᷵�ر���һС���֡�ʵ���ϣ���Ȼ MAX() �� MIN() ����ʹ��������ͨ����
- ORDER BY �� LLIMIT ʹ������ȡ�����ֵ����СֵҲ�ǿ��Եģ�<BR>
- <BR>
- &nbsp;&nbsp;&nbsp; SELECT col<BR>
- &nbsp;&nbsp;&nbsp; FROM tab<BR>
- &nbsp;&nbsp;&nbsp; ORDER BY col [ DESC ]<BR>
- &nbsp;&nbsp;&nbsp; LIMIT 1;
- <P>��ʹ��ͨ������������� LIKE �� ~ ʱ������ֻ�����ض��������ʹ�ã�&nbsp;&nbsp;<ul><li> �ַ����Ŀ�ʼ���ֱ�������ͨ�ַ�����Ҳ����˵��</li>
- <ul><li>LIKE ģʽ������ % ��ͷ��</li><li>~ ���������ʽ��ģʽ������ ^ ��ͷ��</li></ul>
- <li>�ַ���������ƥ�����ַ���ģʽ���ͷ������ [a-e]��</li><li>��Сд�޹صIJ��ң��� ILIKE �� ~* �Ȳ�ʹ���������������� 4.12 �������ĺ���������</li><li>���� initdb ʱ�������ȱʡ�ı������� C locale��</li></ul>
- <H4><a name="4.9"></a>4.9)
- ����β��ܿ�����ѯ�Ż��������������ҵIJ�ѯ�ģ�</H4>
- �ο� <FONT size="-1">EXPLAIN</FONT> �ֲ�ҳ��
- <H4><a name="4.10"></a>4.10) R-tree ������ʲô��</H4>
- <P>R-tree �������������ռ����ݡ�һ����ϣ�����޷�������Χ�������� B-tree ����ֻ�ܴ���һά�ķ�Χ������R-tree
- �������Դ�����ά���ݡ����磬���������һ������Ϊ point ���ֶ��Ͻ���һ�� R-tree ��������ôϵͳ�ܸ���Ч�ػش�����
- ��ѡ����һ�������η�Χ�ڵ����е㡱��<BR>
- <BR>
- ��������� R-Tree ��Ƶ���ʽ�����ǣ�<BR>
- <BR>
- Guttman, A. "R-Trees: A Dynamic Index Structure for Spatial Searching." Proc of
- the 1984 ACM SIGMOD Int'l Conf on Mgmt of Data, 45-57.
- <BR>
- <BR>
- �㻹������ Stonebraker �ġ�Readings in Database Systems�����ҵ���ƪ���¡�<BR>
- <BR>
- ϵͳ���õ� R-Tree ���Դ�������κͷ��Ρ�������˵��R-tree ������չΪ��������ά����������ʵ���ϣ���չ R-trees
- ��Ҫһ���Ĺ�������������Ŀǰû����������ĵ���<H4><a name="4.11"></a>4.11)
- ʲô�ǻ����ѯ�Ż���Genetic Query Optimization����</H4>
- <P>GEQO ģ����û����㷨��Genetic Algorithm��GA���ӿ������ӵIJ�ѯ�Ż���������ͨ���������������������Ӳ�ѯ��
- <H4><a name="4.12"></a>4.12)
- ���������������ʽ�����ʹ�Сд�޹ص��������ʽ���������������������д�Сд�޹�������</H4>
- <p>������ ~ �����������ʽƥ�䣬�� ~* ������Сд�޹ص��������ʽƥ�䡣��дЩ�޹ص� LIKE ���ֳ�Ϊ ILIKE��<br>
- <br>
- ��Сд�޹صĵ�ʽ�Ƚ�ͨ��д����<br>
- <br>
- &nbsp;&nbsp;&nbsp; SELECT *<br>
- &nbsp;&nbsp;&nbsp; FROM tab<br>
- &nbsp;&nbsp;&nbsp; WHERE lower(col) = 'abc';<br>
- <br>
- ����������ʹ�ñ�׼�����������ǿ��Դ���һ���ɱ����õĺ�������:<br>
- <br>
- &nbsp;&nbsp;&nbsp; CREATE INDEX tabindex ON tab (lower(col));</p>
- <h4><a name="4.13"></a>4.13) ��һ����ѯ����������һ���ֶ��Ƿ�Ϊ NULL��</h4>
- <p>�� IS NULL �� IS NOT NULL ��������ֶΡ�&nbsp;<br>
- </p>
- <h4><a name="4.14"></a>4.14) �����ַ�����֮����ʲô��ͬ��</h4>
- <p>&nbsp; ����&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- �ڲ�����&nbsp;&nbsp;&nbsp;
- ˵��<br>
- &nbsp; --------------------------------------------------<br>
- &nbsp; "char"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- 1���ַ� character<br>
- &nbsp; CHAR(#)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bpchar&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- �����ַ�����ʵ�����ݲ��㶨�峤��ʱ���Կո���<br>
- &nbsp; VARCHAR(#)&nbsp; varchar&nbsp;&nbsp;&nbsp;&nbsp; ָ������󳤶ȣ��䳤�ַ��������㶨�峤�ȵIJ��ֲ�����<br>
- &nbsp; TEXT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- �����Ƚ����е���󳤶�����<br>
- &nbsp; BYTEA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bytea&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- �䳤�ֽ����У��䳤�Ķ��������ݣ�<br>
- <br>
- ��ϵͳ������һЩ������Ϣ���㽫�����ڲ����ơ�&nbsp;<br>
- <br>
- �����������������"varlena"���䳤�����ͣ�Ҳ����˵����ͷ���ĸ��ֽ��dz��ȣ�����������ݣ�������ʵ��ռ�õĿռ�������Ĵ�СҪ��һЩ��Ȼ����Щ���Ͷ����Ա�ѹ���洢��Ҳ������ TOAST �ѻ��洢����˴��̿ռ�Ҳ���ܱ�Ԥ���Ҫ�١�<br>
- <br>
- CHAR(n) ���ʺ��ڴ洢���Ȼ��������ַ�����VARCHAR(n) �ڴ洢��������󳤶ȵı䳤�ַ�������õġ�TEXT �����ڴ洢�����Ƴ��ȵ��ַ��������ɴ� 1G��BYTEA ���ڴ洢���������ݣ������ǰ��� NULL �ֽڣ������Ƶ�0����ֵ����Щ���;������͵����ܡ�</p>
- <h4><a name="4.15.1"></a>4.15.1) ����������һ�����к�/�Զ��������ֶΣ�</h4>
- <p>PostgreSQL ֧�� SERIAL �������͡������ֶ����Զ�����һ�����к����������磬<br>
- &nbsp;&nbsp;&nbsp; CREATE TABLE person (&nbsp;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id SERIAL,&nbsp;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name TEXT&nbsp;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<br>
- <br>
- ���Զ�ת��Ϊ��&nbsp;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<br>
- &nbsp;&nbsp;&nbsp; CREATE SEQUENCE person_id_seq;<br>
- &nbsp;&nbsp;&nbsp; CREATE TABLE person (&nbsp;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id INT4 NOT NULL DEFAULT nextval('person_id_seq'),<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name TEXT&nbsp;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<br>
- &nbsp;&nbsp;&nbsp; CREATE UNIQUE INDEX person_id_key ON person ( id );<br>
- <br>
- �ο� create_sequence �ֲ�ҳ��ȡ�������еĸ�����Ϣ���㻹������ÿ�е� oid �ֶ���Ϊһ��Ψһֵ���������������Ҫ�㵹���������ݿ⣬����Ҫʹ�� pg_dump �� -o ѡ����� COPY WITH OIDS ѡ���Ա��� OID��&nbsp;</p>
- <h4><a name="4.15.2"></a>4.15.2)
- ����λ��һ����������кŵ�ֵ��</h4>
- <p>һ�ַ������ڲ���֮ǰ���ú��� nextval() �����ж������������һ�� SERIAL ֵ��Ȼ������ʽ���롣ʹ��
- <a href="#4.15.1"> 4.15.1</a> ������������������������&nbsp;<br>
- <br>
- &nbsp;&nbsp;&nbsp; new_id = execute("SELECT nextval('person_id_seq')");<br>
- &nbsp;&nbsp;&nbsp; execute("INSERT INTO person (id, name) VALUES (new_id, 'Blaise Pascal')");<br>
- <br>
- ����������������ѯ��ʹ�ô���� new_id �����ֵ�����磬��Ϊ person �����������ע���Զ������� SEQUENCE ��������ƽ����� &lt;table>_&lt;serialcolumn>_seq������ table �� serialcolumn �ֱ�����ı������ƺ���� SERIAL �ֶε����ơ�&nbsp;<br>
- <br>
- ���Ƶģ��� SERIAL ����ȱʡ�����������ú��� currval() �����ո�ֵ�� SERIAL ֵ�����磬&nbsp;<br>
- <br>
- &nbsp;&nbsp;&nbsp; execute("INSERT INTO person (name) VALUES ('Blaise Pascal')");<br>
- &nbsp;&nbsp;&nbsp; new_id = execute("SELECT currval('person_id_seq')");<br>
- <br>
- ��������ʹ�ô� INSERT ��䷵�ص� <a href="4.16">OID</a>
- ����ȱʡֵ���������������ȱ����ֲ�Եķ������� Perl �ʹ�ô��� Edmund Mergl �� DBD::Pg ģ��� DBI��oid ֵ����ͨ�� $sth->execute() ��� $sth->{pg_oid_status} ��á�&nbsp;</p>
- <h4><a name="4.15.3"></a>4.15.3) ʹ�� currval() �� nextval() �ᵼ��һ���������û�֮������������</h4>
- <p>���ᡣcurrval() ���غ�̨���̶����������û�����ĵ�ǰֵ��<br>
- </p>
- <h4><a name="4.15.4"></a>4.15.4)
- Ϊʲô���������쳣��ֹ���������к��أ�Ϊʲô�����к��ֶε�ȡֵ�д��ڼ���أ�</h4>
- <p>Ϊ����߲����ԣ����к�����Ҫ��ʱ�����������е����񣬲���ֻ���������֮ǰ����������ͻᵼ��ز�����������кų��ּ����</p>
- <h4><br>
- <a name="4.16"></a>4.16) ʲô�� OID��ʲô�� TID��</h4>
- <p>OID �� PostgreSQL ���е�Ψһ��ʶ��PostgreSQL �ﴴ����ÿһ�ж����һ��Ψһ�� OID�������� initdb �����д����� OID ��С�� 16384 ���μ� include/access/transam.h���������û������� OID �����ڻ�������ֵ��ȱʡʱ��������Щ OID ������һ������һ�����ݿ�����Ψһ������������ PostgreSQL ��װ��Ҳ��Ψһ�ġ�&nbsp;<br>
- <br>
- PostgreSQL �������ڲ�ϵͳ����ʹ�� OID �ڱ�֮�佨����ϵ����Щ OID �������ڱ�ʶ�ض����û����Լ��������������ʹ���ֶ����� OID �洢 OID ֵ�������� OID �ֶ��ϴ���һ�������Կ��ٷ��ʡ�&nbsp;<br>
- <br>
- OID ��һ�����������ݿ�ʹ�õ����������︳ֵ���������С��������� OID �ijɱ��ֵ����������һ�ݱ��Ĵ�ԭʼ OID �Ŀ����������������&nbsp;<br>
- <br>
- &nbsp;&nbsp;&nbsp; CREATE TABLE new(old_oid oid, mycol int);<br>
- &nbsp;&nbsp;&nbsp; SELECT old_oid, mycol INTO new FROM old;<br>
- &nbsp;&nbsp;&nbsp; COPY new TO '/tmp/pgtable';<br>
- &nbsp;&nbsp;&nbsp; DELETE FROM new;<br>
- &nbsp;&nbsp;&nbsp; COPY new WITH OIDS FROM '/tmp/pgtable';<br>
- <br>
- OID ��4�ֽڵ��������棬�ڳ���40��ʱ�������û���˱�����ֹ�����������Ǵ��������˱���֮ǰ����������ơ�<br>
- <br>
- TID ���ڱ�ʶ�������ݿ飨��ַ���ͣ����ڣ�ƫ�Ƶ��ض��������С�TID ���б����Ļ����غ����ı䡣�������ʹ������ָ�������С�</p>
- <h4><a name="4.17"></a>4.17) PostgreSQL ʹ�õ�һЩ����ĺ�����ʲô��</h4>
- <p>һЩԴ�����һЩ��һ����ĵ�ʹ��һЩ�и������÷����������������һ���֣�&nbsp;<br>
- &nbsp;&nbsp;&nbsp; table, relation, class&nbsp;<br>
- &nbsp;&nbsp;&nbsp; row, record, tuple&nbsp;<br>
- &nbsp;&nbsp;&nbsp; column, field, attribute&nbsp;<br>
- &nbsp;&nbsp;&nbsp; retrieve, select&nbsp;<br>
- &nbsp;&nbsp;&nbsp; replace, update&nbsp;<br>
- &nbsp;&nbsp;&nbsp; append, insert&nbsp;<br>
- &nbsp;&nbsp;&nbsp; OID, serial value&nbsp;<br>
- &nbsp;&nbsp;&nbsp; portal, cursor&nbsp;<br>
- &nbsp;&nbsp;&nbsp; range variable, table name, table alias&nbsp;<br>
- <br>
- ��һ��ͨ�����ݿ�������б���<a href="http://hea-www.harvard.edu/MST/simul/software/docs/pkgs/pgsql/glossary/glossary.html">http://hea-www.harvard.edu/MST/simul/software/docs/pkgs/pgsql/glossary/glossary.html</a>
- ��&nbsp;&nbsp;</p>
- <h4><a name="4.18"></a>4.18)
- Ϊʲô���յ�����<i>ERROR: Memory exhausted in AllocSetAlloc()</i>����</h4>
- <p>��ܿ�����ϵͳ�������ڴ��ù��ˣ������ں˶�ijЩ��Դ�нϵ͵�����ֵ�������� postmaster ֮ǰ������������&nbsp;<br>
- <br>
- &nbsp;&nbsp;&nbsp; ulimit -d 262144<br>
- &nbsp;&nbsp;&nbsp; limit datasize 256m<br>
- <br>
- ȡ�������õ� shell����������ֻ��һ���ܳɹ���������������Ľ������ݶ�������ñȽϸߣ����Ҳ�����ò�ѯ��ɡ���������Ӧ���ڵ�ǰ���̣��Լ������������������к󴴽����ӽ��̡��������������SQL�ͻ���ʱ��Ϊ��̨������̫������ݶ��������⣬�������пͻ���֮ǰִ���������</p>
- <h4><a name="4.19"></a>4.19)
- ����β���֪�������е� PostgreSQL �İ汾��</h4>
- <p>�� psql ����� SELECT version()��<br>
- </p>
- <h4><a name="4.20"></a>4.20)
- Ϊʲô�ҵĴ����������´���<I>invalid large obj descriptor�����Ƿ��Ĵ������������</I>��</h4>
- <p>����Ҫ��ʹ���κδ��������ǰ����� BEGIN WORK �� COMMIT��Ҳ����˵����Χ lo_open ... lo_close��&nbsp;<br>
- <br>
- Ŀǰ PostgreSQL ǿ��ʵʩ���������������ύʱ�رմ����������������û�в�������ʱ�����״ζԴ���������κ��������ͼ���ᵼ��һ�� invalid large obj descriptor�����ԣ������û��ʹ��һ��������ǰ�ܹ����Ĵ��루�����Ǵ����ʱ�䣩����������ôһ��������Ϣ��&nbsp;<br>
- <br>
- �����ʹ�ÿͻ��˽ӿڣ��� ODBC���������Ҫ set auto-commit off��</p>
- <h4><a name="4.21"></a>4.21) ����δ���һ��ȱʡֵ�ǵ�ǰʱ����ֶΣ�</h4>
- <p>ʹ�� CURRENT_TIMESTAMP��<br>
- <br>
- &nbsp;&nbsp;&nbsp; CREATE TABLE test(x int, modtime timestamp DEFAULT CURRENT_TIMESTAMP);</p>
- <h4><a name="4.22"></a>4.22) Ϊʲôʹ�� IN ���Ӳ�ѯ��ô����</h4>
- <p>Ŀǰ������ͨ��Ϊ���ѯ��ÿһ��˳��ɨ���Ӳ�ѯ�Ľ���������Ӳ�ѯ�����ѯ������Ӳ�ѯ�����������У������ѯ���غܶ��У�IN ִ�еúܿ졣Ϊ�˼ӿ����� IN ��ѯ��ִ�У������� EXISTS �滻 IN��&nbsp;<br>
- <br>
- &nbsp;&nbsp;&nbsp; SELECT *<br>
- &nbsp;&nbsp;&nbsp; FROM tab<br>
- &nbsp;&nbsp;&nbsp; WHERE col IN (SELECT subcol FROM subtab);<br>
- <br>
- ����&nbsp;<br>
- <br>
- &nbsp;&nbsp;&nbsp; SELECT *<br>
- &nbsp;&nbsp;&nbsp; FROM tab<br>
- &nbsp;&nbsp;&nbsp; WHERE EXISTS (SELECT subcol FROM subtab WHERE subcol = col);<br>
- <br>
- ����Ҫ��ִ�еø��죬subcol Ӧ����һ�������С�����ϣ����δ���ķ����汾���޲�������ơ�</p>
- <h4><a name="4.23"></a>4.23) ���������� outer join �������ӣ���</h4>
- <p>PostgreSQL ���ñ�׼�� SQL �﷨֧�������ӡ��������������ӣ�<br>
- <br>
- &nbsp;&nbsp;&nbsp; SELECT *<br>
- &nbsp;&nbsp;&nbsp; FROM t1 LEFT OUTER JOIN t2 ON (t1.col = t2.col);<br>
- <br>
- ��&nbsp;<br>
- &nbsp;&nbsp;&nbsp; SELECT *<br>
- &nbsp;&nbsp;&nbsp; FROM t1 LEFT OUTER JOIN t2 USING (col);<br>
- <br>
- �������ȼ۵IJ�ѯ�� t1.col �� t2.col �������ӣ����ҷ��?t1 ������δ���ӵ��У���Щ�� t2 ��û��ƥ����У�����[��]����(RIGHT OUTER JOIN)������ t2 ��δ���ӵ��С���ȫ�����ӣ�FULL OUTER JOIN�������� t1 �� t2 ��δ���ӵ��С��ؼ��� OUTER ����[��]���ӡ���[��]���Ӻ���ȫ[��]�������ǿ�ѡ�ģ���ͨ���ӱ���Ϊ�����ӣ�INNER JOIN����<br>
- <br>
- �ڴ�ǰ�İ汾�У������ӿ����� UNION �� NOT IN ��ģ�⡣���磬����������ڱ� tab1 �� tab2 ֮���������ӣ�<br>
- <br>
- &nbsp;&nbsp;&nbsp; SELECT tab1.col1, tab2.col2<br>
- &nbsp;&nbsp;&nbsp; FROM tab1, tab2<br>
- &nbsp;&nbsp;&nbsp; WHERE tab1.col1 = tab2.col1<br>
- <br>
- &nbsp;&nbsp;&nbsp; UNION ALL<br>
- <br>
- &nbsp;&nbsp;&nbsp; SELECT tab1.col1, NULL<br>
- &nbsp;&nbsp;&nbsp; FROM tab1<br>
- &nbsp;&nbsp;&nbsp; WHERE tab1.col1 NOT IN (SELECT tab2.col1 FROM tab2)<br>
- &nbsp;&nbsp;&nbsp; ORDER BY col1</p>
- <h4><a name="4.24"></a>4.24)
- ���ʹ���漰������ݿ�IJ�ѯ��</h4>
- <p>û�а취��ѯ��ǰ���ݿ�֮������ݿ⡣��Ϊ PostgreSQL �������ݿ���ص�ϵͳĿ¼��ϵͳ�����������ݿ�IJ�ѯ���ִ��Ҳδ��ȷ��<br>
- <br>
- contrib/dblink �������ú�������ʵ�ֿ���ѯ����Ȼ����ͬʱ���ӵ���ͬ�����ݿⲢ�ڿͻ��˺ϲ������</p>
- <h4><a name="4.25"></a>4.25)
- ����ú������ض��л���У�</h4>
- <p>������ PL/pgSQL ������ʹ�� refcursors ���ؽ�������ο�
- <a href="http://www.PostgreSQL.org/idocs/index.php?plpgsql-cursors.html"> http://www.PostgreSQL.org/idocs/index.php?plpgsql-cursors.html</a>, 23.7.3.3�ڡ�<br>
- </p>
- <h4><a name="4.26"></a>4.26) Ϊʲô��
- PL/PgSQL �����в��ܿɿ��ش�����ɾ����ʱ����</h4>
- <p>PL/PgSQL
- ���溯�������ݣ��ɴ˴�����һ�����õĸ���������һ�� PL/PgSQL
- ����������һ����ʱ����Ȼ��ñ���ɾ�����ؽ��ˣ����ٴε��øú�����ʧ�ܣ���Ϊ����ĺ���������Ȼָ��ɵ���ʱ��������ķ�������
- PL/PgSQL ���� EXECUTE
- ����ʱ�����з��ʡ������ᱣ֤��ѯ��ִ��ǰ�������·�����</p>
- <h4><a name="4.27"></a>4.27)
- ����Щ���ݸ���ѡ�</h4>
- <p>�м�����/�ӷ�ʽ�ĸ���ѡ���Щѡ��ֻ���������ݿ���и��£������ݿ�ֻ�ܽ��ж�����ҳ
- <a href="http://gborg.PostgreSQL.org/genpage?replication_research">http://gborg.PostgreSQL.org/genpage?replication_research</a>&nbsp;
- ������г�����Щѡ��� <a href="http://gborg.PostgreSQL.org/project/pgreplication/projdisplay.php"> http://gborg.PostgreSQL.org/project/pgreplication/projdisplay.php</a>
- ���ڽ���һ�����������ƵĽ��������</p>
- <h4><a name="4.28"></a>4.28)
- ����Щ���ݼ���ѡ�
- <CENTER>
- </CENTER>
- </h4>
- <p>contrib/pgcrypto �����˺ܶ��� SQL
- ��ѯ��ʹ�õļ��ܺ��������ܿͻ��˵��������˴������ݵ�Ψһ�������� pg_hba.conf
- ��� hostss ��&nbsp;<br>
- <br>
- 7.3
- �汾���Զ������ݿ��û�������м��ܡ�����ǰ�İ汾�У�������
- postgresql.conf �д� PASSWORD_ENCRYPTION
- ѡ����������������ڼ��ܵ��ļ�ϵͳ�ϣ��Դﵽ���ܵ�Ŀ�ģ���<br>
- <br>
- --------------------------------------------------------------------------------</p>
- <h2 align="center">��չ PostgreSQL</h2>
- <h4><a name="5.1"></a>5.1)
- ��д��һ���û����庯���������� psql ������ʱ��Ϊʲô�ᵼ�� core dump��</h4>
- <p>������������ԭ��ܶࡣ������һ�������IJ��Գ����в�������Զ��庯����</p>
- <h4><a name="5.2"></a>5.2) ������ܸ�
- PostgreSQL ����һЩͦ�����������ͺͺ�����</h4>
- <p>�������չ���͵� pgsql-hackers
- �ʼ��б����������ջᱻ�ŵ� contrib/ ��Ŀ¼��<br>
- </p>
- <h4><a name="5.3"></a>5.3) ������дһ������һ��Ԫ��� C ������</h4>
- <p>�� PostgreSQL 7.3 �Ժ�İ汾�У�C, PL/PgSQL �� SQL
- ��ȫ֧�ַ���ֵΪ���ĺ�����������Ϣ��ο�
- ����Աָ�ϣ�the Programmer's Guide������ contrib/tablefunc
- ����һ���������� C д�ķ���ֵΪ���ĺ�����</p>
- <h4><a name="5.4"></a>5.4)
- ���޸���һ��Դ�ļ���Ϊʲô���±����û�п����ı䣿</h4>
- <p> Makefiles ��û�а���ͷ�ļ�����ȷ����������������make
- clean�� ����һ�� make �������ʹ�õ��� GCC
- ������Բ���ѡ�� --enable-depend
- �ñ������Զ�����ͷ�ļ���������ϵ��</p>
- </BODY>
-</HTML>
+</pre>
+
+ <p>��������Ҫ��ô��Ķ������ģ���Ҳȷʵ���������������ݣ��������Ҳ���ܴܺ�</p>
+
+ <p>��ֵ�����λͼ�У����ռ�ú��ٵĿռ䡣</p>
+
+ <h4><a id="4.7" name="4.7"></a>4.7) ��β鿴�������������ݿ��Լ��û��Ķ��壿</h4>
+ <i>�psql</i> �����෴б������������ʾ��Щ��Ϣ���� \? ����������Щ���� pg_ ��ͷ��ϵͳ��Ҳ��������Щ��Ϣ�� psql -l �����г����е����ݿ⡣
+
+ <p>Ҳ���������ļ� <i>pgsql/src/tutorial/syscat.source</i>������ʾ����������ݿ�ϵͳ�����ȡ��Ϣ��Ҫ�� <font size="-1">SELECT</font>��</p>
+
+ <h4><a id="4.8" name="4.8"></a>4.8) �ҵIJ�ѯ��������û������������Ϊʲô��</h4>
+
+ <p>����ÿ����ѯ�����Զ�ʹ��������ֻ���ڱ��Ĵ�С����һ����Сֵ�����Ҳ�ѯֻѡ����н�С��������ʱ����ʹ��������������Ϊ����ɨ��������漴���̴�ȡ���ܱ�ֱ�ӵض�ȡ����˳��ɨ�裩������Ϊ���ж��Ƿ�ʹ��������PostgreSQL �������йر���ͳ��ֵ����Щͳ��ֵ����ʹ�� VACUUM ANALYZE���� ANALYZE ��á�ʹ��ͳ��ֵ���Ż���֪�������ж����У����ܹ����õ��ж��Ƿ�����������ͳ��ֵ��ȷ���Ż�������˳������ӷ���Ҳ�����á��ڱ������ݷ����仯ʱ��Ӧ���ڽ���ͳ��ֵ�Ļ�ȡ��</p>
+
+ <p>����ͨ�������� ORDER BY ��ִ�����ӡ���һ�������һ��˳��ɨ�裬����һ����ʽ������ͨ��������ɨ��Ҫ�졣</p>
+
+ <p>���ǣ��� LIMIT �� ORDER BY ���ʹ��ʱ������ʹ����������Ϊֻ�᷵�ر���һС���֡�ʵ���ϣ���Ȼ MAX() �� MIN() ����ʹ��������ͨ���� ORDER BY �� LLIMIT ʹ������ȡ�����ֵ����СֵҲ�ǿ��Եģ�<br />
+ <br />
+ ��� SELECT col<br />
+ ��� FROM tab<br />
+ ��� ORDER BY col [ DESC ]<br />
+ ��� LIMIT 1;</p>
+
+ <p>��ʹ��ͨ������������� LIKE �� ~ ʱ������ֻ�����ض��������ʹ�ã���</p>
+
+ <ul>
+ <li>�ַ����Ŀ�ʼ���ֱ�������ͨ�ַ�����Ҳ����˵��</li>
+
+ <li>LIKE ģʽ������ % ��ͷ��</li>
+
+ <li>~ ���������ʽ��ģʽ������ ^ ��ͷ��</li>
+
+ <li>�ַ���������ƥ�����ַ���ģʽ���ͷ������ [a-e]��</li>
+
+ <li>��Сд�޹صIJ��ң��� ILIKE �� ~* �Ȳ�ʹ���������������� 4.12 �������ĺ���������</li>
+
+ <li>���� initdb ʱ�������ȱʡ�ı������� C locale��</li>
+ </ul>
+
+ <h4><a id="4.9" name="4.9"></a>4.9) ����β��ܿ�����ѯ�Ż��������������ҵIJ�ѯ�ģ�</h4>
+ �ο� <font size="-1">EXPLAIN</font> �ֲ�ҳ��
+
+ <h4><a id="4.10" name="4.10"></a>4.10) R-tree ������ʲô��</h4>
+
+ <p>R-tree �������������ռ����ݡ�һ����ϣ�����޷�������Χ�������� B-tree ����ֻ�ܴ���һά�ķ�Χ������R-tree �������Դ�����ά���ݡ����磬���������һ������Ϊ point ���ֶ��Ͻ���һ�� R-tree ��������ôϵͳ�ܸ���Ч�ػش����� ��ѡ����һ�������η�Χ�ڵ����е㡱��<br />
+ <br />
+ ��������� R-Tree ��Ƶ���ʽ�����ǣ�<br />
+ <br />
+ Guttman, A. "R-Trees: A Dynamic Index Structure for Spatial Searching." Proc of the 1984 ACM SIGMOD Int'l Conf on Mgmt of Data, 45-57.<br />
+ <br />
+ �㻹������ Stonebraker �ġ�Readings in Database Systems�����ҵ���ƪ���¡�<br />
+ <br />
+ ϵͳ���õ� R-Tree ���Դ�������κͷ��Ρ�������˵��R-tree ������չΪ��������ά����������ʵ���ϣ���չ R-trees ��Ҫһ���Ĺ�������������Ŀǰû����������ĵ���</p>
+
+ <h4><a id="4.11" name="4.11"></a>4.11) ʲô�ǻ����ѯ�Ż���Genetic Query Optimization����</h4>
+
+ <p>GEQO ģ����û����㷨��Genetic Algorithm��GA���ӿ������ӵIJ�ѯ�Ż���������ͨ���������������������Ӳ�ѯ��</p>
+
+ <h4><a id="4.12" name="4.12"></a>4.12) ���������������ʽ�����ʹ�Сд�޹ص��������ʽ���������������������д�Сд�޹�������</h4>
+
+ <p>������ ~ �����������ʽƥ�䣬�� ~* ������Сд�޹ص��������ʽƥ�䡣��дЩ�޹ص� LIKE ���ֳ�Ϊ ILIKE��<br />
+ <br />
+ ��Сд�޹صĵ�ʽ�Ƚ�ͨ��д����<br />
+ <br />
+ ��� SELECT *<br />
+ ��� FROM tab<br />
+ ��� WHERE lower(col) = 'abc';<br />
+ <br />
+ ����������ʹ�ñ�׼�����������ǿ��Դ���һ���ɱ����õĺ�������:<br />
+ <br />
+ ��� CREATE INDEX tabindex ON tab (lower(col));</p>
+
+ <h4><a id="4.13" name="4.13"></a>4.13) ��һ����ѯ����������һ���ֶ��Ƿ�Ϊ NULL��</h4>
+
+ <p>�� IS NULL �� IS NOT NULL ��������ֶΡ��<br />
+ </p>
+
+ <h4><a id="4.14" name="4.14"></a>4.14) �����ַ�����֮����ʲô��ͬ��</h4>
+
+ <p>� ���͠���������� �ڲ����Ơ�� ˵��<br />
+ � --------------------------------------------------<br />
+ � "char"������� char�������� 1���ַ� character<br />
+ � CHAR(#)����� bpchar������ �����ַ�����ʵ�����ݲ��㶨�峤��ʱ���Կո���<br />
+ � VARCHAR(#)� varchar���� ָ������󳤶ȣ��䳤�ַ��������㶨�峤�ȵIJ��ֲ�����<br />
+ � TEXT���������� text�������� �����Ƚ����е���󳤶�����<br />
+ � BYTEA��������� bytea������ �䳤�ֽ����У��䳤�Ķ��������ݣ�<br />
+ <br />
+ ��ϵͳ������һЩ������Ϣ���㽫�����ڲ����ơ��<br />
+ <br />
+ �����������������"varlena"���䳤�����ͣ�Ҳ����˵����ͷ���ĸ��ֽ��dz��ȣ�����������ݣ�������ʵ��ռ�õĿռ�������Ĵ�СҪ��һЩ��Ȼ����Щ���Ͷ����Ա�ѹ���洢��Ҳ������ TOAST �ѻ��洢����˴��̿ռ�Ҳ���ܱ�Ԥ���Ҫ�١�<br />
+ <br />
+ CHAR(n) ���ʺ��ڴ洢���Ȼ��������ַ�����VARCHAR(n) �ڴ洢��������󳤶ȵı䳤�ַ�������õġ�TEXT �����ڴ洢�����Ƴ��ȵ��ַ��������ɴ� 1G��BYTEA ���ڴ洢���������ݣ������ǰ��� NULL �ֽڣ������Ƶ�0����ֵ����Щ���;������͵����ܡ�</p>
+
+ <h4><a id="4.15.1" name="4.15.1"></a>4.15.1) ����������һ�����к�/�Զ��������ֶΣ�</h4>
+
+ <p>PostgreSQL ֧�� SERIAL �������͡������ֶ����Զ�����һ�����к����������磬<br />
+ ��� CREATE TABLE person (�<br />
+ ������� id SERIAL,�<br />
+ ������� name TEXT�<br />
+ ������� );<br />
+ <br />
+ ���Զ�ת��Ϊ���<br />
+ ����<br />
+ ��� CREATE SEQUENCE person_id_seq;<br />
+ ��� CREATE TABLE person (�<br />
+ ������� id INT4 NOT NULL DEFAULT nextval('person_id_seq'),<br />
+ ������� name TEXT�<br />
+ ������� );<br />
+ ��� CREATE UNIQUE INDEX person_id_key ON person ( id );<br />
+ <br />
+ �ο� create_sequence �ֲ�ҳ��ȡ�������еĸ�����Ϣ���㻹������ÿ�е� oid �ֶ���Ϊһ��Ψһֵ���������������Ҫ�㵹���������ݿ⣬����Ҫʹ�� pg_dump �� -o ѡ����� COPY WITH OIDS ѡ���Ա��� OID���</p>
+
+ <h4><a id="4.15.2" name="4.15.2"></a>4.15.2) ����λ��һ����������кŵ�ֵ��</h4>
+
+ <p>һ�ַ������ڲ���֮ǰ���ú��� nextval() �����ж������������һ�� SERIAL ֵ��Ȼ������ʽ���롣ʹ�� <a href="#4.15.1">4.15.1</a> �������������α�������������<br />
+ <br />
+ ��� new_id = execute("SELECT nextval('person_id_seq')");<br />
+ ��� execute("INSERT INTO person (id, name) VALUES (new_id, 'Blaise Pascal')");<br />
+ <br />
+ ����������������ѯ��ʹ�ô���� new_id �����ֵ�����磬��Ϊ person �����������ע���Զ������� SEQUENCE ��������ƽ����� &lt;table&gt;_&lt;serialcolumn&gt;_seq������ table �� serialcolumn �ֱ�����ı������ƺ���� SERIAL �ֶε����ơ��<br />
+ <br />
+ ���Ƶģ��� SERIAL ����ȱʡ�����������ú��� currval() �����ո�ֵ�� SERIAL ֵ�����磬�<br />
+ <br />
+ ��� execute("INSERT INTO person (name) VALUES ('Blaise Pascal')");<br />
+ ��� new_id = execute("SELECT currval('person_id_seq')");<br />
+ <br />
+ ��������ʹ�ô� INSERT ��䷵�ص� <a href="4.16">OID</a> ����ȱʡֵ���������������ȱ����ֲ�Եķ������� Perl �ʹ�ô��� Edmund Mergl �� DBD::Pg ģ��� DBI��oid ֵ����ͨ�� $sth-&gt;execute() ��� $sth-&gt;{pg_oid_status} ��á��</p>
+
+ <h4><a id="4.15.3" name="4.15.3"></a>4.15.3) ʹ�� currval() �� nextval() �ᵼ��һ���������û�֮������������</h4>
+
+ <p>���ᡣcurrval() ���غ�̨���̶����������û�����ĵ�ǰֵ��<br />
+ </p>
+
+ <h4><a id="4.15.4" name="4.15.4"></a>4.15.4) Ϊʲô���������쳣��ֹ���������к��أ�Ϊʲô�����к��ֶε�ȡֵ�д��ڼ���أ�</h4>
+
+ <p>Ϊ����߲����ԣ����к�����Ҫ��ʱ�����������е����񣬲���ֻ���������֮ǰ����������ͻᵼ��ز�����������кų��ּ����</p>
+
+ <h4><br />
+ <a id="4.16" name="4.16"></a>4.16) ʲô�� OID��ʲô�� TID��</h4>
+
+ <p>OID �� PostgreSQL ���е�Ψһ��ʶ��PostgreSQL �ﴴ����ÿһ�ж����һ��Ψһ�� OID�������� initdb �����д����� OID ��С�� 16384 ���μ� include/access/transam.h���������û������� OID �����ڻ�������ֵ��ȱʡʱ��������Щ OID ������һ������һ�����ݿ�����Ψһ������������ PostgreSQL ��װ��Ҳ��Ψһ�ġ��<br />
+ <br />
+ PostgreSQL �������ڲ�ϵͳ����ʹ�� OID �ڱ�֮�佨����ϵ����Щ OID �������ڱ�ʶ�ض����û����Լ��������������ʹ���ֶ����� OID �洢 OID ֵ�������� OID �ֶ��ϴ���һ�������Կ��ٷ��ʡ��<br />
+ <br />
+ OID ��һ�����������ݿ�ʹ�õ����������︳ֵ���������С��������� OID �ijɱ��ֵ����������һ�ݱ��Ĵ�ԭʼ OID �Ŀ�����������������<br />
+ <br />
+ ��� CREATE TABLE new(old_oid oid, mycol int);<br />
+ ��� SELECT old_oid, mycol INTO new FROM old;<br />
+ ��� COPY new TO '/tmp/pgtable';<br />
+ ��� DELETE FROM new;<br />
+ ��� COPY new WITH OIDS FROM '/tmp/pgtable';<br />
+ <br />
+ OID ��4�ֽڵ��������棬�ڳ���40��ʱ�������û���˱�����ֹ�����������Ǵ��������˱���֮ǰ����������ơ�<br />
+ <br />
+ TID ���ڱ�ʶ�������ݿ飨��ַ���ͣ����ڣ�ƫ�Ƶ��ض��������С�TID ���б����Ļ����غ����ı䡣�������ʹ������ָ�������С�</p>
+
+ <h4><a id="4.17" name="4.17"></a>4.17) PostgreSQL ʹ�õ�һЩ����ĺ�����ʲô��</h4>
+
+ <p>һЩԴ�����һЩ��һ����ĵ�ʹ��һЩ�и������÷����������������һ���֣��<br />
+ ��� table, relation, class�<br />
+ ��� row, record, tuple�<br />
+ ��� column, field, attribute�<br />
+ ��� retrieve, select�<br />
+ ��� replace, update�<br />
+ ��� append, insert�<br />
+ ��� OID, serial value�<br />
+ ��� portal, cursor�<br />
+ ��� range variable, table name, table alias�<br />
+ <br />
+ ��һ��ͨ�����ݿ�������б���<a href="http://hea-www.harvard.edu/MST/simul/software/docs/pkgs/pgsql/glossary/glossary.html">http://hea-www.harvard.edu/MST/simul/software/docs/pkgs/pgsql/glossary/glossary.html</a> ����</p>
+
+ <h4><a id="4.18" name="4.18"></a>4.18) Ϊʲô���յ�����<i>ERROR: Memory exhausted in AllocSetAlloc()</i>����</h4>
+
+ <p>��ܿ�����ϵͳ�������ڴ��ù��ˣ������ں˶�ijЩ��Դ�нϵ͵�����ֵ�������� postmaster ֮ǰ�������������<br />
+ <br />
+ ��� ulimit -d 262144<br />
+ ��� limit datasize 256m<br />
+ <br />
+ ȡ�������õ� shell����������ֻ��һ���ܳɹ���������������Ľ������ݶ�������ñȽϸߣ����Ҳ�����ò�ѯ��ɡ���������Ӧ���ڵ�ǰ���̣��Լ������������������к󴴽����ӽ��̡��������������SQL�ͻ���ʱ��Ϊ��̨������̫������ݶ��������⣬�������пͻ���֮ǰִ���������</p>
+
+ <h4><a id="4.19" name="4.19"></a>4.19) ����β���֪�������е� PostgreSQL �İ汾��</h4>
+
+ <p>�� psql ����� SELECT version()��<br />
+ </p>
+
+ <h4><a id="4.20" name="4.20"></a>4.20) Ϊʲô�ҵĴ����������´���<i>invalid large obj descriptor�����Ƿ��Ĵ������������</i>��</h4>
+
+ <p>����Ҫ��ʹ���κδ��������ǰ����� BEGIN WORK �� COMMIT��Ҳ����˵����Χ lo_open ... lo_close���<br />
+ <br />
+ Ŀǰ PostgreSQL ǿ��ʵʩ���������������ύʱ�رմ����������������û�в�������ʱ�����״ζԴ���������κ��������ͼ���ᵼ��һ�� invalid large obj descriptor�����ԣ������û��ʹ��һ��������ǰ�ܹ����Ĵ��루�����Ǵ����ʱ�䣩����������ôһ��������Ϣ���<br />
+ <br />
+ �����ʹ�ÿͻ��˽ӿڣ��� ODBC���������Ҫ set auto-commit off��</p>
+
+ <h4><a id="4.21" name="4.21"></a>4.21) ����δ���һ��ȱʡֵ�ǵ�ǰʱ����ֶΣ�</h4>
+
+ <p>ʹ�� CURRENT_TIMESTAMP��<br />
+ <br />
+ ��� CREATE TABLE test(x int, modtime timestamp DEFAULT CURRENT_TIMESTAMP);</p>
+
+ <h4><a id="4.22" name="4.22"></a>4.22) Ϊʲôʹ�� IN ���Ӳ�ѯ��ô����</h4>
+
+ <p>Ŀǰ������ͨ��Ϊ���ѯ��ÿһ��˳��ɨ���Ӳ�ѯ�Ľ���������Ӳ�ѯ�����ѯ������Ӳ�ѯ�����������У������ѯ���غܶ��У�IN ִ�еúܿ졣Ϊ�˼ӿ����� IN ��ѯ��ִ�У������� EXISTS �滻 IN���<br />
+ <br />
+ ��� SELECT *<br />
+ ��� FROM tab<br />
+ ��� WHERE col IN (SELECT subcol FROM subtab);<br />
+ <br />
+ �����<br />
+ <br />
+ ��� SELECT *<br />
+ ��� FROM tab<br />
+ ��� WHERE EXISTS (SELECT subcol FROM subtab WHERE subcol = col);<br />
+ <br />
+ ����Ҫ��ִ�еø��죬subcol Ӧ����һ�������С�����ϣ����δ���ķ����汾���޲�������ơ�</p>
+
+ <h4><a id="4.23" name="4.23"></a>4.23) ���������� outer join �������ӣ���</h4>
+
+ <p>PostgreSQL ���ñ�׼�� SQL �﷨֧�������ӡ��������������ӣ�<br />
+ <br />
+ ��� SELECT *<br />
+ ��� FROM t1 LEFT OUTER JOIN t2 ON (t1.col = t2.col);<br />
+ <br />
+ ��<br />
+ ��� SELECT *<br />
+ ��� FROM t1 LEFT OUTER JOIN t2 USING (col);<br />
+ <br />
+ �������ȼ۵IJ�ѯ�� t1.col �� t2.col �������ӣ����ҷ��?t1 ������δ���ӵ��У���Щ�� t2 ��û��ƥ����У�����[��]����(RIGHT OUTER JOIN)������ t2 ��δ���ӵ��С���ȫ�����ӣ�FULL OUTER JOIN�������� t1 �� t2 ��δ���ӵ��С��ؼ��� OUTER ����[��]���ӡ���[��]���Ӻ���ȫ[��]�������ǿ�ѡ�ģ���ͨ���ӱ���Ϊ�����ӣ�INNER JOIN����<br />
+ <br />
+ �ڴ�ǰ�İ汾�У������ӿ����� UNION �� NOT IN ��ģ�⡣���磬����������ڱ� tab1 �� tab2 ֮���������ӣ�<br />
+ <br />
+ ��� SELECT tab1.col1, tab2.col2<br />
+ ��� FROM tab1, tab2<br />
+ ��� WHERE tab1.col1 = tab2.col1<br />
+ <br />
+ ��� UNION ALL<br />
+ <br />
+ ��� SELECT tab1.col1, NULL<br />
+ ��� FROM tab1<br />
+ ��� WHERE tab1.col1 NOT IN (SELECT tab2.col1 FROM tab2)<br />
+ ��� ORDER BY col1</p>
+
+ <h4><a id="4.24" name="4.24"></a>4.24) ���ʹ���漰������ݿ�IJ�ѯ��</h4>
+
+ <p>û�а취��ѯ��ǰ���ݿ�֮������ݿ⡣��Ϊ PostgreSQL �������ݿ���ص�ϵͳĿ¼��ϵͳ�����������ݿ�IJ�ѯ���ִ��Ҳδ��ȷ��<br />
+ <br />
+ contrib/dblink �������ú�������ʵ�ֿ���ѯ����Ȼ����ͬʱ���ӵ���ͬ�����ݿⲢ�ڿͻ��˺ϲ������</p>
+
+ <h4><a id="4.25" name="4.25"></a>4.25) ����ú������ض��л���У�</h4>
+
+ <p>������ PL/pgSQL ������ʹ�� refcursors ���ؽ�������ο� <a href="http://www.PostgreSQL.org/idocs/index.php?plpgsql-cursors.html">http://www.PostgreSQL.org/idocs/index.php?plpgsql-cursors.html</a>, 23.7.3.3�ڡ�<br />
+ </p>
+
+ <h4><a id="4.26" name="4.26"></a>4.26) Ϊʲô�� PL/PgSQL �����в��ܿɿ��ش�����ɾ����ʱ����</h4>
+
+ <p>PL/PgSQL ���溯�������ݣ��ɴ˴�����һ�����õĸ���������һ�� PL/PgSQL ����������һ����ʱ����Ȼ��ñ���ɾ�����ؽ��ˣ����ٴε��øú�����ʧ�ܣ���Ϊ����ĺ���������Ȼָ��ɵ���ʱ��������ķ������� PL/PgSQL ���� EXECUTE ����ʱ�����з��ʡ������ᱣ֤��ѯ��ִ��ǰ�������·�����</p>
+
+ <h4><a id="4.27" name="4.27"></a>4.27) ����Щ���ݸ���ѡ�</h4>
+
+ <p>�м�����/�ӷ�ʽ�ĸ���ѡ���Щѡ��ֻ���������ݿ���и��£������ݿ�ֻ�ܽ��ж�����ҳ <a href="http://gborg.PostgreSQL.org/genpage?replication_research">http://gborg.PostgreSQL.org/genpage?replication_research</a>� ������г�����Щѡ��� <a href="http://gborg.PostgreSQL.org/project/pgreplication/projdisplay.php">http://gborg.PostgreSQL.org/project/pgreplication/projdisplay.php</a> ���ڽ���һ�����������ƵĽ��������</p>
+
+ <h4><a id="4.28" name="4.28"></a>4.28) ����Щ���ݼ���ѡ�</h4>
+
+ <p>contrib/pgcrypto �����˺ܶ��� SQL ��ѯ��ʹ�õļ��ܺ��������ܿͻ��˵��������˴������ݵ�Ψһ�������� pg_hba.conf �в��� hostss ���<br />
+ <br />
+ 7.3 �汾���Զ������ݿ��û�������м��ܡ�����ǰ�İ汾�У������� postgresql.conf �д� PASSWORD_ENCRYPTION ѡ����������������ڼ��ܵ��ļ�ϵͳ�ϣ��Դﵽ���ܵ�Ŀ�ģ���<br />
+ <br />
+ --------------------------------------------------------------------------------</p>
+
+ <h2 align="center">��չ PostgreSQL</h2>
+
+ <h4><a id="5.1" name="5.1"></a>5.1) ��д��һ���û����庯���������� psql ������ʱ��Ϊʲô�ᵼ�� core dump��</h4>
+
+ <p>������������ԭ��ܶࡣ������һ�������IJ��Գ����в�������Զ��庯����</p>
+
+ <h4><a id="5.2" name="5.2"></a>5.2) ������ܸ� PostgreSQL ����һЩͦ�����������ͺͺ�����</h4>
+
+ <p>�������չ���͵� pgsql-hackers �ʼ��б����������ջᱻ�ŵ� contrib/ ��Ŀ¼��<br />
+ </p>
+
+ <h4><a id="5.3" name="5.3"></a>5.3) ������дһ������һ��Ԫ��� C ������</h4>
+
+ <p>�� PostgreSQL 7.3 �Ժ�İ汾�У�C, PL/PgSQL �� SQL ��ȫ֧�ַ���ֵΪ���ĺ�����������Ϣ��ο� ����Աָ�ϣ�the Programmer's Guide������ contrib/tablefunc ����һ���������� C д�ķ���ֵΪ���ĺ�����</p>
+
+ <h4><a id="5.4" name="5.4"></a>5.4) ���޸���һ��Դ�ļ���Ϊʲô���±����û�п����ı䣿</h4>
+
+ <p>Makefiles ��û�а���ͷ�ļ�����ȷ����������������make clean�� ����һ�� make �������ʹ�õ��� GCC ������Բ���ѡ�� --enable-depend �ñ������Զ�����ͷ�ļ���������ϵ��</p>
+ </body>
+</html>
+