📄 readme.rpm-dist
字号:
the version of any database found -- if the version is old, then the startupof the new version is aborted. However, if no database is found, a new one is made.One thing must be remembered -- due to the restructuring of the PostgreSQLRPM's, you will have to manually select the postgresql-server package if youwant the server -- it is not installed by default in an upgrade. You can eitherselect it during the upgrade/install, or you can mount your RedHat CD and install manually with rpm -i.To facilitate upgrading, the postgresql-dump utility has been provided. Lookat the man page for postgresql-dump to see its usage. All executables torestore the immediately prior version of the PostgreSQL database are placed inthe directory /usr/lib/pgsql/backup, and are accessed by the postgresql-dumpscript. The directory /usr/lib/pgsql/backup is owned by the postgres user -- you can use this directory to hold dump files and preserve directories.The basic sequence is:(as user postgres):postgresql-dump -t /var/lib/pgsql/backup/db.bak -p /var/lib/pgsql/backup/old -d(you can abort the ASCII dump with 'Q', as it uses more) Then, (as user root):***** NOTE ***** ***** NOTE *****The above script is broken. Use "rh-pgdump.sh targetfile" instead, remove theold databases (/var/lib/pgsql/base) (or safer - move them somewhere else first),start the database and follow the insert procedure described below.***** NOTE ***** ***** NOTE *****service postgresql start(which will automatically create a new database structure) And finally,(as user postgres):psql -e template1 </var/lib/pgsql/backup/db.bakOnce you are satisfied that the data has been restored properly, you may removethe dump file (/var/lib/pgsql/backup/db.bak) and the preserve directory (/var/lib/pgsql/backup/old).EXPLANATION OF STEPS:-------------------------------------------------------------------------------postgresql-dump: dumps the old database structure out, using the postmaster and the backend saved during the rpm upgrade. This step MUST be done as user postgres./etc/rc.d/init.d/postgresql start: initializes the new database structure thatthe data from your old version will be restored into, does some sanity checking, and starts the postmaster. Due to the nature of some of the tasks, this step must be done as root.psql -e: restores the old database into the new structure created by the previous step.NOTE:-------------------------------------------------------------------------------If you have added tables, indices, or basically anything to the template1 database which is the default administrative database this script will NOT upgrade your database. As a matter of fact you will lose your data included in the template1 database. Please look at www.postgresql.org for information on upgrading the template1 database. This is a known bug in the PostgreSQLpg_dump and pg_dumpall utilities.REGRESSION TESTING-------------------------------------------------------------------------------One of the features of the newer RPM sets is the capability to perform the regression tests. These tests stress your database installation and produceresults that give you assurances that the installation is complete, and thatyour database machine is up to the task.To run the regression tests under the RPM installation, make sure thatpostmaster has been started (if not, su to root and execute the'/etc/rc.d/init.d/postgresql start' init script), cd to/usr/lib/pgsql/test/regress, su to postgres, and execute the command line:time ./pg_regress.sh --schedule=parallel_scheduleThis command line will start the regression tests and will both show theresults to the screen and store the results in the file regress.out.It will also give you a crude benchmark of how fast your machine performs.If tests fail, please see the file regression.diffs in that directory. Ifyou need help interpreting that file, contact the pgsql-ports list onpostgresql.org.There are some tests that will almost always fail with RedHat Linux 5.x and 6.xinstallations. The geometry, float8, and on occassion the random test will fail. These failures are normal for RedHat 5.2 and 6.1. For RedHat 6.1 withcertain i18n settings, there will be other tests fail.For 7.1RC1, all 76 tests passed on RedHat 6.2 and RedHat 7.0. Thiswas accomplished by fiddling with the locale settings. In version 7.1.2 thiscapability was removed -- you need to set your locale to 'C' before executingthe first postmaster startup, or many more regression tests will fail.For interpretation of the regression tests, see the PostgreSQL documentation.STARTING POSTMASTER AUTOMATICALLY AT SYSTEM STARTUP-------------------------------------------------------------------------------RedHat Linux uses the System V Init package. A startup script for PostgreSQLis provided in the server package, as /etc/rc.d/init.d/postgresql. To startthe postmaster, with sanity checking, as root, run/etc/rc.d/init.d/postgresql startto shut postmaster down,/etc/rc.d/init.d/postgresql stopThere are other parameters to this script -- /etc/rc.d/init.d/postgresql for alisting.To get this script to run at system startup or any time the system switches intorunlevels 4, 5, or 6, run 'chkconfig --add postgresql', and the proper symlinks will be created. Check the chkconfig man page for more information.This same script also works for TurboLinux, and any other distribution similarenough to RedHat. SuSE Linux uses a different approach, using a differentlocation and a different script, found at either /sbin/init.d/postgres or/usr/sbin/rcpostgres. Please see the SuSE 'README.linux' for more information.SuSE has maintained their own RPMset for some time -- their documentationsupercedes any found in this file.GRAND UNIFIED CONFIGURATION (GUC) FILE-------------------------------------------------------------------------------The PostgreSQL server has many tunable parameters -- the file /var/lib/pgsql/data/postgresql.conf is the master configuration file for thewhole system. The RPM ships with the default file -- you will need to tune theparameters for your installation. In particular, you might want to allowTCP/IP socket connections -- in order to allow these, you will need to editthe postgresql.conf file. The line in question contains the string 'tcpip_socket' --want to both uncomment the line and set the parameter to truein order to get the TCP/IP socket to open. This is the same behavior the -i command line switch provides. It is preferable to use the postgresql.conf file, however, as future versionsof the RPMset will allow multiple postmaster instances -- and that will onlybe possible thanks to the decoupling of settings out to each datadir.REBUILDING FROM SOURCE RPM-------------------------------------------------------------------------------If your distribution is not supported by the binary RPM's from PostgreSQL.org, you will need to rebuild from the source RPM. Download the .src.rpm for thisrelease. You will need to be root to rebuild, unless you have already set upa non-root build environment.Install the source RPM with rpm -i, then CD to the rpm building area (on RedHatthis is /usr/src/redhat by default). You will have to have a full developmentenvironment to rebuild the full RPM set.This release of the RPMset includes the ability to conditionally build sets of packages. The parameters, their defaults, and the meanings are:perl 1 #build the postgresql-perl package.tcl 1 #build the postgresql-tcl package.tkpkg 1 #build the postgresql-tk package. odbc 1 #build the postgresql-odbc package.jdbc 1 #build the postgresql-jdbc package.test 1 #build the postgresql-test package.python 1 #build the postgresql-python package.pltcl 1 #build the postgresql-pltcl package.forceplperl 0 #don't force a build of pl/perl over libperl.aplperl 0 #don't build the postgresql-plperl package.ssl 1 #use OpenSSL support.kerberos 1 #use Kerberos 5 support.enable_mb 1 #enable multibyte encodings.pgaccess 1 #build the pgaccess client, part of postgresql-tk.newintarray 0 #substitute a newer intarray contrib.To use these defines, invoke a rebuild like this:rpm --rebuild --define 'perl 0' --define 'tcl 0' --define 'tkpkg 0'\ --define 'test 0' --define 'newintarray 1' --define 'kerberos 0' \ postgresql-7.1.3-1PGDG.src.rpmThis line would disable the perl, tcl, tk, and test subpackages, enable thenewer intarray code, and disable kerberos support.More of these conditionals will be added in the future.CONTRIB FILES-------------------------------------------------------------------------------The contents of the contrib tree are packaged into the -contrib subpackageand are compiled and placed into /usr/lib/pgsql/contrib with no furtherprocessing. Please see each directory under contrib for details on how toinstall and use.LOGGING SET UP-------------------------------------------------------------------------------To get rollable syslog set up, see the documentation for the filepostgresql.conf, by default in the directory /var/lib/pgsql/data, as relates tothe syslog options. Then, add a line to /etc/syslog.conf, using the man pagefor syslog.conf as a source. Example:If postgresql.conf has the following lines for the syslog settings:syslog = 1 # range 0-2syslog_facility = 'LOCAL0'syslog_ident = 'postgres'Then you need to add the line to /etc/syslog.conf:local0.* /var/log/postgresql Then set up an entry in /etc/logrotate.d to roll postgresql the way you want itrolled.MORE INFORMATION-------------------------------------------------------------------------------You can get more information at http://www.postgresql.orgPlease help make this packaging better -- let me know if you find problems, orbetter ways of doing things. You can reach me by e-mail atpgsql-ports@postgresql.org -- please include an [RPM] string in the subject, asI use automatic mail folder processing to put mail in the right place.SuSE information is available at SuSE's website and information contacts.-----------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -