11
22 Frequently Asked Questions (FAQ) for PostgreSQL
33
4- Last updated: Sat Oct 24 00:12:23 EDT 1998
4+ Last updated: Sat Dec 12 22:56:56 EST 1998
55
66 Current maintainer: Bruce Momjian (maillist@candle.pha.pa.us)
77
6868 cursors?
6969 3.5) What is an R-tree index and what is it used for?
7070 3.6) What is the maximum size for a tuple?
71- 3.7) I defined indices but my queries don't seem to make use of them.
72- Why?
71+ 3.7) My queries are slow or don't make use of the indexes. Why?
7372 3.8) How do I do regular expression searches? case-insensitive regexp
7473 searching?
7574 3.9) I experienced a server crash during a vacuum. How do I remove the
@@ -275,7 +274,7 @@ Section 1: General Questions
275274 pg_upgrade utility. Those upgrading from earlier releases require a
276275 dump and restore.
277276
278- Those ugrading from versions earlier than 1.09 must upgrade to 1.09
277+ Those upgrading from versions earlier than 1.09 must upgrade to 1.09
279278 first without a dump/reload, then dump the data from 1.09, and then
280279 load it into 6.4.
281280
@@ -306,14 +305,14 @@ Section 1: General Questions
306305 PHP is great for simple stuff, but for more complex stuff, some still
307306 use the perl interface and CGI.pm.
308307
309- An WWW gatway based on WDB using perl can be downloaded from
308+ An WWW gateway based on WDB using perl can be downloaded from
310309 http://www.eol.ists.ca/~dunlop/wdb-p95
311310
312311 1.13) Does PostgreSQL have a graphical user interface? A report generator? A
313312 embedded query language interface?
314313
315314 We have a nice graphical user interface called pgaccess, which is
316- shipped as part of the distribtion . Pgaccess also has a report
315+ shipped as part of the distribution . Pgaccess also has a report
317316 generator.
318317
319318 The web page is http://www.flex.ro/pgaccess We also include ecpg,
@@ -433,7 +432,7 @@ Section 2: Installation Questions
433432
434433 You can also use the postgres -S option to increase the maximum amount
435434 of memory used by each backend process for temporary sorts. Each
436- buffer is 1K and the defualt is 512 buffers.
435+ buffer is 1K and the default is 512 buffers.
437436
438437 You can also use the cluster command to group data in base tables to
439438 match an index. See the cluster(l) manual page for more details.
@@ -471,7 +470,7 @@ Section 2: Installation Questions
471470 operating system can attach to a running backend directly to diagnose
472471 problems.
473472
474- The postgres program has a -s, -A, -t options that can be very usefull
473+ The postgres program has a -s, -A, -t options that can be very useful
475474 for debugging and performance measurements.
476475
477476 You can also compile with profiling to see what functions are taking
@@ -483,7 +482,7 @@ Section 2: Installation Questions
483482
484483 Edit include/storage/sinvaladt.h, and change the value of
485484 MaxBackendId. In the future, we plan to make this a configurable
486- prameter .
485+ parameter .
487486
488487 2.14) What non-unix ports are available?
489488
@@ -492,12 +491,16 @@ Section 2: Installation Questions
492491 the client is running on MS Windows, and communicates via TCP/IP to a
493492 server running on one of our supported Unix platforms.
494493
495- A file win32.mak is included in the distributiion for making a Win32
494+ A file win32.mak is included in the distribution for making a Win32
496495 libpq library and psql.
497496
498- Someone is attempting to port our PostgreSQL database server to
499- Windows NT using the Cygnus Unix/NT porting library. He has gotten it
500- compiled, but initdb is currently failing.
497+ The database server is now working on Windows NT using the Cygnus
498+ Unix/NT porting library. The only feature missing is dynamic loading
499+ of user-defined functions/types. See
500+ http://www.askesis.nl/AskesisPostgresIndex.html for more information.
501+
502+ There is another port using U/Win at
503+ http://surya.wipro.com/uwin/ported.html.
501504 _________________________________________________________________
502505
503506Section 3: PostgreSQL Features
@@ -569,22 +572,28 @@ Section 3: PostgreSQL Features
569572 Tuples do not cross 8k boundaries so a 5k tuple will require 8k of
570573 storage.
571574
572- 3.7) I defined indices but my queries don't seem to make use of them . Why?
575+ 3.7) My queries are slow or don't make use of the indexes . Why?
573576
574577 PostgreSQL does not automatically maintain statistics. One has to make
575578 an explicit vacuum call to update the statistics. After statistics are
576579 updated, the optimizer knows how many rows in the table, and can
577580 better decide if it should use indices. Note that the optimizer does
578- not use indices in cases when the table is small because a sequentail
579- scan would be faster. For column-specific optimization statistics, use
580- vacuum analyze.
581+ not use indices in cases when the table is small because a sequential
582+ scan would be faster.
583+
584+ For column-specific optimization statistics, use vacuum analyze.
585+ Vacuum analyze is important for complex multi-join queries, so the
586+ optimizer can estimate the number of rows returned from each table,
587+ and choose the proper join order. The backend does not keep track of
588+ column statistics on its own, and vacuum analyze must be run to
589+ collect them periodically.
581590
582591 Indexes are not used for order by operations.
583592
584- When using wildcard operators like LIKE or ~, indices can only be used
585- if the beginning of the search is anchored to the start of the string.
586- So, to use indices, LIKE searches can should not begin with %, and
587- ~(regular expression searches) should start with ^.
593+ When using wild-card operators like LIKE or ~, indices can only be
594+ used if the beginning of the search is anchored to the start of the
595+ string. So, to use indices, LIKE searches can should not begin with %,
596+ and ~(regular expression searches) should start with ^.
588597
589598 3.8) How do I do regular expression searches? case-insensitive regexp
590599 searching?
@@ -681,9 +690,9 @@ BYTEA bytea variable-length array of bytes
681690 CREATE TABLE new_table (mycol int);
682691 INSERT INTO new_table SELECT oid, mycol FROM old_table;
683692
684- Tids are used to indentify specific physical rows with block and
685- offset values. Tids change after rows are modified or reloaded. They
686- are used by index entries to point to physical rows.
693+ Tids are used to identify specific physical rows with block and offset
694+ values. Tids change after rows are modified or reloaded. They are used
695+ by index entries to point to physical rows.
687696
688697 3.18) What is the meaning of some of the terms used in PostgreSQL?
689698
@@ -794,10 +803,8 @@ Section 4: Extending PostgreSQL
794803 4.2) I get messages of the type NOTICE:PortalHeapMemoryFree: 0x402251d0 not
795804 in alloc set!
796805
797- You are pfree'ing something that was not palloc'ed. When writing
798- user-defined functions, do not include the file "libpq-fe.h". Doing so
799- will cause your palloc to be a malloc instead of a free. Then, when
800- the backend pfrees the storage, you get the notice message.
806+ You are pfree'ing something that was not palloc'ed. Beware of mixing
807+ malloc/free and palloc/pfree.
801808
802809 4.3) I've written some nifty new types and functions for PostgreSQL.
803810
0 commit comments