Skip to content

Commit eed55d9

Browse files
committed
Update FAQ.
1 parent 4108bf6 commit eed55d9

File tree

2 files changed

+140
-138
lines changed

2 files changed

+140
-138
lines changed

doc/FAQ

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@
9090
4.14) In a query, how do I detect if a field is NULL?
9191
4.15) What is the difference between the various character types?
9292
4.16.1) How do I create a serial/auto-incrementing field?
93-
4.16.2) How do I get the value of a serial insert?
93+
4.16.2) How do I get the value of a SERIAL insert?
9494
4.16.3) Don't currval() and nextval() lead to a race condition with
95-
other concurrent backend processes?
96-
4.17) What is an oid? What is a tid?
95+
other users?
96+
4.17) What is an OID? What is a TID?
9797
4.18) What is the meaning of some of the terms used in PostgreSQL?
9898
4.19) Why do I get the error "FATAL: palloc failure: memory
9999
exhausted?"
@@ -108,13 +108,13 @@
108108

109109
5.1) I wrote a user-defined function. When I run it in psql, why does
110110
it dump core?
111-
5.2) What does the message: NOTICE:PortalHeapMemoryFree: 0x402251d0
112-
not in alloc set! mean?
111+
5.2) What does the message "NOTICE:PortalHeapMemoryFree: 0x402251d0
112+
not in alloc set!" mean?
113113
5.3) How can I contribute some nifty new types and functions to
114114
PostgreSQL?
115115
5.4) How do I write a C function to return a tuple?
116-
5.5) I have changed a source file. Why does the recompile does not see
117-
the change?
116+
5.5) I have changed a source file. Why does the recompile not see the
117+
change?
118118
_________________________________________________________________
119119

120120
General Questions
@@ -219,8 +219,8 @@
219219

220220
The main mailing list is: pgsql-general@PostgreSQL.org. It is
221221
available for discussion of matters pertaining to PostgreSQL. To
222-
subscribe, send a mail with the lines in the body (not the subject
223-
line)
222+
subscribe, send mail with the following lines in the body (not the
223+
subject line)
224224
subscribe
225225
end
226226

@@ -280,8 +280,8 @@
280280

281281
1.9) How do I find out about known bugs or missing features?
282282

283-
PostgreSQL supports an extended subset of SQL-92. See our TODO for a
284-
list of known bugs, missing features, and future plans.
283+
PostgreSQL supports an extended subset of SQL-92. See our TODO list
284+
for known bugs, missing features, and future plans.
285285

286286
1.10) How can I learn SQL?
287287

@@ -303,16 +303,16 @@
303303

304304
1.12) How do I join the development team?
305305

306-
First, download the latest sources and read the PostgreSQL Developers
306+
First, download the latest source and read the PostgreSQL Developers
307307
documentation on our web site, or in the distribution. Second,
308308
subscribe to the pgsql-hackers and pgsql-patches mailing lists. Third,
309309
submit high-quality patches to pgsql-patches.
310310

311311
There are about a dozen people who have commit privileges to the
312312
PostgreSQL CVS archive. They each have submitted so many high-quality
313-
patches that it was a pain for the existing committers to keep up, and
314-
we had confidence that patches they committed were likely to be of
315-
high quality.
313+
patches that it was impossible for the existing committers to keep up,
314+
and we had confidence that patches they committed were of high
315+
quality.
316316

317317
1.13) How do I submit a bug report?
318318

@@ -333,7 +333,7 @@
333333
some features they don't have, like user-defined types,
334334
inheritance, rules, and multi-version concurrency control to
335335
reduce lock contention. We don't have outer joins, but are
336-
working on them for our next release.
336+
working on them.
337337

