提交 bf1dd3ec 编写于 作者: B Bruce Momjian

Update FAQ's for release.

上级 bafe9e50
Frequently Asked Questions (FAQ) for PostgreSQL
Last updated: Sat Oct 24 00:12:23 EDT 1998
Last updated: Fri Jun 4 23:30:19 EDT 1999
Current maintainer: Bruce Momjian (maillist@candle.pha.pa.us)
......@@ -9,13 +9,10 @@
postgreSQL Web site, http://postgreSQL.org.
Linux-specific questions are answered in
http://postgreSQL.org/docs/faq-linux.shtml.
http://postgreSQL.org/docs/faq-linux.html.
Irix-specific questions are answered in
http://postgreSQL.org/docs/faq-irix.shtml.
HPUX-specific questions are answered in
http://postgreSQL.org/docs/faq-hpux.shtml.
http://postgreSQL.org/docs/faq-irix.html.
_________________________________________________________________
General questions
......@@ -59,8 +56,10 @@
2.10) All my servers crash under concurrent table access. Why?
2.11) How do I tune the database engine for better performance?
2.12) What debugging features are available in PostgreSQL?
2.13) How do I enable more than 64 concurrent backends?
2.14) What non-unix ports are available?
2.13) When I try to start the postmaster, I get IpcSemaphoreCreate
errors. Why?
2.14) I get 'Sorry, too many clients' when trying to connect. Why?
2.15) What non-unix ports are available?
Operational questions
......@@ -70,9 +69,8 @@
3.4) What is the exact difference between binary cursors and normal
cursors?
3.5) What is an R-tree index and what is it used for?
3.6) What is the maximum size for a tuple?
3.7) I defined indices but my queries don't seem to make use of them.
Why?
3.6) What is the maximum size for a row, table, database?
3.7) My queries are slow or don't make use of the indexes. Why?
3.8) How do I do regular expression searches? case-insensitive regexp
searching?
3.9) I experienced a server crash during a vacuum. How do I remove the
......@@ -240,11 +238,11 @@ Section 1: General Questions
http://postgreSQL.org
There also an IRC channel on EFNet, channel #PostgreSQL. I use the
unix command irc -c '#PostgreSQL' "$USER" irc.ais.net
unix command irc -c '#PostgreSQL' "$USER" irc.phoenix.net
1.6) Latest release of PostgreSQL
The latest release of PostgreSQL is version 6.4.
The latest release of PostgreSQL is version 6.5.
We plan to have major releases every four months.
......@@ -274,13 +272,12 @@ Section 1: General Questions
1.10) Does PostgreSQL work with databases from earlier versions of
PostgreSQL?
Upgrading to 6.4 from release 6.3.* can be accomplished using the new
pg_upgrade utility. Those upgrading from earlier releases require a
dump and restore.
Upgrading to 6.5 can not use the pg_upgrade utility. Those upgrading
from earlier releases require a dump and restore.
Those ugrading from versions earlier than 1.09 must upgrade to 1.09
Those upgrading from versions earlier than 1.09 must upgrade to 1.09
first without a dump/reload, then dump the data from 1.09, and then
load it into 6.4.
load it into 6.5.
1.11) Are there ODBC drivers for PostgreSQL?
......@@ -309,14 +306,14 @@ Section 1: General Questions
PHP is great for simple stuff, but for more complex stuff, some still
use the perl interface and CGI.pm.
An WWW gatway based on WDB using perl can be downloaded from
An WWW gateway based on WDB using perl can be downloaded from
http://www.eol.ists.ca/~dunlop/wdb-p95
1.13) Does PostgreSQL have a graphical user interface? A report generator? A
embedded query language interface?
We have a nice graphical user interface called pgaccess, which is
shipped as part of the distribtion. Pgaccess also has a report
shipped as part of the distribution. Pgaccess also has a report
generator.
The web page is http://www.flex.ro/pgaccess We also include ecpg,
......@@ -365,8 +362,9 @@ Section 2: Installation Questions
formats.
Check your locale configuration. PostgreSQL uses the locale settings
of the user that ran the postmaster process. Set those accordingly for
your operating environment.
of the user that ran the postmaster process. There are postgres and
psql SET commands to control the date format. Set those accordingly
for your operating environment.
2.4) How do I install PostgreSQL somewhere other than /usr/local/pgsql?
......@@ -384,8 +382,9 @@ Section 2: Installation Questions
You either do not have shared memory configured properly in kernel or
you need to enlarge the shared memory available in the kernel. The
exact amount you need depends on your architecture and how many
buffers you configure postmaster to run with. For most systems, with
default buffer sizes, you need a minimum of ~760K.
buffers and backend processes you configure postmaster to run with.
For most systems, with default numbers of buffers and processes, you
need a minimum of ~1MB.
2.7) I have changed a source file, but a recompile does not see the change?
......@@ -420,7 +419,7 @@ Section 2: Installation Questions
If you are doing a lot of inserts, consider doing them in a large
batch using the copy command. This is much faster than single
individual inserts. Second, statements not in a begin work/commit
transaction block are considered to be their in their own transaction.
transaction block are considered to be in their own transaction.
Consider performing several statements in a single transaction block.
This reduces the transaction overhead. Also consider dropping and
recreating indices when making large data changes.
......@@ -436,7 +435,7 @@ Section 2: Installation Questions
You can also use the postgres -S option to increase the maximum amount
of memory used by each backend process for temporary sorts. Each
buffer is 1K and the defualt is 512 buffers.
buffer is 1K and the default is 512 buffers.
You can also use the cluster command to group data in base tables to
match an index. See the cluster(l) manual page for more details.
......@@ -474,7 +473,7 @@ Section 2: Installation Questions
operating system can attach to a running backend directly to diagnose
problems.
The postgres program has a -s, -A, -t options that can be very usefull
The postgres program has a -s, -A, -t options that can be very useful
for debugging and performance measurements.
You can also compile with profiling to see what functions are taking
......@@ -482,25 +481,64 @@ Section 2: Installation Questions
pgsql/data/base/dbname directory. The client profile file will be put
in the current directory.
2.13) How do I enable more than 64 concurrent backends?
Edit include/storage/sinvaladt.h, and change the value of
MaxBackendId. In the future, we plan to make this a configurable
prameter.
2.14) What non-unix ports are available?
2.13) When I try to start the postmaster, I get IpcSemaphoreCreate errors.
Why?
If the error message is IpcSemaphoreCreate: semget failed (No space
left on device) then your kernel is not configured with enough
semaphores. Postgres needs one semaphore per potential backend
process. A temporary solution is to start the postmaster with a
smaller limit on the number of backend processes. Use -N with a
parameter less than the default of 32. A more permanent solution is to
increase your kernel's SEMMNS and SEMMNI parameters.
If the error message is something else, you might not have semaphore
support configured in your kernel at all.
2.14) I get 'Sorry, too many clients' when trying to connect. Why?
You need to increase the postmaster's limit on how many concurrent
backend processes it can start.
In Postgres 6.5, the default limit is 32 processes. You can increase
it by restarting the postmaster with a suitable -N value. With the
default configuration you can set -N as large as 1024; if you need
more, increase MAXBACKENDS in include/config.h and rebuild. You can
set the default value of -N at configuration time, if you like, using
configure's --with-maxbackends switch.
Note that if you make -N larger than 32, you should consider
increasing -B beyond its default of 64. For large numbers of backend
processes, you are also likely to find that you need to increase
various Unix kernel configuration parameters. Things to check include
the maximum size of shared memory blocks, SHMMAX, the maximum number
of semaphores, SEMMNS and SEMMNI, the maximum number of processes,
NPROC, the maximum number of processes per user, MAXUPRC, and the
maximum number of open files, NFILE and NINODE. The reason that
Postgres has a limit on the number of allowed backend processes is so
that you can ensure that your system won't run out of resources.
In Postgres versions prior to 6.5, the maximum number of backends was
64, and changing it required a rebuild after altering the MaxBackendId
constant in include/storage/sinvaladt.h.
2.15) What non-unix ports are available?
It is possible to compile the libpq C library, psql, and other
interfaces and binaries to run on MS Windows platforms. In this case,
the client is running on MS Windows, and communicates via TCP/IP to a
server running on one of our supported Unix platforms.
A file win32.mak is included in the distributiion for making a Win32
A file win32.mak is included in the distribution for making a Win32
libpq library and psql.
Someone is attempting to port our PostgreSQL database server to
Windows NT using the Cygnus Unix/NT porting library. He has gotten it
compiled, but initdb is currently failing.
The database server is now working on Windows NT using the Cygnus
Unix/NT porting library. The only feature missing is dynamic loading
of user-defined functions/types. See
http://www.askesis.nl/AskesisPostgresIndex.html for more information.
There is another port using U/Win at
http://surya.wipro.com/uwin/ported.html.
_________________________________________________________________
Section 3: PostgreSQL Features
......@@ -562,32 +600,42 @@ Section 3: PostgreSQL Features
extending R-trees require a bit of work and we don't currently have
any documentation on how to do it.
3.6) What is the maximum size for a tuple?
3.6) What is the maximum size for a row, table, database?
Tuples are limited to 8K bytes. Taking into account system attributes
Rows are limited to 8K bytes. Taking into account system attributes
and other overhead, one should stay well shy of 8,000 bytes to be on
the safe side. To use attributes larger than 8K, try using the large
objects interface.
Tuples do not cross 8k boundaries so a 5k tuple will require 8k of
Rows do not cross 8k boundaries so a 5k row will require 8k of
storage.
3.7) I defined indices but my queries don't seem to make use of them. Why?
Table and database sizes are unlimited. There are many databases that
are tens of gigabytes, and probably some that are hundreds of
gigabytes.
3.7) My queries are slow or don't make use of the indexes. Why?
PostgreSQL does not automatically maintain statistics. One has to make
an explicit vacuum call to update the statistics. After statistics are
updated, the optimizer knows how many rows in the table, and can
better decide if it should use indices. Note that the optimizer does
not use indices in cases when the table is small because a sequentail
scan would be faster. For column-specific optimization statistics, use
vacuum analyze.
not use indices in cases when the table is small because a sequential
scan would be faster.
For column-specific optimization statistics, use vacuum analyze.
Vacuum analyze is important for complex multi-join queries, so the
optimizer can estimate the number of rows returned from each table,
and choose the proper join order. The backend does not keep track of
column statistics on its own, and vacuum analyze must be run to
collect them periodically.
Indexes are not used for order by operations.
When using wildcard operators like LIKE or ~, indices can only be used
if the beginning of the search is anchored to the start of the string.
So, to use indices, LIKE searches can should not begin with %, and
~(regular expression searches) should start with ^.
When using wild-card operators like LIKE or ~, indices can only be
used if the beginning of the search is anchored to the start of the
string. So, to use indices, LIKE searches can should not begin with %,
and ~(regular expression searches) should start with ^.
3.8) How do I do regular expression searches? case-insensitive regexp
searching?
......@@ -606,7 +654,7 @@ Type Internal Name Notes
CHAR char 1 character
CHAR(#) bpchar blank padded to the specified fixed length
VARCHAR(#) varchar size specifies maximum length, no padding
TEXT text length limited only by maximum tuple length
TEXT text length limited only by maximum row length
BYTEA bytea variable-length array of bytes
You need to use the internal name when doing internal operations.
......@@ -681,12 +729,15 @@ BYTEA bytea variable-length array of bytes
all databases. If you want to change the oid to something else, or if
you want to make a copy of the table, with the original oid's, there
is no reason you can't do it:
CREATE TABLE new_table (mycol int);
INSERT INTO new_table SELECT oid, mycol FROM old_table;
CREATE TABLE new_table(old_oid oid, mycol int);
SELECT INTO new SELECT old_oid, mycol FROM old;
COPY new TO '/tmp/pgtable';
DELETE FROM new;
COPY new WITH OIDS FROM '/tmp/pgtable';
Tids are used to indentify specific physical rows with block and
offset values. Tids change after rows are modified or reloaded. They
are used by index entries to point to physical rows.
Tids are used to identify specific physical rows with block and offset
values. Tids change after rows are modified or reloaded. They are used
by index entries to point to physical rows.
3.18) What is the meaning of some of the terms used in PostgreSQL?
......@@ -797,10 +848,8 @@ Section 4: Extending PostgreSQL
4.2) I get messages of the type NOTICE:PortalHeapMemoryFree: 0x402251d0 not
in alloc set!
You are pfree'ing something that was not palloc'ed. When writing
user-defined functions, do not include the file "libpq-fe.h". Doing so
will cause your palloc to be a malloc instead of a free. Then, when
the backend pfrees the storage, you get the notice message.
You are pfree'ing something that was not palloc'ed. Beware of mixing
malloc/free and palloc/pfree.
4.3) I've written some nifty new types and functions for PostgreSQL.
......
Developer's Frequently Asked Questions (FAQ) for PostgreSQL
Last updated: Fri Oct 2 15:21:32 EDT 1998
Last updated: Mon Feb 22 17:15:06 EST 1999
Current maintainer: Bruce Momjian (maillist@candle.pha.pa.us)
......@@ -67,7 +67,7 @@ s
Third, you need to get mkid from ftp.postgresql.org. By running
tools/make_mkid, an archive of source symbols can be created that can
be rapidly queried like grep or edited.
be rapidly queried like grep or edited. Others prefer glimpse.
make_diff has tools to create patch diff files that can be applied to
the distribution.
......@@ -105,22 +105,72 @@ s
We do this because this allows a consistent way to pass data inside
the backend in a flexible way. Every node has a NodeTag which
specifies what type of data is inside the Node. Lists are lists of
Nodes. lfirst(), lnext(), and foreach() are used to get, skip, and
traverse through Lists.
specifies what type of data is inside the Node. Lists are groups of
Nodes chained together as a forward-linked list.
Here are some of the List manipulation commands:
lfirst(i)
return the data at list element i.
lnext(i)
return the next list element after i.
foreach(i, list)
loop through list, assigning each list element to i. It is
important to note that i is a List *, not the data in the List
element. You need to use lfirst(i) to get at the data. Here is
a typical code snipped that loops through a List containing Var
*'s and processes each one:
List *i, *list;
foreach(i, list)
{
Var *var = lfirst(i);
/* process var here */
}
lcons(node, list)
add node to the front of list, or create a new list with node
if list is NIL.
lappend(list, node)
add node to the end of list. This is more expensive that lcons.
nconc(list1, list2)
Concat list2 on to the end of list1.
length(list)
return the length of the list.
nth(i, list)
return the i'th element in list.
lconsi, ...
There are integer versions of these: lconsi, lappendi, nthi.
List's containing integers instead of Node pointers are used to
hold list of relation object id's and other integer quantities.
You can print nodes easily inside gdb. First, to disable output
truncation:
truncation when you use the gdb print command:
(gdb) set print elements 0
You may then use either of the next two commands to print out List,
Node, and structure contents. The first prints in a short format, and
the second in a long format:
Instead of printing values in gdb format, you can use the next two
commands to print out List, Node, and structure contents in a verbose
format that is easier to understand. List's are unrolled into nodes,
and nodes are printed in detail. The first prints in a short format,
and the second in a long format:
(gdb) call print(any_pointer)
(gdb) call pprint(any_pointer)
The output appears in the postmaster log file, or on your screen if
you are running a backend directly without a postmaster.
5) How do I add a feature or fix a bug?
The source code is over 250,000 lines. Many problems/features are
......@@ -197,7 +247,7 @@ s
} NameData;
typedef NameData *Name;
Table, column, type, function, and view names that come in to the
Table, column, type, function, and view names that come into the
backend via user queries are stored as variable-length,
null-terminated character strings.
......@@ -244,12 +294,12 @@ s
While scans automatically lock/unlock rows from the buffer cache, with
heap_fetch(), you must pass a Buffer pointer, and ReleaseBuffer() it
when completed. Once you have the row, you can get data that is common
to all tuples, like t_ctid and t_oid, by mererly accessing the
to all tuples, like t_self and t_oid, by mererly accessing the
HeapTuple structure entries. If you need a table-specific column, you
should take the HeapTuple pointer, and use the GETSTRUCT() macro to
access the table-specific start of the tuple. You then cast the
pointer as a Form_pg_proc pointer if you are accessing the pg_proc
table, or TypeTupleForm if you are accessing pg_type. You can then
table, or Form_pg_type if you are accessing pg_type. You can then
access the columns by using a structure pointer:
((Form_pg_class) GETSTRUCT(tuple))->relnatts
......@@ -258,7 +308,7 @@ s
is to use heap_tuplemodify() and pass it your palloc'ed tuple, and the
values you want changed. It returns another palloc'ed tuple, which you
pass to heap_replace(). You can delete tuples by passing the tuple's
t_ctid to heap_destroy(). Remember, tuples can be either system cache
t_self to heap_destroy(). Remember, tuples can be either system cache
versions, which may go away soon after you get them, buffer cache
version, which will go away when you heap_getnext(), heap_endscan, or
ReleaseBuffer(), in the heap_fetch() case. Or it may be a palloc'ed
......
=======================================================
Frequently Asked Questions (FAQ) for PostgreSQL V6.4
HP-UX Specific
......@@ -10,19 +11,19 @@ original author: Tom Lane (tgl@sss.pgh.pa.us)
Questions covered here:
1.1) What do I need to install PostgreSQL on HP-UX?
1.2) Anything special about the build/install procedure?
1.3) yacc dies trying to process src/backend/parser/gram.y.
1.4) Linking the main postgres executable fails, complaining that
there's no "alloca" function.
1.5) OK, it seemed to build and install, but the regression test fails.
1.1) What do I need to install PostgreSQL on HP-UX?
1.2) Anything special about the build/install procedure?
1.3) yacc dies trying to process src/backend/parser/gram.y.
1.4) Linking the main postgres executable fails, complaining that
there's no "alloca" function.
1.5) OK, it seemed to build and install, but the regression test fails.
----------------------------------------------------------------------
Section 1: Installing PostgreSQL
----------------------------------------------------------------------
1.1) What do I need to install PostgreSQL on HP-UX?
1.1) What do I need to install PostgreSQL on HP-UX?
PostgreSQL 6.4 is known to build and pass regression test on HPUX 9.03,
9.05, and 10.20, given appropriate system patch levels and build tools.
......@@ -53,14 +54,14 @@ install on HPUX, so I recommend you not bother with anything older
than 6.4.
1.2) Anything special about the build/install procedure?
1.2) Anything special about the build/install procedure?
When you run configure, you will want to explicitly select either the
hpux_cc or hpux_gcc template depending on which compiler you plan to
use:
./configure --with-template=hpux_cc
./configure --with-template=hpux_cc
for HP's C compiler, or
./configure --with-template=hpux_gcc
./configure --with-template=hpux_gcc
for GNU gcc. (If you omit --with-template, configure may either
default to hpux_cc or give up entirely, depending on which HPUX and
PostgreSQL releases you have.)
......@@ -86,7 +87,7 @@ Otherwise the standard build/install procedure described in the
PostgreSQL documentation works fine.
1.3) yacc dies trying to process src/backend/parser/gram.y.
1.3) yacc dies trying to process src/backend/parser/gram.y.
HP's yacc doesn't create its tables large enough to handle the Postgres
grammar (a lot of other vendors' yaccs have this problem too). There
......@@ -106,15 +107,15 @@ are using HP's cc on HPUX 9 --- see next item.
3. Increase yacc's table sizes enough to cope. With a pre-6.4
PostgreSQL grammar, I was able to get HPUX 9's yacc to work by
setting YFLAGS to
-d -Np2000 -Ns3000 -Nm100000 -Nl2000 -Na30000 -Nc10000
-d -Np2000 -Ns3000 -Nm100000 -Nl2000 -Na30000 -Nc10000
(You can edit YFLAGS either in the template file before running
configure, or in src/Makefile.global afterwards.) Future PostgreSQL
releases might require even larger tables, but this should do for
a starting point.
1.4) Linking the main postgres executable fails, complaining that
there's no "alloca" function.
1.4) Linking the main postgres executable fails, complaining that
there's no "alloca" function.
If you're using HP's cc on HPUX 9, it's right: there's no alloca
function. The only place in PostgreSQL that uses alloca is the parser
......@@ -131,7 +132,7 @@ There are several possible answers:
before Y2K anyway...
1.5) OK, it seemed to build and install, but the regression test fails.
1.5) OK, it seemed to build and install, but the regression test fails.
There are several "expected failures" due to differences between HPUX
and the regression test reference platform used by the PostgreSQL group.
......@@ -139,26 +140,26 @@ A look at the textual differences between the expected and actual
outputs will usually reveal that the differences are minor. You should
expect these differences:
TEST(S) COMMENTS
TEST(S) COMMENTS
int2, int4: pg_atoi generates a differently worded error
message for integer overflow.
int2, int4: pg_atoi generates a differently worded error
message for integer overflow.
float8: In 6.4, float8 shows some differences due to
different handling of overflow/underflow errors in
exp() and pow(). This should be fixed in 6.4.1
and later.
float8: In 6.4, float8 shows some differences due to
different handling of overflow/underflow errors in
exp() and pow(). This should be fixed in 6.4.1
and later.
float8, geometry: Lots of differences in the last digit or two
because of different roundoff errors in floating
arithmetic. Also, HPUX does not distinguish
-0 from 0 during printout, but the reference
platform does.
float8, geometry: Lots of differences in the last digit or two
because of different roundoff errors in floating
arithmetic. Also, HPUX does not distinguish
-0 from 0 during printout, but the reference
platform does.
horology: HPUX time library does not know about daylight
savings time before 1970, so there are some
places in horology where a time will be shown
in PST instead of PDT.
horology: HPUX time library does not know about daylight
savings time before 1970, so there are some
places in horology where a time will be shown
in PST instead of PDT.
In addition, the int8 regression test will fail massively on HPUX 9,
because int8 doesn't actually work on this platform (sprintf/sscanf
......
======================================================
Frequently Asked Questions (FAQ) for PostgreSQL >=V6.1
IRIX Specific
TO BE READ IN CONJUNCTION WITH THE NORMAL FAQ
======================================================
last updated: Mon Mar 05 17:00:00 GMT 1998
current maintainer: Andrew C.R. Martin (martin@biochem.ucl.ac.uk)
original author: Andrew C.R. Martin (martin@biochem.ucl.ac.uk)
Changes in this version (* = modified, + = new, - = removed):
*1.5) Can I install PostgreSQL (<V6.3) under Irix 6.x?
+1.10) How do I install PostgreSQL V6.3 under Irix 6.x?
This file is divided approximately as follows:
1.*) Installing PostgreSQL
2.*) Uninstalling PostgreSQL
3.*) Extending PostgreSQL
Questions answered:
1.1) What extra items do I need to install PostgreSQL under Irix?
1.2) What changes do I need to make to src/Makefile.global?
1.3) What are the references in X11_LIB to libsocket and libnsl in
src/Makefile.global?
1.4) Are there any other changes I should make?
1.5) Can I install PostgreSQL (<V6.3) under Irix 6.x?
1.6) The make fails with the following message:
ld32: ERROR 4: Conflicting flag setting: -call_shared
1.7) Why won't it link? (Problems with lorder)
1.8) I have major problems with IRIX 6!
1.9) Why does lex fail with PostgreSQL 6.2.1?
1.10) How do I install PostgreSQL V6.3 under Irix 6.x?
2.1) Why can't I move the executable files?
3.1) How do I compile a C program to create a function for extending
PostgreSQL
----------------------------------------------------------------------
Section 1: Installing PostgreSQL
----------------------------------------------------------------------
1.1) What extra items do I need to install PostgreSQL under Irix?
You *must* have the following installed:
a) Gnu make (installed as gmake)
You are recommended to install the following:
a) GNU install (installed as ginstall)
(This is part of the GNU fileutils package)
You may choose to install the following:
a) GNU readline library (if you wish psql to have readline
support).
b) tcl/tk (if you wish to compile pgtclsh)
1.2) What changes do I need to make to src/Makefile.global or
src/Makefile.custom?
The easiest way to do this is to use the customize script in
the src directory.
You *must* set the following variables:
PORTNAME= irix5
You will also need to change the following to match your own
installation:
POSTGRESDIR
If you switch on the USE_TCL option, you will need to set these:
TCL_INCDIR=
TCL_LIBDIR=
TCL_LIB =
TK_INCDIR=
TK_LIBDIR=
TK_LIB =
You may also make any other changes you need as documented in
the INSTALL file and in Makefile.global
1.3) What are the references in X11_LIB to libsocket and libnsl in
src/Makefile.global?
This was a problem in 1.08 (they are Sun Solaris specific).
It is fixed in 1.09 and above.
1.4) Are there any other changes I should make?
If you have installed the GNU install program (ginstall), you
should add the following line to src/Makefile.custom:
CUSTOM_INSTALL=ginstall
For an explanation as to why this is a good idea, see Question 2.1
Ginstall is part of the GNU fileutils package.
1.5) Can I install PostgreSQL (<V6.3) under Irix 6.x?
Instructions for PostgreSQL V6.3 are answered in Question 1.10!
Irix 6.2-6.4 has a bug in ld which mishandles the addresses of
static procedures when object files are assembled into
larger object files using 'ld -r'. This bug has been reported
to Silicon Graphics.
One option is to use the Gnu version of ld. Alternatively,
the following patch should be applied as a workaround.
(Supplied by Bob Bruccoleri <bruc@bms.com>)
*** ./backend/Makefile.orig Thu May 22 00:00:15 1997
--- ./backend/Makefile Thu Jun 5 16:47:27 1997
***************
*** 54,60 ****
all: postgres $(POSTGRES_IMP) global1.bki.source local1_template1.bki.source
postgres: $(OBJS) ../utils/version.o
! $(CC) -o postgres $(OBJS) ../utils/version.o $(LDFLAGS)
$(OBJS): $(DIRS:%=%.dir)
--- 54,64 ----
all: postgres $(POSTGRES_IMP) global1.bki.source local1_template1.bki.source
postgres: $(OBJS) ../utils/version.o
! # $(CC) -o postgres $(OBJS) ../utils/version.o $(LDFLAGS)
! -rm -f *.o
! find . -name "*.o" -exec cp \{\} . \;
! rm -f SUBSYS.o
! $(CC) -o postgres *.o ../utils/version.o $(LDFLAGS)
$(OBJS): $(DIRS:%=%.dir)
1.6) The make fails with the following message:
ld32: ERROR 4: Conflicting flag setting: -call_shared
If gmake fails in .../src/backend while building obj/ACCESS.o
with a message from ld32, you can work around this by using
ld for the LD environment variable rather than cc.
The problem has been observed under Irix 5.3 when compiling both
Postgres95-1.09 and PostgreSQL-6.2Beta6, but on some systems
these appear to compile with no such problems.
Fix supplied by Brian Sanders (bsanders@netcom.com,
brian@fresnelsoft.com)
1.7) Why won't it link? (Problems with lorder)
According to the IRIX man pages, lorder is useless, but harmless
under IRIX. However, it has caused problems for some people
using both IRIX 6.2.
The solution is to add the following line to
.../src/makefiles/Makefile.irix5
MK_NO_LORDER=true
1.8) I have major problems with IRIX 6!
The following is quoted directly from Bob Bruccoleri <bruc@bms.com>
There is a really nasty loader bug in the compiler system (7.1)
on Irix 6.x, and the error that Lasse Petersen is the result of it.
Here is the original message. I don't know if all the changes have been
folded into the current release.
Date: Fri, 06 Jun 1997 17:12:20 -0400 (EDT)
From: bruc@bms.com (Robert Bruccoleri)
Subject: [PORTS] Patches for Irix 6.4
I have worked out how to compile PostgreSQL on Irix 6.4 using the -n32 compiler
mode and version 7.1 of the C compiler. (The n32 compiler use 32 bits addressing,
but allows access to all the instructions in the MIPS4 instruction set.)
There were several problems:
1) The ld command is not referenced as a macro in all the Makefiles. On
this platform, you have to include -n32 on all the ld commands. Makefiles
were changed as needed.
2) There is a bug in "ld" which mishandles the addresses of static procedures
when object files are assembled into larger object files using "ld -r".
Because of this, I put a hack into src/backend/Makefile to avoid all the
SUBSYS.o files and just link all the objects. I have contacted SGI about the
problem, and hopefully, it will be fixed in the near future.
3) Lots of warnings are generated from the compiler. Since the regression
tests worked OK, I didn't attempt to fix them. If anyone wants the compilation
log, please let me know, and I'll email it to you.
The version of postgresql was 970602. Here is Makefile.custom:
CUSTOM_COPT = -O2 -n32
MK_NO_LORDER = 1
LD = ld -n32
CC += -n32
Here are the patches:
*** ./backend/access/Makefile.orig Sun Nov 10 00:00:15 1996
- --- ./backend/access/Makefile Tue Jun 3 10:22:32 1997
***************
*** 8,13 ****
- --- 8,16 ----
#
#-------------------------------------------------------------------------
+ SRCDIR = ../..
+ include ../../Makefile.global
+
OBJS = common/SUBSYS.o gist/SUBSYS.o hash/SUBSYS.o heap/SUBSYS.o \
index/SUBSYS.o rtree/SUBSYS.o nbtree/SUBSYS.o transam/SUBSYS.o
*** ./backend/bootstrap/Makefile.orig Fri Apr 18 06:00:23 1997
- --- ./backend/bootstrap/Makefile Tue Jun 3 10:23:59 1997
***************
*** 38,44 ****
all: SUBSYS.o
SUBSYS.o: $(OBJS)
! ld -r -o SUBSYS.o $(OBJS)
# bootstrap.o's dependency on bootstrap_tokens.h is computed by the
# make depend, but we state it here explicitly anyway because
- --- 38,44 ----
all: SUBSYS.o
SUBSYS.o: $(OBJS)
! $(LD) -r -o SUBSYS.o $(OBJS)
# bootstrap.o's dependency on bootstrap_tokens.h is computed by the
# make depend, but we state it here explicitly anyway because
*** ./backend/Makefile.orig Thu May 22 00:00:15 1997
- --- ./backend/Makefile Thu Jun 5 16:47:27 1997
***************
*** 54,60 ****
all: postgres $(POSTGRES_IMP) global1.bki.source local1_template1.bki.source
postgres: $(OBJS) ../utils/version.o
! $(CC) -o postgres $(OBJS) ../utils/version.o $(LDFLAGS)
$(OBJS): $(DIRS:%=%.dir)
- --- 54,64 ----
all: postgres $(POSTGRES_IMP) global1.bki.source local1_template1.bki.source
postgres: $(OBJS) ../utils/version.o
! # $(CC) -o postgres $(OBJS) ../utils/version.o $(LDFLAGS)
! -rm -f *.o
! find . -name "*.o" -exec cp \{\} . \;
! rm -f SUBSYS.o
! $(CC) -o postgres *.o ../utils/version.o $(LDFLAGS)
$(OBJS): $(DIRS:%=%.dir)
***************
*** 116,122 ****
install: $(LIBDIR) $(BINDIR) $(HEADERDIR) postgres $(POSTGRES_IMP) fmgr.h\
global1.bki.source local1_template1.bki.source \
libpq/pg_hba.conf.sample optimizer/geqo/pg_geqo.sample
!
$(INSTALL) $(INSTL_EXE_OPTS) postgres $(BINDIR)/postgres
ifeq ($(MAKE_EXPORTS), true)
$(INSTALL) $(INSTLOPTS) $(POSTGRES_IMP) $(LIBDIR)/$(POSTGRES_IMP)
- --- 120,126 ----
install: $(LIBDIR) $(BINDIR) $(HEADERDIR) postgres $(POSTGRES_IMP) fmgr.h\
global1.bki.source local1_template1.bki.source \
libpq/pg_hba.conf.sample optimizer/geqo/pg_geqo.sample
!
$(INSTALL) $(INSTL_EXE_OPTS) postgres $(BINDIR)/postgres
ifeq ($(MAKE_EXPORTS), true)
$(INSTALL) $(INSTLOPTS) $(POSTGRES_IMP) $(LIBDIR)/$(POSTGRES_IMP)
*** ./backend/optimizer/Makefile.orig Wed Feb 19 12:00:34 1997
- --- ./backend/optimizer/Makefile Tue Jun 3 10:39:47 1997
***************
*** 8,13 ****
- --- 8,16 ----
#
#-------------------------------------------------------------------------
+ SRCDIR= ../..
+ include ../../Makefile.global
+
all: submake SUBSYS.o
OBJS = path/SUBSYS.o plan/SUBSYS.o prep/SUBSYS.o util/SUBSYS.o geqo/SUBSYS.o
*** ./backend/libpq/pqcomprim.c.orig Mon May 26 00:00:23 1997
- --- ./backend/libpq/pqcomprim.c Fri Jun 6 16:02:24 1997
***************
*** 32,40 ****
# define hton_l(n) (ntoh_l(n))
# else /* BYTE_ORDER != BIG_ENDIAN */
# if BYTE_ORDER == PDP_ENDIAN
! # #error PDP_ENDIAN macros not written yet
# else /* BYTE_ORDER != anything known */
! # #error BYTE_ORDER not defined as anything understood
# endif /* BYTE_ORDER == PDP_ENDIAN */
# endif /* BYTE_ORDER == BIG_ENDIAN */
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
- --- 32,40 ----
# define hton_l(n) (ntoh_l(n))
# else /* BYTE_ORDER != BIG_ENDIAN */
# if BYTE_ORDER == PDP_ENDIAN
! # error PDP_ENDIAN macros not written yet
# else /* BYTE_ORDER != anything known */
! # error BYTE_ORDER not defined as anything understood
# endif /* BYTE_ORDER == PDP_ENDIAN */
# endif /* BYTE_ORDER == BIG_ENDIAN */
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
*** ./backend/storage/Makefile.orig Sun Nov 10 00:01:06 1996
- --- ./backend/storage/Makefile Tue Jun 3 10:41:29 1997
***************
*** 8,13 ****
- --- 8,16 ----
#
#-------------------------------------------------------------------------
+ SRCDIR= ../..
+ include ../../Makefile.global
+
all: submake SUBSYS.o
OBJS = buffer/SUBSYS.o file/SUBSYS.o ipc/SUBSYS.o large_object/SUBSYS.o \
1.9) Why does lex fail with PostgreSQL 6.2.1?
IRIX 5.3 lex has been reported to fail in
postgresql-6.2.1/src/backend/parser with the error:
lex scan.l
"scan.l":line 86: Error: Invalid request %x xc
gmake[2]: *** [scan.c] Error 1
The answer is to use GNU flex 2.5.4 or later. Use the command
flex --version
to check you have a new enough version of flex
1.10) How do I install PostgreSQL V6.3 under Irix 6.x?
Irix 6.2-6.4 has a bug in ld which mishandles the addresses of
static procedures when object files are assembled into
larger object files using 'ld -r'. This bug has been reported
to Silicon Graphics.
Depending on your Irix installation you may also encounter
2 other problems detailed below: Conflict in C standards,
Conflict in library functions.
a) Solving the ld bug
---------------------
One option is to use the Gnu version of ld. Alternatively,
the following patch should be applied as a workaround.
(Supplied by Bob Bruccoleri <bruc@bms.com> and modified for
PostgreSQL V6.3 by Lasse Hiller Petersen <lassehp@imv.aau.dk>)
Apply the following patch:
*** ./backend/Makefile.orig Tue Mar 3 15:33:58 1998
--- ./backend/Makefile Tue Mar 3 15:39:27 1998
***************
*** 63,69 ****
global1.description
local1_template1.description
postgres: $(OBJS) ../utils/version.o
! $(CC) -o postgres $(OBJS) ../utils/version.o $(LDFLAGS)
$(OBJS): $(DIRS:%=%.dir)
--- 63,73 ----
global1.description
local1_template1.description
postgres: $(OBJS) ../utils/version.o
! # $(CC) -o postgres $(OBJS) ../utils/version.o $(LDFLAGS)
! -rm -f *.o
! find . -name "*.o" -exec cp \{\} . \;
! rm -f SUBSYS.o
! $(CC) -o postgres *.o ../utils/version.o $(LDFLAGS)
$(OBJS): $(DIRS:%=%.dir)
Lasse configured with ./configure --enable-locale
and modified Makefile.custom to contain:
CC = cc -n32
LD = ld -n32
He reports that the installation without -n32 works fine too,
but the -n32 was required for compatibility with his Perl
installation. His system was an Origin200 running IRIX64 v6.4.
b) Conflict in C standards
--------------------------
I have found that the following patch is also necessary in order
to prevent a duplicate definition of a Union used for semaphores.
Apply the following patch to:
.../src/makefile/Makefile.irix5:
*** src/makefiles/Makefile.irix5.orig Thu Mar 5 16:59:58 1998
--- src/makefiles/Makefile.irix5 Thu Mar 5 17:01:13 1998
***************
*** 6,9 ****
%.so: %.o
$(LD) -G -Bdynamic -shared -o $@ $<
!
--- 6,9 ----
%.so: %.o
$(LD) -G -Bdynamic -shared -o $@ $<
! CFLAGS+= -U_NO_XOPEN4
i.e. the addition of the line:
CFLAGS+= -U_NO_XOPEN4
This is needed to stop the semun union being redefined in
/usr/include/sys/sem.h
c) Conflict in library functions
--------------------------------
In addition, if you have the nsl and crypt libraries these will
conflict with the required definitions. I think that libnsl.a
may be the Netware socket library (or something similar). In
any case, if you have these libraries, they will be added to
Makefile.global and you will need to remove them.
Thus, you should edit .../src/Makefile.global. Goto (approximately)
line 217 where LDFLAGS= is set and remove -lnsl and -lcrypt
from this line.
----------------------------------------------------------------------
Section 2: Deinstalling PostgreSQL
----------------------------------------------------------------------
2.1) Why can't I move the executable files?
By default, the IRIX port uses the BSD compatible version of
install from /usr/bin/X11. If you read the man page for this
version of install, you will see that it is not meant for
end-user use; it has the interesting side-effect of chowning
files it installs to root.
You should still be able to delete the files as you (the
postgres user) will own the directory in which they are
stored.
The normal IRIX install program cannot be used easily as it
takes its arguments in the reverse order. It is therefore
recommended to use the GNU version of install (ginstall).
See Question 1.4
----------------------------------------------------------------------
Section 3: Extending PostgreSQL
----------------------------------------------------------------------
3.1) How do I compile a C program to create a function for extending
PostgreSQL
Here is a sample command line:
cc -I/usr/local/PostgreSQL/include/ -I/usr/local/PostgreSQL/src/backend
-shared -o funcs.so funcs.c
----------------------------------------------------------------------------
Dr. Andrew C.R. Martin University College London
EMAIL: (Work) martin@biochem.ucl.ac.uk (Home) andrew@stagleys.demon.co.uk
URL: http://www.biochem.ucl.ac.uk/~martin
Tel: (Work) +44(0)171 419 3890 (Home) +44(0)1372 275775
Documentation and FAQs
_________________________________________________________________
User
* Tutorial - for those not familiar with PostgreSQL
* User's Guide - general user information (download)
* Administrator's Guide - help in installing and managing PostgreSQL
(download)
* Programmer's Guide - for those programming in PostgreSQL, using
various interfaces (download)
* Integrated Document (includes others above) - for those
programming in PostgreSQL, using various interfaces (download)
* Appendices
* FAQ (Frequently Asked Questions)
+ English
+ Japanese
+ Korean by Jung Jik Han
* Platform-specific FAQ's
+ Linux
o English by Andrew Martin
o Japanese by Jun Kuwamura
o Korean by Jung Jik Han
o Italian by Daniele Medri
+ Irix
+ HP-UX
* HISTORY file showing changes in each release.
* TODO list showing our future plans.
Developers
* How PostgreSQL Processes a Query - a guide to all modules and
directories, including a flowchart
* Developer's FAQ
+ English by Bruce Momjian
+ Korean by Jung Jik Han
* Developer's Guide - for contributing to the PostgreSQL
distribution
* CVS/CVSUP FAQ access to source code
* History of PostgreSQL Development
此差异已折叠。
此差异已折叠。
......@@ -280,6 +280,8 @@ Fix GROUP BY in INSERT INTO table SELECT * FROM table2(Jan)
Fix for computations in views(Jan)
Fix for aggregates on array indexes(Tom)
Fix for DEFAULT handles single quotes in value requiring too many quotes
Fix security problem with non-super users importing/exporting large objects(Tom)
Rollback of transaction that creates table cleaned up properly(Tom)
Enhancements
------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册