1414alink ="#0000ff ">
1515< H1 > Frequently Asked Questions (FAQ) for PostgreSQL</ H1 >
1616
17- < P > Last updated: Sun Oct 1322:49:56 EDT 2002</ P >
17+ < P > Last updated: Sun Oct 1323:15:09 EDT 2002</ P >
1818
1919< P > Current maintainer: Bruce Momjian (< A href =
2020 "mailto:pgman@candle.pha.pa.us "> pgman@candle.pha.pa.us</ A > )< BR >
@@ -78,8 +78,8 @@ <H2 align="center">Administrative Questions</H2>
7878< A href ="#3.7 "> 3.7</ A > ) What debugging features are available?< BR >
7979< A href ="#3.8 "> 3.8</ A > ) Why do I get< I > "Sorry, too many
8080 clients"</ I > when trying to connect?< BR >
81- < A href ="#3.9 "> 3.9</ A > ) Whatare the< I > pg_sorttempNNN.NN </ I >
82- files in my database directory?< BR >
81+ < A href ="#3.9 "> 3.9</ A > ) Whatis in the< I > pgsql_tmp </ I >
82+ directory?< BR >
8383< A href ="#3.10 "> 3.10</ A > ) Why do I need to do a dump and restore
8484 to upgrade PostgreSQL releases?< BR >
8585
@@ -250,10 +250,11 @@ <H4><A name="1.4">1.4</A>) What non-Unix ports are available?</H4>
250250< P > The database server can run on Windows NT and Win2k using
251251 Cygwin, the Cygnus Unix/NT porting library. See
252252< I > pgsql/doc/FAQ_MSWIN</ I > in the distribution or the MS Windows FAQ
253- at< A href ="http://www.PostgreSQL.org/docs/faq-mswin.html "> http://www.PostgreSQL.org/docs/faq-mswin.html</ A > .</ P >
253+ at< A href ="http://www.PostgreSQL.org/docs/faq-mswin.html ">
254+ http://www.PostgreSQL.org/docs/faq-mswin.html</ A > .</ P >
254255
255- < p > A native port tosome Microsoft platforms is currently being worked
256- upon .</ p >
256+ < p > A native port toMS Win NT/2000/XP is currently being worked
257+ on .</ p >
257258
258259< H4 > < A name ="1.5 "> 1.5</ A > ) Where can I get PostgreSQL?</ H4 >
259260
@@ -484,7 +485,7 @@ <H4><A name="1.15">1.15</A>) How can I financially assist
484485 PostgreSQL?</ H4 >
485486
486487< P > PostgreSQL has had a first-class infrastructure since we started
487- in1994 . This is all thanks to Marc Fournier, who has created
488+ in1996 . This is all thanks to Marc Fournier, who has created
488489 and managed this infrastructure over the years.</ P >
489490
490491< P > Quality infrastructure is very important to an open-source
@@ -545,9 +546,9 @@ <H4><A name="2.3">2.3</A>) Does PostgreSQL have a graphical user
545546 interface? A report generator? An embedded query language
546547 interface?</ H4 >
547548
548- < P > We have a nice graphical user interface called PgAccess, whichis
549- shipped as part of the distribution. PgAccess also has a report
550- generator. The Web page is < A href ="http://www.pgaccess.org/ "> http://www.pgaccess.org/</ A > .</ P >
549+ < P > We have a nice graphical user interface called PgAccess whichcan
550+ also be used as a report generator. The Web page is
551+ < A href ="http://www.pgaccess.org/ "> http://www.pgaccess.org/</ A > .</ P >
551552
552553< P > We also include< I > ecpg</ I > , which is an embedded SQL query
553554 language interface for C.</ P >
@@ -565,7 +566,7 @@ <H4><A name="2.4">2.4</A>) What languages are able to communicate with PostgreSQ
565566
566567< LI > Java (jdbc)</ LI >
567568
568- < LI > Perl (DBD::Pg)</ LI >
569+ < LI > Perl (DBD::Pg and perl5 )</ LI >
569570
570571< LI > ODBC (odbc)</ LI >
571572
@@ -578,7 +579,9 @@ <H4><A name="2.4">2.4</A>) What languages are able to communicate with PostgreSQ
578579< LI > PHP ('pg_' functions, Pear::DB)</ LI >
579580</ UL >
580581< P > Additional interfaces are available at
581- < a href ="http://www.PostgreSQL.org/interfaces.html "> http://www.PostgreSQL.org/interfaces.html</ A > .
582+ < a href ="http://www.PostgreSQL.org/interfaces.html "> http://www.PostgreSQL.org/interfaces.html</ A >
583+ and
584+ < a href ="http://gborg.PostgreSQL.org "> http://gborg.PostgreSQL.org</ A > .
582585</ P >
583586< HR >
584587
@@ -765,19 +768,18 @@ <H4><A name="3.8">3.8</A>) Why do I get <I>"Sorry, too many
765768 the MaxBackendId constant in
766769< I > include/storage/sinvaladt.h</ I > .</ P >
767770
768- < H4 > < A name ="3.9 "> 3.9</ A > ) What are the< I > pg_tempNNN.NN </ I >
769- files in my database directory?</ H4 >
771+ < H4 > < A name ="3.9 "> 3.9</ A > ) What are the< I > pgsql_tmp </ I >
772+ directory?</ H4 >
770773
771774< P > They are temporary files generated by the query executor. For
772775 example, if a sort needs to be done to satisfy an< SMALL > ORDER
773776 BY,</ SMALL > and the sort requires more space than the backend's
774777< I > -S</ I > parameter allows, then temporary files are created to
775778 hold the extra data.</ P >
776779
777- < P > The temporary files should be deleted automatically, but might
778- not if a backend crashes during a sort. If you have no backends
779- running at the time, it is safe to delete the pg_tempNNN.NN
780- files.</ P >
780+ < P > The temporary files are usually deleted automatically, but might
781+ remain if a backend crashes during a sort. A stop and restart of the
782+ < I > postmaster</ I > will remove files from those directories.</ P >
781783
782784< H4 > < A name ="3.10 "> 3.10</ A > ) Why do I need to do a dump and restore
783785 to upgrade between major PostgreSQL releases?</ H4 >
@@ -790,10 +792,10 @@ <H4><A name="3.10">3.10</A>) Why do I need to do a dump and restore
790792 data in a generic format that can then be loaded in using the new internal
791793 format.</ P >
792794
793- < p > In releases where the on-disk format does not change, the
794- < i > pg_upgrade</ i > script can be used to upgrade without a dump/restore.
795- The release notes mention whether< i > pg_upgrade</ i > is available for the
796- release.</ p >
795+ < P > In releases where the on-disk format does not change, the
796+ < I > pg_upgrade</ I > script can be used to upgrade without a dump/restore.
797+ The release notes mention whether< I > pg_upgrade</ I > is available for the
798+ release.</ P >
797799
798800< HR >
799801
@@ -831,8 +833,9 @@ <H4><A name="4.3">4.3</A>) How do I get a list of tables or other
831833< H4 > < A name ="4.4 "> 4.4</ A > ) How do you remove a column from a
832834 table?</ H4 >
833835
834- < P > Prior to version 7.3,< SMALL > ALTER TABLE DROP COLUMN</ SMALL > is not supported.
835- You can do this instead:</ P >
836+ < P > This functionality was added in release 7.3 with
837+ < SMALL > ALTER TABLE DROP COLUMN</ SMALL > . In earlier versions,
838+ you can do this:</ P >
836839< PRE >
837840 BEGIN;
838841 LOCK TABLE old_table;
@@ -1023,13 +1026,13 @@ <H4><A name="4.12">4.12</A>) How do I perform regular expression
10231026< PRE >
10241027 SELECT *
10251028 FROM tab
1026- WHERELOWER (col) = 'abc';
1029+ WHERElower (col) = 'abc';
10271030</ PRE >
10281031
10291032 This will not use an standard index. However, if you create a
10301033 functional index, it will be used:
10311034< PRE >
1032- CREATE INDEX tabindex ON tab (LOWER (col));
1035+ CREATE INDEX tabindex ON tab (lower (col));
10331036</ PRE >
10341037
10351038< H4 > < A name ="4.13 "> 4.13</ A > ) In a query, how do I detect if a field
@@ -1118,7 +1121,7 @@ <H4><A name="4.15.2">4.15.2</A>) How do I get the value of a
11181121 and your< SMALL > SERIAL</ SMALL > column, respectively.
11191122
11201123< P > Alternatively, you could retrieve the assigned
1121- < SMALL > SERIAL</ SMALL > value with the< I > currval</ I > () function
1124+ < SMALL > SERIAL</ SMALL > value with the< I > currval() </ I > function
11221125< I > after</ I > it was inserted by default, e.g.,</ P >
11231126< PRE >
11241127 execute("INSERT INTO person (name) VALUES ('Blaise Pascal')");
@@ -1135,7 +1138,7 @@ <H4><A name="4.15.2">4.15.2</A>) How do I get the value of a
11351138< H4 > < A name ="4.15.3 "> 4.15.3</ A > ) Don't< I > currval()</ I > and
11361139< I > nextval()</ I > lead to a race condition with other users?</ H4 >
11371140
1138- < P > No.< i > currval</ i > () returns the current value assigned by your
1141+ < P > No.< I > currval() </ I > returns the current value assigned by your
11391142 backend, not by all users.</ P >
11401143
11411144< H4 > < A name ="4.15.4 "> 4.15.4</ A > ) Why aren't my sequence numbers