338338
Performance
339339
PostgreSQL runs in two modes. Normal fsync mode flushes every
@@ -442,7 +442,7 @@
442442
* Python(PyGreSQL)
443443
* TCL(libpgtcl)
444444
* C Easy API(libpgeasy)
445-
* Embedded HTML(PHP from http://www.php.net)
445+
* Embedded HTML (PHP from http://www.php.net)
446446
_________________________________________________________________
447447

448448
Administrative Questions
@@ -474,9 +474,9 @@
474474
You either do not have shared memory configured properly in your
475475
kernel or you need to enlarge the shared memory available in the
476476
kernel. The exact amount you need depends on your architecture and how
477-
many buffers and backend processes you configure postmaster to run
478-
with. For most systems, with default numbers of buffers and processes,
479-
you need a minimum of ~1MB.
477+
many buffers and backend processes you configure for the postmaster.
478+
For most systems, with default numbers of buffers and processes, you
479+
need a minimum of ~1MB.
480480

481481
3.5) When I try to start the postmaster, I get IpcSemaphoreCreate errors.
482482
Why?
@@ -511,7 +511,7 @@
511511

512512
You should not create database users with user id 0 (root). They will
513513
be unable to access the database. This is a security precaution
514-
because of the ability of any user to dynamically link object modules
514+
because of the ability of users to dynamically link object modules
515515
into the database engine.
516516

517517
3.9) All my servers crash under concurrent table access. Why?
@@ -533,9 +533,9 @@
533533
reduces the transaction overhead. Also consider dropping and
534534
recreating indices when making large data changes.
535535

536-
There are several tuning things that can be done. You can disable
537-
fsync() by starting the postmaster with a -o -F option. This will
538-
prevent fsync()'s from flushing to disk after every transaction.
536+
There are several tuning options. You can disable fsync() by starting
537+
the postmaster with a -o -F option. This will prevent fsync()'s from
538+
flushing to disk after every transaction.
539539

540540
You can also use the postmaster -B option to increase the number of
541541
shared memory buffers used by the backend processes. If you make this
@@ -548,7 +548,7 @@
548548
value is measured in kilobytes, and the default is 512 (ie, 512K).
549549

550550
You can also use the CLUSTER command to group data in tables to match
551-
an index. See the cluster(l) manual page for more details.
551+
an index. See the CLUSTER manual page for more details.
552552

553553
3.11) What debugging features are available?
554554

@@ -629,8 +629,8 @@
629629

630630
They are temporary files generated by the query executor. For example,
631631
if a sort needs to be done to satisfy an ORDER BY, and the sort
632-
requires more space than the backend's -S parameter allows, then temp
633-
files are created to hold the extra data.
632+
requires more space than the backend's -S parameter allows, then
633+
temporary files are created to hold the extra data.
634634

635635
The temp files should be deleted automatically, but might not if a
636636
backend crashes during a sort. If you have no backends running at the
@@ -695,7 +695,7 @@ Maximum number of indexes on a table? unlimited
695695
BLCKSZ. To use attributes larger than 8K, you can also use the large
696696
object interface.
697697

698-
Row length limit will be removed in 7.1.
698+
The row length limit will be removed in 7.1.
699699

700700
4.7)How much database disk space is required to store data from a typical
701701
text file?
@@ -847,13 +847,13 @@ BYTEA bytea variable-length array of bytes
847847
CREATE UNIQUE INDEX person_id_key ON person ( id );
848848

849849
See the create_sequence manual page for more information about
850-
sequences. You can also use each row's oid field as a unique value.
850+
sequences. You can also use each row's OID field as a unique value.
851851
However, if you need to dump and reload the database, you need to use
852-
pg_dump's -o option or COPY WITH OIDS option to preserve the oids.
852+
pg_dump's -o option or COPY WITH OIDS option to preserve the OIDs.
853853

854854
Numbering Rows.
855855

856-
4.16.2) How do I get the back the generated SERIAL value after an insert?
856+
4.16.2) How do I get the value of a SERIAL insert?
857857

858858
One approach is to to retrieve the next SERIAL value from the sequence
859859
object with the nextval() function before inserting and then insert it
@@ -873,43 +873,43 @@ BYTEA bytea variable-length array of bytes
873873
INSERT INTO person (name) VALUES ('Blaise Pascal');
874874
$newID = currval('person_id_seq');
875875

876-
Finally, you could use the oid returned from the INSERT statement to
876+
Finally, you could use the OID returned from the INSERT statement to
877877
lookup the default value, though this is probably the least portable
878878
approach. In perl, using DBI with Edmund Mergl's DBD::Pg module, the
879879
oid value is made available via $sth->{pg_oid_status} after
880880
$sth->execute().
881881

