90
90
4.14) In a query, how do I detect if a field is NULL?
91
91
4.15) What is the difference between the various character types?
92
92
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?
94
94
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 ?
97
97
4.18) What is the meaning of some of the terms used in PostgreSQL?
98
98
4.19) Why do I get the error "FATAL: palloc failure: memory
99
99
exhausted?"
108
108
109
109
5.1) I wrote a user-defined function. When I run it in psql, why does
110
110
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?
113
113
5.3) How can I contribute some nifty new types and functions to
114
114
PostgreSQL?
115
115
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?
118
118
_________________________________________________________________
119
119
120
120
General Questions
219
219
220
220
The main mailing list is: pgsql-general@PostgreSQL.org. It is
221
221
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)
224
224
subscribe
225
225
end
226
226
280
280
281
281
1.9) How do I find out about known bugs or missing features?
282
282
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.
285
285
286
286
1.10) How can I learn SQL?
287
287
303
303
304
304
1.12) How do I join the development team?
305
305
306
- First, download the latest sources and read the PostgreSQL Developers
306
+ First, download the latest source and read the PostgreSQL Developers
307
307
documentation on our web site, or in the distribution. Second,
308
308
subscribe to the pgsql-hackers and pgsql-patches mailing lists. Third,
309
309
submit high-quality patches to pgsql-patches.
310
310
311
311
There are about a dozen people who have commit privileges to the
312
312
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.
316
316
317
317
1.13) How do I submit a bug report?
318
318
333
333
some features they don't have, like user-defined types,
334
334
inheritance, rules, and multi-version concurrency control to
335
335
reduce lock contention. We don't have outer joins, but are
336
- working on them for our next release .
336
+ working on them.
337
337
338
338
Performance
339
339
PostgreSQL runs in two modes. Normal fsync mode flushes every
442
442
* Python(PyGreSQL)
443
443
* TCL(libpgtcl)
444
444
* C Easy API(libpgeasy)
445
- * Embedded HTML(PHP from http://www.php.net)
445
+ * Embedded HTML (PHP from http://www.php.net)
446
446
_________________________________________________________________
447
447
448
448
Administrative Questions
474
474
You either do not have shared memory configured properly in your
475
475
kernel or you need to enlarge the shared memory available in the
476
476
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.
480
480
481
481
3.5) When I try to start the postmaster, I get IpcSemaphoreCreate errors.
482
482
Why?
511
511
512
512
You should not create database users with user id 0 (root). They will
513
513
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
515
515
into the database engine.
516
516
517
517
3.9) All my servers crash under concurrent table access. Why?
533
533
reduces the transaction overhead. Also consider dropping and
534
534
recreating indices when making large data changes.
535
535
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.
539
539
540
540
You can also use the postmaster -B option to increase the number of
541
541
shared memory buffers used by the backend processes. If you make this
548
548
value is measured in kilobytes, and the default is 512 (ie, 512K).
549
549
550
550
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.
552
552
553
553
3.11) What debugging features are available?
554
554
629
629
630
630
They are temporary files generated by the query executor. For example,
631
631
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.
634
634
635
635
The temp files should be deleted automatically, but might not if a
636
636
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
695
695
BLCKSZ. To use attributes larger than 8K, you can also use the large
696
696
object interface.
697
697
698
- Row length limit will be removed in 7.1.
698
+ The row length limit will be removed in 7.1.
699
699
700
700
4.7)How much database disk space is required to store data from a typical
701
701
text file?
@@ -847,13 +847,13 @@ BYTEA bytea variable-length array of bytes
847
847
CREATE UNIQUE INDEX person_id_key ON person ( id );
848
848
849
849
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.
851
851
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 .
853
853
854
854
Numbering Rows.
855
855
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?
857
857
858
858
One approach is to to retrieve the next SERIAL value from the sequence
859
859
object with the nextval() function before inserting and then insert it
@@ -873,43 +873,43 @@ BYTEA bytea variable-length array of bytes
873
873
INSERT INTO person (name) VALUES ('Blaise Pascal');
874
874
$newID = currval('person_id_seq');
875
875
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
877
877
lookup the default value, though this is probably the least portable
878
878
approach. In perl, using DBI with Edmund Mergl's DBD::Pg module, the
879
879
oid value is made available via $sth->{pg_oid_status} after
880
880
$sth->execute().
881
881
882
882
4.16.3) Don't currval() and nextval() lead to a race condition with other
883
- concurrent backend processes ?
883
+ users ?
884
884
885
885
No. This is handled by the backends.
886
886
887
- 4.17) What is an oid ? What is a tid ?
887
+ 4.17) What is an OID ? What is a TID ?
888
888
889
889
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
891
891
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
894
894
within the entire PostgreSQL installation.
895
895
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
900
900
access.
901
901
902
902
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
905
905
is no reason you can't do it:
906
906
CREATE TABLE new_table(old_oid oid, mycol int);
907
907
SELECT old_oid, mycol INTO new FROM old;
908
908
COPY new TO '/tmp/pgtable';
909
909
DELETE FROM new;
910
910
COPY new WITH OIDS FROM '/tmp/pgtable';
911
911
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
913
913
values. Tids change after rows are modified or reloaded. They are used
914
914
by index entries to point to physical rows.
915
915
@@ -923,7 +923,7 @@ BYTEA bytea variable-length array of bytes
923
923
* retrieve, select
924
924
* replace, update
925
925
* append, insert
926
- * oid , serial value
926
+ * OID , serial value
927
927
* portal, cursor
928
928
* range variable, table name, table alias
929
929
@@ -969,7 +969,7 @@ BYTEA bytea variable-length array of bytes
969
969
970
970
Currently, we join subqueries to outer queries by sequential scanning
971
971
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:
973
973
SELECT *
974
974
FROM tab
975
975
WHERE col1 IN (SELECT col2 FROM TAB2)
@@ -1005,8 +1005,8 @@ BYTEA bytea variable-length array of bytes
1005
1005
The problem could be a number of things. Try testing your user-defined
1006
1006
function in a stand alone test program first.
1007
1007
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?
1010
1010
1011
1011
You are pfree'ing something that was not palloc'ed. Beware of mixing
1012
1012
malloc/free and palloc/pfree.
@@ -1021,9 +1021,8 @@ BYTEA bytea variable-length array of bytes
1021
1021
This requires wizardry so extreme that the authors have never tried
1022
1022
it, though in principle it can be done.
1023
1023
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
1025
1025
change?
1026
1026
1027
1027
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