https://wiki.archlinux.org/api.php?action=feedcontributions&user=Ostroffjh&feedformat=atomArchWiki - User contributions [en]2024-03-29T14:12:23ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Talk:FAM&diff=262172Talk:FAM2013-06-10T12:16:11Z<p>Ostroffjh: </p>
<hr />
<div>== <s> AUR or [extra] </s> ==<br />
<br />
Should it be noted that gamin has moved from AUR to EXTRA?<br />
: I think you miss under stood the page. FAM is is AUR, gamin in covered in [[Gamin]]. And see [[Help:Discussion]] for how to sign your topic in talk page. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 05:18, 10 June 2013 (UTC)<br />
:: Understood. Not sure exactly what I was thinking, but glad I got it clarified here instead of by making a stupid, wrong edit to the page. Thanks for correcting. [[User:Ostroffjh|Ostroffjh]] ([[User talk:Ostroffjh|talk]]) 12:16, 10 June 2013 (UTC)</div>Ostroffjhhttps://wiki.archlinux.org/index.php?title=Talk:FAM&diff=261920Talk:FAM2013-06-08T23:05:57Z<p>Ostroffjh: /* AUR or [extra] */ new section</p>
<hr />
<div>Hy,<br />
<br />
you write 'if you are using the NetworkManager daemon fam must be after networkmanager.'<br />
This is not correct:<br />
<br />
On my system the daemons look like this:<br />
DAEMONS=(!network !netfs syslog-ng hal @portmap @fam @networkmanager !crond @cpufreq @laptop-mode @alsa @gpm @clamav @openntpd)<br />
<br />
Previously, when I was installing the daemon line was this one:<br />
DAEMONS=(!network !netfs syslog-ng hal portmap fam networkmanager !crond cpufreq laptop-mode alsa gpm clamav openntpd)<br />
<br />
So far as I see fam IS starting BEVOR networkmanager and it seems to be running correct since im using gnome & the deskop is refreshed correctly and I'm using the networkmanager daily.<br />
<br />
Why do you thing it cannot be startet bevor networkmanager?<br />
<br />
== AUR or [extra] ==<br />
<br />
Should it be noted that gamin has moved from AUR to EXTRA?</div>Ostroffjhhttps://wiki.archlinux.org/index.php?title=PostgreSQL&diff=164533PostgreSQL2011-10-07T20:09:46Z<p>Ostroffjh: expanded upgrade instructions: add postgresql-libs to pacman.conf, added explicit pacman upgrade line, other wording changes</p>
<hr />
<div>{{i18n|PostgreSQL}}<br />
[[Category:Database management systems (English)]]<br />
[[Category:Web Server (English)]]<br />
<br />
This document describes how to set up PostgreSQL. It also describes how to configure PostgreSQL to be accessible from a remote client. If you need help setting up the rest of a web stack, see the [[LAMP]] page and follow all of the sections except the one related to [[MySQL]].<br />
<br />
Several sections have instructions stating "become the postgres user". If sudo is installed, execute the following to get a shell as the postgres user:<br />
sudo -i -u postgres<br />
<br />
Otherwise su can be used:<br />
su root<br />
su - postgres<br />
<br />
==Installing PostgreSQL==<br />
*Install postgresql<br />
$ sudo pacman -S postgresql<br />
*Start the PostgreSQL server (The first time that this is run it will create the data directory and users needed to run the server. As such you will see a lot of output.)<br />
$ sudo /etc/rc.d/postgresql start<br />
*(Optional) Add postgresql to the list of daemons that start on system startup in the /etc/rc.conf file<br />
<br />
==Creating Your First Database/User==<br />
*Become the postgres user. Add a new database user using the [http://www.postgresql.org/docs/9.0/static/app-createuser.html createuser] command.<br />
<br />
If you create a user as per your login user ($USER) it allows you to access the postgresql database shell without having to specify a user to login (which makes it quite convenient).<br />
<br />
e.g. to create a superuser<br />
<br />
$ createuser -s -U postgres<br />
$ Enter name of role to add: myUsualArchLoginName<br />
<br />
*Create a new database over which the above user has read/write privileges using the [http://www.postgresql.org/docs/9.0/static/app-createdb.html createdb] command.<br />
<br />
From your login shell ('''not''' the postrgres user's)<br />
<br />
$ createdb<br />
<br />
==Familiarizing Yourself with PostgreSQL==<br />
<br />
===Access the database shell===<br />
*Become the postgres user. Start the primary db shell, [http://www.postgresql.org/docs/8.3/static/app-psql.html psql], where you can do all your creation of databases/tables, deletion, set permissions, and run raw SQL commands. Use the "-p" option to connect to the database you created (without specifying a database, psql will try to access a database that matches your username)<br />
$ psql -d myDatabaseName<br />
<br />
Some helpful commands:<br />
<br />
*Connect to a particular database<br />
=> \c <database><br />
*List all users and their permission levels<br />
=> \du<br />
*Shows summary information about all tables in the current database<br />
=> \dt<br />
*exit/quit the psql shell<br />
=> \q or CTRL+d<br />
<br />
There are of course many more meta-commands, but these should help you get started.<br />
<br />
==Configure PostgreSQL to be accessible from remote hosts==<br />
The PostgreSQL database server configuration file is <code>postgresql.conf</code>. This file is located in the data directory of the server, typically <code>/var/lib/postgres/data</code>. This folder also houses the other main config files, including the <code>pg_hba.conf</code>.<br />
<br />
{{Note | By default this folder will not even be browseable (or searchable) by a regular user, if you are wondering why `find` or `locate` is not finding the conf files, this is the reason (threw me for a loop the first time I installed).}}<br />
<br />
#As root user edit the file<br><pre>$ sudo vim /var/lib/postgres/data/postgresql.conf</pre><br />
#In the connections and authentications section uncomment or edit the <code>listen_addresses</code> line to your needs<br><pre>listen_addresses = '*'</pre>and take a careful look at the other lines.<br />
#Hereafter insert the following line in the host-based authentication file <code>/var/lib/postgres/data/pg_hba.conf</code>. This file controls which hosts are allowed to connect, '''so be careful'''.<br />
# IPv4 local connections:<br />
host all all your_desired_ip_address/32 trust<br />
where <code>your_desired_ip_address</code> is the IP address of the client.<br />
#After this you should restart the daemon process for the changes to take effect with<br><pre>$ sudo /etc/rc.d/postgresql restart</pre><br />
<br />
{{Note | Postgresql uses port 5432 by default for remote connections. So make sure this port is open and able to receive incoming connections}}<br />
<br />
For troubleshooting take a look in the server log file<br />
tail /var/log/postgresql.log<br />
<br />
==Configure PostgreSQL to Work With PHP==<br />
#Install the PHP-PostgreSQL modules<pre># pacman -S php-pgsql </pre><br />
#Open the file '''<code>/etc/php/php.ini</code>''' with your editor of choice, e.g.,<pre># vim /etc/php/php.ini</pre><br />
#Find the line that starts with, ";extension=pgsql.so" and change it to, "extension=pgsql.so". (Just remove the preceding ";"). If you need PDO, do the same thing with ";extension=pdo.so" and ";extension=pdo_pgsql.so". If these lines are not present, add them. These lines may be in the "Dynamic Extensions" section of the file, or toward the very end of the file.<br />
#Restart the Apache web server<pre># /etc/rc.d/httpd restart</pre><br />
<br />
==Change Default Data Dir (Optional)==<br />
By default, when installing PostgreSQL the directory were all your newly created databases will be stored is <code>/var/lib/postgres/data</code>. If you want to change this behavior, you have to follow these steps:<br />
<br />
# Create the new directory and assign it to user <code>postgres</code> (you eventually have to become root):<br />
# mkdir /mypath/mydatadir<br />
# chown postgres:postgres /mypath/mydatadir<br />
# Become the postgres user, and initialize the new cluster:<br />
$ initdb -D /mypath/mydatadir<br />
# Edit <code>/etc/conf.d/postgresql</code> and change the PGROOT variable to point at your new data directory.<br />
<br />
==Change Default Encoding of New Databases To UTF-8 (Optional)==<br />
When creating a new database (e.g. with <code>createdb blog</code>) PostgreSQL actually copies a template database. There are two predefined templates: template0 is vanilla, while template1 is meant as an on-site template changeable by the administrator and is used by default. In order to change the encoding of new database, one of the options is to change on-site template1. To do this, log into PostgresSQL shell (psql) and execute the following:<br />
<br />
1. First, we need to drop template1. Templates cannot be dropped, so we first modify it so it is an ordinary database:<br />
UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';<br />
2. Now we can drop it:<br />
DROP DATABASE template1;<br />
3. The next step is to create a new database from template0, with a new default encoding:<br />
CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';<br />
4. Now modify template1 so it is actually a template:<br />
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';<br />
6. (OPTIONAL) If you do not want anyone connecting to this template, set datallowconn to FALSE:<br />
UPDATE pg_database SET datallowconn = FALSE WHERE datname = 'template1';<br />
<br />
Now you can create a new database by running from regular shell:<br />
su -<br />
su - postgres<br />
createdb blog;<br />
<br />
If you log in back to psql and check the databases, you should see the proper encoding of your new database:<br />
\l<br />
returns<br />
List of databases<br />
Name | Owner | Encoding | Collation | Ctype | Access privileges<br />
-----------+----------+-----------+-----------+-------+----------------------<br />
blog | postgres | UTF8 | C | C |<br />
postgres | postgres | SQL_ASCII | C | C |<br />
template0 | postgres | SQL_ASCII | C | C | =c/postgres<br />
: postgres=CTc/postgres<br />
template1 | postgres | UTF8 | C | C |<br />
<br />
==Installing phpPgAdmin (optional)==<br />
[http://phppgadmin.sourceforge.net phpPgAdmin] is a web-based administration tool for PostgreSQL.<br />
<br />
#Make sure that the [community] repo is enabled.<br />
#Install the package via Pacman<pre># pacman -S phppgadmin</pre><br />
<br />
==Installing pgAdmin (optional)==<br />
[http://www.pgadmin.org/ pgAdmin] is a GUI-based administration tool for PostgreSQL.<br />
#Install the package via Pacman<pre># pacman -S pgadmin3</pre><br />
<br />
==Upgrading PostgreSQL ==<br />
{{Warning|Official PostgreSQL [http://www.postgresql.org/docs/current/static/install-upgrading.html upgrade] documentation should be followed.}}<br />
<br />
Note that these instructions could cause data loss. '''Use at your own risk'''.<br />
<br />
It is recommended to add the following to your <code>/etc/pacman.conf</code> file:<br />
IgnorePkg = postgresql postgresql-libs<br />
This will ensure you do not accidentally upgrade the database to an incompatible version. When an upgrade is available, pacman will notify you that it is skipping the upgrade because of the entry in pacman.conf. Minor version upgrades (e.g., 9.0.3 to 9.0.4) are safe to perform. However, if you do an accidental upgrade to a different major version (e.g., 9.0.X to 9.1.X), you might not be able to access any of your data. Always check the PostgreSQL home page (http://www.postgresql.org/) to be sure of what steps are required for each upgrade. For a bit about why this is the case see the [http://www.postgresql.org/support/versioning versioning policy].<br />
<br />
There are two main ways to upgrade your PostgreSQL database. Read the official documentation for details.<br />
<br />
For those wishing to use <code>pg_upgrade</code>, a {{Package Official|postgresql-old-upgrade}} package is available in the repositories that will always run one major version behind the real PostgreSQL package. This can be installed side by side with the new version of PostgreSQL. When you are ready to perform the upgrade, you can do<br />
pacman -Sy postgresql postgresql-libs postgres-old-upgrade<br />
Note also that the data directory does not change from version to version, so before running pg_upgrade it is necessary to rename your existing data directory and migrate into a new directory. The new database must be initialized by starting the server, as described near the top of this page. The server then needs to be stopped before running pg_upgrade.<br />
<br />
Reference the [http://www.postgresql.org/docs/9.1/static/pgupgrade.html upstream pg_upgrade documentation] for details.<br />
<br />
The upgrade invocation will likely look something like the following (run as the postgres user). '''Do not run this command blindly without understanding what it does!'''<br />
<br />
# pg_upgrade -d /var/lib/postgresql/olddata/ -D /var/lib/postgresql/data/ -b /opt/pgsql-8.4/bin/ -B /usr/bin/<br />
<br />
==Performance issues==<br />
<br />
If you're using PostgresSQL on a local machine for development and it seems slow, you could try turning fsync off in the configuration (<code>/var/lib/postgres/data/postgresql.conf</code>).<br />
<br />
<pre>fsync = off</pre><br />
<br />
==More Resources==<br />
*[http://www.postgresql.org/ Official PostgreSQL Homepage]</div>Ostroffjh