882882
4.16.3) Don't currval() and nextval() lead to a race condition with other
883-
concurrent backend processes?
883+
users?
884884

885885
No. This is handled by the backends.
886886

887-
4.17) What is an oid? What is a tid?
887+
4.17) What is an OID? What is a TID?
888888

889889
OIDs are PostgreSQL's answer to unique row ids. Every row that is
890-
created in PostgreSQL gets a unique oid. All oids generated during
890+
created in PostgreSQL gets a unique OID. All OIDs generated during
891891
initdb are less than 16384 (from backend/access/transam.h). All
892-
user-created oids are equal or greater that this. By default, all
893-
these oids are unique not only within a table, or database, but unique
892+
user-created OIDs are equal or greater that this. By default, all
893+
these OIDs are unique not only within a table, or database, but unique
894894
within the entire PostgreSQL installation.
895895

896-
PostgreSQL uses oids in its internal system tables to link rows
897-
between tables. These oids can be used to identify specific user rows
898-
and used in joins. It is recommended you use column type oid to store
899-
oid values. You can create an index on the oid field for faster
896+
PostgreSQL uses OIDs in its internal system tables to link rows
897+
between tables. These OIDs can be used to identify specific user rows
898+
and used in joins. It is recommended you use column type OID to store
899+
OID values. You can create an index on the OID field for faster
900900
access.
901901

902902
Oids are assigned to all new rows from a central area that is used by
903-
all databases. If you want to change the oid to something else, or if
904-
you want to make a copy of the table, with the original oid's, there
903+
all databases. If you want to change the OID to something else, or if
904+
you want to make a copy of the table, with the original OID's, there
905905
is no reason you can't do it:
906906
CREATE TABLE new_table(old_oid oid, mycol int);
907907
SELECT old_oid, mycol INTO new FROM old;
908908
COPY new TO '/tmp/pgtable';
909909
DELETE FROM new;
910910
COPY new WITH OIDS FROM '/tmp/pgtable';
911911

912-
Tids are used to identify specific physical rows with block and offset
912+
TIDs are used to identify specific physical rows with block and offset
913913
values. Tids change after rows are modified or reloaded. They are used
914914
by index entries to point to physical rows.
915915

@@ -923,7 +923,7 @@ BYTEA bytea variable-length array of bytes
923923
* retrieve, select
924924
* replace, update
925925
* append, insert
926-
* oid, serial value
926+
* OID, serial value
927927
* portal, cursor
928928
* range variable, table name, table alias
929929

@@ -969,7 +969,7 @@ BYTEA bytea variable-length array of bytes
969969

970970
Currently, we join subqueries to outer queries by sequential scanning
971971
the result of the subquery for each row of the outer query. A
972-
workaround is to replace IN with EXISTS. For example, change:
972+
workaround is to replace IN with EXISTS:
973973
SELECT *
974974
FROM tab
975975
WHERE col1 IN (SELECT col2 FROM TAB2)
@@ -1005,8 +1005,8 @@ BYTEA bytea variable-length array of bytes
10051005
The problem could be a number of things. Try testing your user-defined
10061006
function in a stand alone test program first.
10071007

1008-
5.2) What does the message: NOTICE:PortalHeapMemoryFree: 0x402251d0 not in
1009-
alloc set! mean?
1008+
5.2) What does the message "NOTICE:PortalHeapMemoryFree: 0x402251d0 not in
1009+
alloc set!" mean?
10101010

10111011
You are pfree'ing something that was not palloc'ed. Beware of mixing
10121012
malloc/free and palloc/pfree.
@@ -1021,9 +1021,8 @@ BYTEA bytea variable-length array of bytes
10211021
This requires wizardry so extreme that the authors have never tried
10221022
it, though in principle it can be done.
10231023

1024-
5.5) I have changed a source file. Why does the recompile does not see the
1024+
5.5) I have changed a source file. Why does the recompile not see the
10251025
change?
10261026

10271027
The Makefiles do not have the proper dependencies for include files.
1028-
You have to do a make clean and then another make. You have to do a
1029-
make clean and then another make.
1028+
You have to do a make clean and then another make.

0 commit comments

Comments
 (0)