<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.cs.earlham.edu/index.php?action=history&amp;feed=atom&amp;title=PostgreSQL</id>
	<title>PostgreSQL - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cs.earlham.edu/index.php?action=history&amp;feed=atom&amp;title=PostgreSQL"/>
	<link rel="alternate" type="text/html" href="https://wiki.cs.earlham.edu/index.php?title=PostgreSQL&amp;action=history"/>
	<updated>2026-07-23T02:04:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.cs.earlham.edu/index.php?title=PostgreSQL&amp;diff=5814&amp;oldid=prev</id>
		<title>Marouf at 03:02, 25 June 2007</title>
		<link rel="alternate" type="text/html" href="https://wiki.cs.earlham.edu/index.php?title=PostgreSQL&amp;diff=5814&amp;oldid=prev"/>
		<updated>2007-06-25T03:02:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; =========== BACKUP YOUR DATA! =============&lt;br /&gt;
  As always, backup your data before&lt;br /&gt;
  upgrading. If the upgrade leads to a higher&lt;br /&gt;
  minor revision (e.g. 7.3.x -&amp;gt; 7.4), a dump&lt;br /&gt;
  and restore of all databases is&lt;br /&gt;
  required. This is *NOT* done by the port!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Press ctrl-C *now* if you need to pg_dump.&lt;br /&gt;
  ===========================================&lt;br /&gt;
&lt;br /&gt;
cd /usr/ports/databases/postgresql82-server/&lt;br /&gt;
&lt;br /&gt;
make; make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
this will instal both the server and client ports&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The port is set up to use autovacuum for new databases, but you might&lt;br /&gt;
also want to vacuum and perhaps backup your database regularly. There&lt;br /&gt;
is a periodic script, /usr/local/etc/periodic/daily/502.pgsql, that&lt;br /&gt;
you may find useful. You can use it to backup and perfom vacuum on all&lt;br /&gt;
databases nightly. Per default, it perfoms `vacuum analyze&amp;#039;. See the&lt;br /&gt;
script for instructions. For autovacuum settings, please review&lt;br /&gt;
~pgsql/data/postgresql.conf.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To allow many simultaneous connections to your PostgreSQL server, you&lt;br /&gt;
should raise the SystemV shared memory limits in your kernel. Here are&lt;br /&gt;
example values for allowing up to 180 clients (configurations in&lt;br /&gt;
postgresql.conf also needed, of course):&lt;br /&gt;
&lt;br /&gt;
  options         SYSVSHM&lt;br /&gt;
&lt;br /&gt;
  options         SYSVSEM&lt;br /&gt;
&lt;br /&gt;
  options         SYSVMSG&lt;br /&gt;
&lt;br /&gt;
  options         SHMMAXPGS=65536&lt;br /&gt;
&lt;br /&gt;
  options         SEMMNI=40&lt;br /&gt;
&lt;br /&gt;
  options         SEMMNS=240&lt;br /&gt;
&lt;br /&gt;
  options         SEMUME=40&lt;br /&gt;
&lt;br /&gt;
  options         SEMMNU=120&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you plan to access your PostgreSQL server using ODBC, please&lt;br /&gt;
consider running the SQL script /usr/local/share/postgresql/odbc.sql&lt;br /&gt;
to get the functions required for ODBC compliance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that if you use the rc script,&lt;br /&gt;
&lt;br /&gt;
/usr/local/etc/rc.conf/postgresql, to initialize the database, unicode&lt;br /&gt;
(UTF-8) will be used to store character data by default.  Set&lt;br /&gt;
postgresql_initdb_flags or use login.conf settings described below to&lt;br /&gt;
alter this behaviour. See the start rc script for more info.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To set limits, environment stuff like locale and collation and other&lt;br /&gt;
things, you can set up a class in /etc/login.conf before initializing&lt;br /&gt;
the database. Add something similar to this to /etc/login.conf:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
postgres:\&lt;br /&gt;
&lt;br /&gt;
        :lang=en_US.UTF-8:\&lt;br /&gt;
&lt;br /&gt;
        :setenv=LC_COLLATE=C:\&lt;br /&gt;
&lt;br /&gt;
        :tc=default:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and run `cap_mkdb /etc/login.conf&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Then add &amp;#039;postgresql_class=&amp;quot;postgres&amp;quot;&amp;#039; to /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To initialize the database, run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  /usr/local/etc/rc.d/postgresql initdb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can then start PostgreSQL by running:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  /usr/local/etc/rc.d/postgresql start&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For postmaster settings, see ~pgsql/data/postgresql.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NB. FreeBSD&amp;#039;s PostgreSQL port logs to syslog by default&lt;br /&gt;
    See ~pgsql/data/postgresql.conf for more info&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run PostgreSQL at startup, add&lt;br /&gt;
&amp;#039;postgresql_enable=&amp;quot;YES&amp;quot;&amp;#039; to /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
===&amp;gt; Installing rc.d startup script(s)&lt;br /&gt;
&lt;br /&gt;
===&amp;gt;   Registering installation for postgresql-server-8.2.4_1&lt;br /&gt;
&lt;br /&gt;
===&amp;gt; SECURITY REPORT:&lt;br /&gt;
      This port has installed the following files, which may act as network&lt;br /&gt;
      servers and may therefore pose a remote security risk to the system.&lt;br /&gt;
&lt;br /&gt;
/usr/local/bin/postgres&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      This port has installed the following startup scripts, which may cause&lt;br /&gt;
      these network services to be started at boot time.&lt;br /&gt;
&lt;br /&gt;
/usr/local/etc/rc.d/postgresql&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If there are vulnerabilities in these programs there may be a security&lt;br /&gt;
      risk to the system. FreeBSD makes no guarantee about the security of&lt;br /&gt;
      ports included in the Ports Collection. Please type &amp;#039;make deinstall&amp;#039;&lt;br /&gt;
      to deinstall the port if this is a concern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      For more information, and contact details about the security&lt;br /&gt;
      status of this software, see the following webpage:&lt;br /&gt;
&lt;br /&gt;
http://www.postgresql.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- Run /usr/local/etc/rc.d/postgresql initdb to initialize the DB&lt;br /&gt;
- vi /usr/local/pgsql/data/pg_hba.conf and add the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
local   all         all                                 trust&lt;br /&gt;
host    all         all         127.0.0.1/32            trust&lt;br /&gt;
host    all         all         159.28.234.0/24         trust&lt;br /&gt;
host    all         all         159.28.230.0/24         trust&lt;br /&gt;
hostssl all         all         12.161.108.5/32         trust&lt;br /&gt;
hostssl all         all         12.222.56.168/32        trust&lt;br /&gt;
hostssl all         all         159.28.57.98/32         trust&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- vi /usr/local/pgsql/data/postgresql.conf (check cluster config)&lt;br /&gt;
&lt;br /&gt;
- vi /usr/local/pgsql/data/postmaster.opts and add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/cluster/usr-local/bin/postgres -D /usr/local/pgsql/data&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Marouf</name></author>
	</entry>
</feed>