https://wiki.archlinux.org/api.php?action=feedcontributions&user=ChrisDennis&feedformat=atomArchWiki - User contributions [en]2024-03-28T17:14:25ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Talk:PostgreSQL&diff=557043Talk:PostgreSQL2018-11-24T16:57:13Z<p>ChrisDennis: </p>
<hr />
<div>== Upgrade from 10 to 11 ==<br />
<br />
I've just (belatedly) updated Postgresql from version 10 to 11, and had a couple of problems.<br />
<br />
{{ic|pg_upgrade}} failed, and I couldn't see anything that looked like a helpful error message, so I resorted to the manual method as described in section 7.1 of this page.<br />
<br />
That initially failed too, but I got it to work by using {{ic|/opt/pgsql-10/bin/pg_dumpall}} instead of just {{ic|pg_dumpall}}. So the steps I used were: <br />
<br />
# systemctl stop postgresql.service<br />
# mv /var/lib/postgres/data /var/lib/postgres/olddata<br />
# mkdir /var/lib/postgres/data<br />
# chown postgres:postgres /var/lib/postgres/data<br />
[postgres]$ initdb -D '/var/lib/postgres/data'<br />
[postgres]$ /opt/pgsql-10/bin/pg_ctl -D /var/lib/postgres/olddata/ start<br />
[postgres]$ /opt/pgsql-10/bin/pg_dumpall -f /tmp/old_backup.sql<br />
[postgres]$ /opt/pgsql-10/bin/pg_ctl -D /var/lib/postgres/olddata/ stop<br />
# systemctl start postgresql.service<br />
[postgres]$ psql -f /tmp/old_backup.sql postgres<br />
<br />
[[User:ChrisDennis|ChrisDennis]] ([[User talk:ChrisDennis|talk]]) 18:26, 18 November 2018 (UTC)<br />
<br />
:It is hard to argue about errors without seeing them. Upstream [https://www.postgresql.org/docs/11/upgrading.html#UPGRADING-VIA-PGDUMPALL recommends] to use ''pg_dumpall'' from the newer version, so you should probably ask upstream about the problems. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 18:43, 18 November 2018 (UTC)<br />
<br />
::I failed to note the exact errors at the time, but one related to a version of a library being missing, so I assumed that the problems were caused by the fact that my whole system had been very out of date before I did a system update and then upgraded postgresql. My point was that a tweak to the instructions on this page was required to solve the problem. [[User:ChrisDennis|ChrisDennis]] ([[User talk:ChrisDennis|talk]]) 18:45, 23 November 2018 (UTC)</div>ChrisDennishttps://wiki.archlinux.org/index.php?title=Talk:PostgreSQL&diff=556874Talk:PostgreSQL2018-11-23T18:45:44Z<p>ChrisDennis: Reply</p>
<hr />
<div>== Upgrade from 10 to 11 ==<br />
<br />
I've just (belatedly) updated Postgresql from version 10 to 11, and had a couple of problems.<br />
<br />
{{ic|pg_upgrade}} failed, and I couldn't see anything that looked like a helpful error message, so I resorted to the manual method as described in section 7.1 of this page.<br />
<br />
That initially failed too, but I got it to work by using {{ic|/opt/pgsql-10/bin/pg_dumpall}} instead of just {{ic|pg_dumpall}}. So the steps I used were: <br />
<br />
# systemctl stop postgresql.service<br />
# mv /var/lib/postgres/data /var/lib/postgres/olddata<br />
# mkdir /var/lib/postgres/data<br />
# chown postgres:postgres /var/lib/postgres/data<br />
[postgres]$ initdb -D '/var/lib/postgres/data'<br />
[postgres]$ /opt/pgsql-10/bin/pg_ctl -D /var/lib/postgres/olddata/ start<br />
[postgres]$ /opt/pgsql-10/bin/pg_dumpall -f /tmp/old_backup.sql<br />
[postgres]$ /opt/pgsql-10/bin/pg_ctl -D /var/lib/postgres/olddata/ stop<br />
# systemctl start postgresql.service<br />
[postgres]$ psql -f /tmp/old_backup.sql postgres<br />
<br />
[[User:ChrisDennis|ChrisDennis]] ([[User talk:ChrisDennis|talk]]) 18:26, 18 November 2018 (UTC)<br />
<br />
:It is hard to argue about errors without seeing them. Upstream [https://www.postgresql.org/docs/11/upgrading.html#UPGRADING-VIA-PGDUMPALL recommends] to use ''pg_dumpall'' from the newer version, so you should probably ask upstream about the problems. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 18:43, 18 November 2018 (UTC)<br />
<br />
::I failed to note the exact errors at the time, but one related to a version of a library being missing, so I assumed that the problems were caused by the fact that my whole system had been very out of date before I did a system update and then upgraded postgresql. My point was that a tweak to the instructions on this page was required to solve the problem.<br />
[[User:ChrisDennis|ChrisDennis]] ([[User talk:ChrisDennis|talk]]) 18:45, 23 November 2018 (UTC)</div>ChrisDennishttps://wiki.archlinux.org/index.php?title=Talk:PostgreSQL&diff=555783Talk:PostgreSQL2018-11-18T18:26:59Z<p>ChrisDennis: Suggested update to manual upgrade instructions</p>
<hr />
<div>I've just (belatedly) updated Postgresql from version 10 to 11, and had a couple of problems.<br />
<br />
{{ic|pg_upgrade}} failed, and I couldn't see anything that looked like a helpful error message, so I resorted to the manual method as described in section 7.1 of this page.<br />
<br />
That initially failed too, but I got it to work by using {{ic|/opt/pgsql-10/bin/pg_dumpall}} instead of just {{ic|pg_dumpall}}. So the steps I used were: <br />
<br />
# systemctl stop postgresql.service<br />
# mv /var/lib/postgres/data /var/lib/postgres/olddata<br />
# mkdir /var/lib/postgres/data<br />
# chown postgres:postgres /var/lib/postgres/data<br />
[postgres]$ initdb -D '/var/lib/postgres/data'<br />
[postgres]$ /opt/pgsql-10/bin/pg_ctl -D /var/lib/postgres/olddata/ start<br />
[postgres]$ /opt/pgsql-10/bin/pg_dumpall -f /tmp/old_backup.sql<br />
[postgres]$ /opt/pgsql-10/bin/pg_ctl -D /var/lib/postgres/olddata/ stop<br />
# systemctl start postgresql.service<br />
[postgres]$ psql -f /tmp/old_backup.sql postgres<br />
<br />
[[User:ChrisDennis|ChrisDennis]] ([[User talk:ChrisDennis|talk]]) 18:26, 18 November 2018 (UTC)</div>ChrisDennishttps://wiki.archlinux.org/index.php?title=Odoo&diff=254985Odoo2013-04-23T12:07:22Z<p>ChrisDennis: /* Installing Open ERP from AUR */</p>
<hr />
<div>[[Category:Office]]<br />
{{stub}}<br />
<br />
=Introduction=<br />
<br />
{{Note|'''This page needs some major updating to be compatible with Open ERP version 7, which is what is now available from AUR'''}}<br />
<br />
This introduction briefly describes [http://openerp.com/ Open ERP], its basic design, and its community. The rest of this wikipage details installing and configuring Open ERP on Arch Linux. It also provides additional information about Open ERP documentation, community, and development.<br />
<br />
Open ERP is Enterprise Resource Planning software. It provides a complete, integrated ERP solution for small and medium sized businesses and organizations. Open ERP includes financial and analytic accounting, warehouse and inventory management, sales and purchase management, customer and supplier relations management, association management, tasks automation, human resource management, marketing campaign, document management, help desk, e-commerce integration, and point of sale functionality.<br />
<br />
Open ERP features an application server which uses PostgreSQL for its database, along with a standalone GTK-based client, as well as a web-based client. It is written in the Python programming language, with a highly modular design which allows for the rapid development of new modules through Open Object RAD. Open ERP developers have a strong committment to free software.<br />
<br />
A thriving support and development community has grown up around Open ERP, providing free technical support, bugfixing, new development, and support services. Open ERP provides extensive documentation in various electronic formats, as well as hardcopy. The company responsible for development of Open ERP earns profits through partnership services with Open ERP consultants, and by providing support, training, hosting services, software development, and software quality testing and verification.<br />
<br />
=Before Installing Open ERP=<br />
<br />
The following instructions assume that you have installed the 'sudo' command on your Arch Linux system. If you have not already done so, go to the [[sudo]] Arch Wikipage for more information.<br />
<br />
===Installing PostgreSQL===<br />
<br />
Open ERP uses the PostgreSQL database, which should be installed and configured before installing Open ERP. Follow the instructions in the "Installing PostgreSQL" section of the [https://wiki.archlinux.org/index.php/PostgreSQL#Installing_PostgreSQL Arch PostgreSQL Wikipage]. Complete these installation instructions, but do '''not''' perform any other configuration from that page. Return to this page for additional configuration steps.<br />
<br />
===Configuring PostgreSQL for local use on your own machine===<br />
<br />
If you plan to use PostgreSQL and Open ERP on the same machine, you will need to configure PostgreSQL to listen on the localhost's 5432 TCP port. As root, open the following configuration file with a text editor:<br />
<br />
/var/lib/postgres/data/postgresql.conf<br />
<br />
Search for the following section within the postgresql.conf file:<br />
<br />
#------------------------------------------------------------------------------<br />
# CONNECTIONS AND AUTHENTICATION<br />
#------------------------------------------------------------------------------<br />
<br />
# - Connection Settings -<br />
<br />
#listen_addresses = 'localhost' # what IP address(es) to listen on;<br />
# comma-separated list of addresses;<br />
# defaults to 'localhost', '*' = all<br />
# (change requires restart)<br />
#port = 5432 # (change requires restart)<br />
<br />
Uncomment the #listen_addresses line, and replace the text 'localhost' with '127.0.0.1'. Also, uncomment the #port line. Save the file. When complete, the file should appear as follows:<br />
<br />
#------------------------------------------------------------------------------<br />
# CONNECTIONS AND AUTHENTICATION<br />
#------------------------------------------------------------------------------<br />
<br />
# - Connection Settings -<br />
<br />
listen_addresses = '127.0.0.1' # what IP address(es) to listen on;<br />
# comma-separated list of addresses;<br />
# defaults to 'localhost', '*' = all<br />
# (change requires restart)<br />
port = 5432 # (change requires restart)<br />
<br />
Restart PostgreSQL so that it uses the newly changed conf file, by executing the following command:<br />
<br />
sudo /etc/rc.d/postgresql restart<br />
<br />
Verify that PostgreSQL is listening on the localhost port 5432 by executing the following command:<br />
<br />
# ss -anpt<br />
<br />
Within the output from this command, you should find the following line of text, except for the PID number which will very likely be different:<br />
<br />
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 13420/postgres<br />
<br />
===Configuring PostgreSQL for remote use over a network===<br />
<br />
If you need remote access to PostgreSQL over a network, read the following section from the [https://wiki.archlinux.org/index.php/PostgreSQL#Configure_PostgreSQL_to_be_accessible_from_remote PostgreSQL Arch Wikipage].<br />
<br />
===Setting up PostgreSQL to run with Open ERP===<br />
<br />
Next, it is necessary to create a new PostgreSQL user for Open ERP. In this example, the user is 'yourusername', but you should replace this with your Arch system login username. First, log in as the default PostgreSQL superuser, 'postgres', by executing the following command from the CLI:<br />
<br />
sudo su - postgres<br />
<br />
Once logged in as postgres, begin the process of creating the 'yourusername' user, with the folowing command:<br />
<br />
createuser yourusername -P<br />
<br />
You will first be asked for a password. For highly secure yet easy to remember passwords, consider using a [http://world.std.com/~reinhold/diceware.html Diceware Passphrase]. Re-enter the password as requested. The next three questions should be answered in sequence with n, y, and n. Shall the new role be a superuser? n Shall the new role be allowed to create database? y Shall the new role be allowed to create more new roles? n<br />
<br />
Once you are finished answering these questions, type the word 'exit' to log out from PostgreSQL as the postgres superuser.<br />
<br />
You may want to edit your /etc/rc.conf file by adding postgresql to the Daemons list, so that PostgreSQL will automatically start up when you boot up your computer.<br />
<br />
This completes the installation and setup of PostgreSQL for use with Open ERP under Arch Linux. Additional detailed information about PostgreSQL configuration may be found on the Arch Wikipage for [[PostgreSQL]], and the [http://www.postgresql.org/docs/manuals/ PostgreSQL Manuals webpage]. Also, there is a powerful GUI PostgreSQL Admin tool, [http://www.pgadmin.org/ pgAdmin], which is available in the Arch repositories.<br />
<br />
=Installing Open ERP from AUR=<br />
<br />
Open ERP requires the installation of the Open ERP Server, Open ERP comes with a webserver so you can use your web browser to use it<s>, or you can use a Open ERP GTK-Client installed from AUR</s>. Currently, Open ERP is not available in the main repositories of Arch Linux, but it is available through the Arch User Repository. Open ERP requires Python 2.7, various libraries compiled with Python 2.7, and a few other dependencies not found in the Arch repositories. All of these packages are provided through AUR. The best tool for downloading, compiling, and installing AUR packages is [[yaourt]]. The following instructions assume that yaourt has been installed and configured on the user's system.<br />
<br />
===install Open ERP===<br />
<br />
yaourt -S openerp<br />
<br />
===configure Open ERP===<br />
<br />
the configure file of Open ERP server is at /etc/openerp/openerp-server.conf. make it look like this:<br />
<br />
[options]<br />
; This is the password that allows database operations:<br />
; admin_passwd = admin<br />
db_host = localhost<br />
db_port = 5432<br />
db_user = yourusername ##this is username you created in postegres.<br />
db_password =<br />
<br />
=== start Open ERP server===<br />
<br />
use the command below to enable autostart openerp server when system boot:<br />
<br />
systemctl enable openerp-server.service<br />
<br />
use the command below to start openerp:<br />
<br />
systemctl start openerp-server.service<br />
<br />
=== login to Open ERP ===<br />
<br />
use your favorite web browser and go to link below:<br />
<br />
127.0.0.1:8069<br />
<br />
shows openerp login page.<br />
<br />
===Open ERP GTK-Client===<br />
<br />
{{Note|''' The current version of Open ERP in AUR is 7.0, which [https://lists.launchpad.net/openerp-community/msg01400.html DOES NOT have a GTK client].''' If you install openerp-client (version 6.1), it will probably break your Open ERP database.}}<br />
<br />
<s>To install the Open ERP standalone GTK-based client, from the CLI, execute the following command:<br />
<br />
yaourt -S openerp-client<br />
</s><br />
<br />
=Additional Open ERP Documentation=<br />
<br />
There are various sources of Open ERP documentation. The best place to start is the [http://doc.openerp.com/ Open ERP Documentation webpage]. This page links to different online documents, including [http://doc.openerp.com/install/index.html detailed installation instructions]. Additionally, there is an online copy of the book, [http://doc.openerp.com/book/index.html "Open ERP for Retail and Industrial Management"]. This copy is also available as a [http://www.openerp.com/en/buy/e-book.html PDF file]{{Linkrot|2011|09|06}}, and can be purchased in [http://www.openerp.com/buy.html?page=shop.product_details&flypage=openerp.tpl&product_id=36&category_id=8 hardcopy form from Open ERP]{{Linkrot|2011|09|06}} or from [http://www.amazon.com/Open-ERP-Retail-Industrial-Management/dp/2960087607/ Amazon.com]. While Open ERP documentation, such as "Open ERP for Retail and Industrial Management" is freely downloadable, it does not come with a free documentation license. Further details about this issue are found on the [http://doc.openerp.com/documentation_license.html Open ERP website]{{Linkrot|2011|09|06}}. Finally, [http://www.openerp.tv/ Open ERP TV] provides screencasts, some of which document various features and procedures of the software.<br />
<br />
=Open ERP Community=<br />
<br />
The Open ERP Community is centered upon the [http://openobject.com/ Open Object website]. Free technical support for Open ERP may be found in the [http://openobject.com/forum/index.php webforums], a [http://tiny.be/mailman/listinfo/tinyerp-users mailing list]{{Linkrot|2011|09|06}} which is linked to the webforums, an [http://openobject.com/irc/ IRC channel] on freenode.net, an [http://www.openobject.com/wiki/index.php/Main_Page Open ERP wiki], and the [http://doc.openerp.com/ Official ERP Documentation webpage.] The latest news may be found on [http://openerp.com/planet/ Open ERP Planet], while various Open ERP screencasts are provided on [http://www.openerp.tv/ Open ERP TV]. Fee-based support services are provided by [http://openerp.com/en/partners.html Open ERP Partners]{{Linkrot|2011|09|06}}.<br />
<br />
=Open Object RAD=<br />
<br />
Open Object is the Python-based [http://openobject.com/index.php?option=com_content&view=article&id=46&Itemid=53 Rapid Application Development framework] for developing Open ERP modules. It allows developers and businesses to customize Open ERP for specific needs. Open Object RAD development work is centered upon the [https://launchpad.net/openobject Open Object Launchpad page]. Developer news and blogs are published on [http://openobject.com/planet/ Open Object Planet]. There are pages for [http://www.openerp.com/index.php?option=com_content&view=article&id=18&Itemid=28 software downloads], [http://doc.openerp.com/modindex.html Open ERP module downloads]{{Linkrot|2011|09|06}}, and [http://openobject.com/index.php?option=com_content&view=article&id=53&Itemid=61 development source code downloads].</div>ChrisDennishttps://wiki.archlinux.org/index.php?title=Odoo&diff=254984Odoo2013-04-23T12:04:42Z<p>ChrisDennis: /* Introduction */</p>
<hr />
<div>[[Category:Office]]<br />
{{stub}}<br />
<br />
=Introduction=<br />
<br />
{{Note|'''This page needs some major updating to be compatible with Open ERP version 7, which is what is now available from AUR'''}}<br />
<br />
This introduction briefly describes [http://openerp.com/ Open ERP], its basic design, and its community. The rest of this wikipage details installing and configuring Open ERP on Arch Linux. It also provides additional information about Open ERP documentation, community, and development.<br />
<br />
Open ERP is Enterprise Resource Planning software. It provides a complete, integrated ERP solution for small and medium sized businesses and organizations. Open ERP includes financial and analytic accounting, warehouse and inventory management, sales and purchase management, customer and supplier relations management, association management, tasks automation, human resource management, marketing campaign, document management, help desk, e-commerce integration, and point of sale functionality.<br />
<br />
Open ERP features an application server which uses PostgreSQL for its database, along with a standalone GTK-based client, as well as a web-based client. It is written in the Python programming language, with a highly modular design which allows for the rapid development of new modules through Open Object RAD. Open ERP developers have a strong committment to free software.<br />
<br />
A thriving support and development community has grown up around Open ERP, providing free technical support, bugfixing, new development, and support services. Open ERP provides extensive documentation in various electronic formats, as well as hardcopy. The company responsible for development of Open ERP earns profits through partnership services with Open ERP consultants, and by providing support, training, hosting services, software development, and software quality testing and verification.<br />
<br />
=Before Installing Open ERP=<br />
<br />
The following instructions assume that you have installed the 'sudo' command on your Arch Linux system. If you have not already done so, go to the [[sudo]] Arch Wikipage for more information.<br />
<br />
===Installing PostgreSQL===<br />
<br />
Open ERP uses the PostgreSQL database, which should be installed and configured before installing Open ERP. Follow the instructions in the "Installing PostgreSQL" section of the [https://wiki.archlinux.org/index.php/PostgreSQL#Installing_PostgreSQL Arch PostgreSQL Wikipage]. Complete these installation instructions, but do '''not''' perform any other configuration from that page. Return to this page for additional configuration steps.<br />
<br />
===Configuring PostgreSQL for local use on your own machine===<br />
<br />
If you plan to use PostgreSQL and Open ERP on the same machine, you will need to configure PostgreSQL to listen on the localhost's 5432 TCP port. As root, open the following configuration file with a text editor:<br />
<br />
/var/lib/postgres/data/postgresql.conf<br />
<br />
Search for the following section within the postgresql.conf file:<br />
<br />
#------------------------------------------------------------------------------<br />
# CONNECTIONS AND AUTHENTICATION<br />
#------------------------------------------------------------------------------<br />
<br />
# - Connection Settings -<br />
<br />
#listen_addresses = 'localhost' # what IP address(es) to listen on;<br />
# comma-separated list of addresses;<br />
# defaults to 'localhost', '*' = all<br />
# (change requires restart)<br />
#port = 5432 # (change requires restart)<br />
<br />
Uncomment the #listen_addresses line, and replace the text 'localhost' with '127.0.0.1'. Also, uncomment the #port line. Save the file. When complete, the file should appear as follows:<br />
<br />
#------------------------------------------------------------------------------<br />
# CONNECTIONS AND AUTHENTICATION<br />
#------------------------------------------------------------------------------<br />
<br />
# - Connection Settings -<br />
<br />
listen_addresses = '127.0.0.1' # what IP address(es) to listen on;<br />
# comma-separated list of addresses;<br />
# defaults to 'localhost', '*' = all<br />
# (change requires restart)<br />
port = 5432 # (change requires restart)<br />
<br />
Restart PostgreSQL so that it uses the newly changed conf file, by executing the following command:<br />
<br />
sudo /etc/rc.d/postgresql restart<br />
<br />
Verify that PostgreSQL is listening on the localhost port 5432 by executing the following command:<br />
<br />
# ss -anpt<br />
<br />
Within the output from this command, you should find the following line of text, except for the PID number which will very likely be different:<br />
<br />
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 13420/postgres<br />
<br />
===Configuring PostgreSQL for remote use over a network===<br />
<br />
If you need remote access to PostgreSQL over a network, read the following section from the [https://wiki.archlinux.org/index.php/PostgreSQL#Configure_PostgreSQL_to_be_accessible_from_remote PostgreSQL Arch Wikipage].<br />
<br />
===Setting up PostgreSQL to run with Open ERP===<br />
<br />
Next, it is necessary to create a new PostgreSQL user for Open ERP. In this example, the user is 'yourusername', but you should replace this with your Arch system login username. First, log in as the default PostgreSQL superuser, 'postgres', by executing the following command from the CLI:<br />
<br />
sudo su - postgres<br />
<br />
Once logged in as postgres, begin the process of creating the 'yourusername' user, with the folowing command:<br />
<br />
createuser yourusername -P<br />
<br />
You will first be asked for a password. For highly secure yet easy to remember passwords, consider using a [http://world.std.com/~reinhold/diceware.html Diceware Passphrase]. Re-enter the password as requested. The next three questions should be answered in sequence with n, y, and n. Shall the new role be a superuser? n Shall the new role be allowed to create database? y Shall the new role be allowed to create more new roles? n<br />
<br />
Once you are finished answering these questions, type the word 'exit' to log out from PostgreSQL as the postgres superuser.<br />
<br />
You may want to edit your /etc/rc.conf file by adding postgresql to the Daemons list, so that PostgreSQL will automatically start up when you boot up your computer.<br />
<br />
This completes the installation and setup of PostgreSQL for use with Open ERP under Arch Linux. Additional detailed information about PostgreSQL configuration may be found on the Arch Wikipage for [[PostgreSQL]], and the [http://www.postgresql.org/docs/manuals/ PostgreSQL Manuals webpage]. Also, there is a powerful GUI PostgreSQL Admin tool, [http://www.pgadmin.org/ pgAdmin], which is available in the Arch repositories.<br />
<br />
=Installing Open ERP from AUR=<br />
<br />
Open ERP requires the installation of the Open ERP Server, Open ERP comes with a webserver so you can use your web browser to use it, or you cna use a Open ERP GTK-Client installed from AUR. Currently, Open ERP is not available in the main repositories of Arch Linux, but it is available through the Arch User Repository. Open ERP requires Python 2.7, various libraries compiled with Python 2.7, and a few other dependencies not found in the Arch repositories. All of these packages are provided through AUR. The best tool for downloading, compiling, and installing AUR packages is [[yaourt]]. The following instructions assume that yaourt has been installed and configured on the user's system.<br />
<br />
===install Open ERP===<br />
<br />
yaourt -S openerp<br />
<br />
===configure Open ERP===<br />
<br />
the configure file of Open ERP server is at /etc/openerp/openerp-server.conf. make it look like this:<br />
<br />
[options]<br />
; This is the password that allows database operations:<br />
; admin_passwd = admin<br />
db_host = localhost<br />
db_port = 5432<br />
db_user = yourusername ##this is username you created in postegres.<br />
db_password =<br />
<br />
=== start Open ERP server===<br />
<br />
use the command below to enable autostart openerp server when system boot:<br />
<br />
systemctl enable openerp-server.service<br />
<br />
use the command below to start openerp:<br />
<br />
systemctl start openerp-start.service<br />
<br />
=== login to Open ERP ===<br />
<br />
use your favorite web browser and go to link below:<br />
<br />
127.0.0.1:8069<br />
<br />
shows openerp login page.<br />
<br />
===Open ERP GTK-Client===<br />
<br />
Note: the current version of Open ERP in AUR is 7.0, which [https://lists.launchpad.net/openerp-community/msg01400.html DOES NOT have a GTK client]. If you install openerp-client (version 6.1), it will probably break your Open ERP database.<br />
<br />
<s>To install the Open ERP standalone GTK-based client, from the CLI, execute the following command:<br />
<br />
yaourt -S openerp-client<br />
</s><br />
<br />
=Additional Open ERP Documentation=<br />
<br />
There are various sources of Open ERP documentation. The best place to start is the [http://doc.openerp.com/ Open ERP Documentation webpage]. This page links to different online documents, including [http://doc.openerp.com/install/index.html detailed installation instructions]. Additionally, there is an online copy of the book, [http://doc.openerp.com/book/index.html "Open ERP for Retail and Industrial Management"]. This copy is also available as a [http://www.openerp.com/en/buy/e-book.html PDF file]{{Linkrot|2011|09|06}}, and can be purchased in [http://www.openerp.com/buy.html?page=shop.product_details&flypage=openerp.tpl&product_id=36&category_id=8 hardcopy form from Open ERP]{{Linkrot|2011|09|06}} or from [http://www.amazon.com/Open-ERP-Retail-Industrial-Management/dp/2960087607/ Amazon.com]. While Open ERP documentation, such as "Open ERP for Retail and Industrial Management" is freely downloadable, it does not come with a free documentation license. Further details about this issue are found on the [http://doc.openerp.com/documentation_license.html Open ERP website]{{Linkrot|2011|09|06}}. Finally, [http://www.openerp.tv/ Open ERP TV] provides screencasts, some of which document various features and procedures of the software.<br />
<br />
=Open ERP Community=<br />
<br />
The Open ERP Community is centered upon the [http://openobject.com/ Open Object website]. Free technical support for Open ERP may be found in the [http://openobject.com/forum/index.php webforums], a [http://tiny.be/mailman/listinfo/tinyerp-users mailing list]{{Linkrot|2011|09|06}} which is linked to the webforums, an [http://openobject.com/irc/ IRC channel] on freenode.net, an [http://www.openobject.com/wiki/index.php/Main_Page Open ERP wiki], and the [http://doc.openerp.com/ Official ERP Documentation webpage.] The latest news may be found on [http://openerp.com/planet/ Open ERP Planet], while various Open ERP screencasts are provided on [http://www.openerp.tv/ Open ERP TV]. Fee-based support services are provided by [http://openerp.com/en/partners.html Open ERP Partners]{{Linkrot|2011|09|06}}.<br />
<br />
=Open Object RAD=<br />
<br />
Open Object is the Python-based [http://openobject.com/index.php?option=com_content&view=article&id=46&Itemid=53 Rapid Application Development framework] for developing Open ERP modules. It allows developers and businesses to customize Open ERP for specific needs. Open Object RAD development work is centered upon the [https://launchpad.net/openobject Open Object Launchpad page]. Developer news and blogs are published on [http://openobject.com/planet/ Open Object Planet]. There are pages for [http://www.openerp.com/index.php?option=com_content&view=article&id=18&Itemid=28 software downloads], [http://doc.openerp.com/modindex.html Open ERP module downloads]{{Linkrot|2011|09|06}}, and [http://openobject.com/index.php?option=com_content&view=article&id=53&Itemid=61 development source code downloads].</div>ChrisDennishttps://wiki.archlinux.org/index.php?title=Odoo&diff=254982Odoo2013-04-23T12:02:01Z<p>ChrisDennis: GTK client discontinued</p>
<hr />
<div>[[Category:Office]]<br />
{{stub}}<br />
<br />
=Introduction=<br />
<br />
This introduction briefly describes [http://openerp.com/ Open ERP], its basic design, and its community. The rest of this wikipage details installing and configuring Open ERP on Arch Linux. It also provides additional information about Open ERP documentation, community, and development.<br />
<br />
Open ERP is Enterprise Resource Planning software. It provides a complete, integrated ERP solution for small and medium sized businesses and organizations. Open ERP includes financial and analytic accounting, warehouse and inventory management, sales and purchase management, customer and supplier relations management, association management, tasks automation, human resource management, marketing campaign, document management, help desk, e-commerce integration, and point of sale functionality.<br />
<br />
Open ERP features an application server which uses PostgreSQL for its database, along with a standalone GTK-based client, as well as a web-based client. It is written in the Python programming language, with a highly modular design which allows for the rapid development of new modules through Open Object RAD. Open ERP developers have a strong committment to free software.<br />
<br />
A thriving support and development community has grown up around Open ERP, providing free technical support, bugfixing, new development, and support services. Open ERP provides extensive documentation in various electronic formats, as well as hardcopy. The company responsible for development of Open ERP earns profits through partnership services with Open ERP consultants, and by providing support, training, hosting services, software development, and software quality testing and verification.<br />
<br />
=Before Installing Open ERP=<br />
<br />
The following instructions assume that you have installed the 'sudo' command on your Arch Linux system. If you have not already done so, go to the [[sudo]] Arch Wikipage for more information.<br />
<br />
===Installing PostgreSQL===<br />
<br />
Open ERP uses the PostgreSQL database, which should be installed and configured before installing Open ERP. Follow the instructions in the "Installing PostgreSQL" section of the [https://wiki.archlinux.org/index.php/PostgreSQL#Installing_PostgreSQL Arch PostgreSQL Wikipage]. Complete these installation instructions, but do '''not''' perform any other configuration from that page. Return to this page for additional configuration steps.<br />
<br />
===Configuring PostgreSQL for local use on your own machine===<br />
<br />
If you plan to use PostgreSQL and Open ERP on the same machine, you will need to configure PostgreSQL to listen on the localhost's 5432 TCP port. As root, open the following configuration file with a text editor:<br />
<br />
/var/lib/postgres/data/postgresql.conf<br />
<br />
Search for the following section within the postgresql.conf file:<br />
<br />
#------------------------------------------------------------------------------<br />
# CONNECTIONS AND AUTHENTICATION<br />
#------------------------------------------------------------------------------<br />
<br />
# - Connection Settings -<br />
<br />
#listen_addresses = 'localhost' # what IP address(es) to listen on;<br />
# comma-separated list of addresses;<br />
# defaults to 'localhost', '*' = all<br />
# (change requires restart)<br />
#port = 5432 # (change requires restart)<br />
<br />
Uncomment the #listen_addresses line, and replace the text 'localhost' with '127.0.0.1'. Also, uncomment the #port line. Save the file. When complete, the file should appear as follows:<br />
<br />
#------------------------------------------------------------------------------<br />
# CONNECTIONS AND AUTHENTICATION<br />
#------------------------------------------------------------------------------<br />
<br />
# - Connection Settings -<br />
<br />
listen_addresses = '127.0.0.1' # what IP address(es) to listen on;<br />
# comma-separated list of addresses;<br />
# defaults to 'localhost', '*' = all<br />
# (change requires restart)<br />
port = 5432 # (change requires restart)<br />
<br />
Restart PostgreSQL so that it uses the newly changed conf file, by executing the following command:<br />
<br />
sudo /etc/rc.d/postgresql restart<br />
<br />
Verify that PostgreSQL is listening on the localhost port 5432 by executing the following command:<br />
<br />
# ss -anpt<br />
<br />
Within the output from this command, you should find the following line of text, except for the PID number which will very likely be different:<br />
<br />
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 13420/postgres<br />
<br />
===Configuring PostgreSQL for remote use over a network===<br />
<br />
If you need remote access to PostgreSQL over a network, read the following section from the [https://wiki.archlinux.org/index.php/PostgreSQL#Configure_PostgreSQL_to_be_accessible_from_remote PostgreSQL Arch Wikipage].<br />
<br />
===Setting up PostgreSQL to run with Open ERP===<br />
<br />
Next, it is necessary to create a new PostgreSQL user for Open ERP. In this example, the user is 'yourusername', but you should replace this with your Arch system login username. First, log in as the default PostgreSQL superuser, 'postgres', by executing the following command from the CLI:<br />
<br />
sudo su - postgres<br />
<br />
Once logged in as postgres, begin the process of creating the 'yourusername' user, with the folowing command:<br />
<br />
createuser yourusername -P<br />
<br />
You will first be asked for a password. For highly secure yet easy to remember passwords, consider using a [http://world.std.com/~reinhold/diceware.html Diceware Passphrase]. Re-enter the password as requested. The next three questions should be answered in sequence with n, y, and n. Shall the new role be a superuser? n Shall the new role be allowed to create database? y Shall the new role be allowed to create more new roles? n<br />
<br />
Once you are finished answering these questions, type the word 'exit' to log out from PostgreSQL as the postgres superuser.<br />
<br />
You may want to edit your /etc/rc.conf file by adding postgresql to the Daemons list, so that PostgreSQL will automatically start up when you boot up your computer.<br />
<br />
This completes the installation and setup of PostgreSQL for use with Open ERP under Arch Linux. Additional detailed information about PostgreSQL configuration may be found on the Arch Wikipage for [[PostgreSQL]], and the [http://www.postgresql.org/docs/manuals/ PostgreSQL Manuals webpage]. Also, there is a powerful GUI PostgreSQL Admin tool, [http://www.pgadmin.org/ pgAdmin], which is available in the Arch repositories.<br />
<br />
=Installing Open ERP from AUR=<br />
<br />
Open ERP requires the installation of the Open ERP Server, Open ERP comes with a webserver so you can use your web browser to use it, or you cna use a Open ERP GTK-Client installed from AUR. Currently, Open ERP is not available in the main repositories of Arch Linux, but it is available through the Arch User Repository. Open ERP requires Python 2.7, various libraries compiled with Python 2.7, and a few other dependencies not found in the Arch repositories. All of these packages are provided through AUR. The best tool for downloading, compiling, and installing AUR packages is [[yaourt]]. The following instructions assume that yaourt has been installed and configured on the user's system.<br />
<br />
===install Open ERP===<br />
<br />
yaourt -S openerp<br />
<br />
===configure Open ERP===<br />
<br />
the configure file of Open ERP server is at /etc/openerp/openerp-server.conf. make it look like this:<br />
<br />
[options]<br />
; This is the password that allows database operations:<br />
; admin_passwd = admin<br />
db_host = localhost<br />
db_port = 5432<br />
db_user = yourusername ##this is username you created in postegres.<br />
db_password =<br />
<br />
=== start Open ERP server===<br />
<br />
use the command below to enable autostart openerp server when system boot:<br />
<br />
systemctl enable openerp-server.service<br />
<br />
use the command below to start openerp:<br />
<br />
systemctl start openerp-start.service<br />
<br />
=== login to Open ERP ===<br />
<br />
use your favorite web browser and go to link below:<br />
<br />
127.0.0.1:8069<br />
<br />
shows openerp login page.<br />
<br />
===Open ERP GTK-Client===<br />
<br />
Note: the current version of Open ERP in AUR is 7.0, which [https://lists.launchpad.net/openerp-community/msg01400.html DOES NOT have a GTK client]. If you install openerp-client (version 6.1), it will probably break your Open ERP database.<br />
<br />
<s>To install the Open ERP standalone GTK-based client, from the CLI, execute the following command:<br />
<br />
yaourt -S openerp-client<br />
</s><br />
<br />
=Additional Open ERP Documentation=<br />
<br />
There are various sources of Open ERP documentation. The best place to start is the [http://doc.openerp.com/ Open ERP Documentation webpage]. This page links to different online documents, including [http://doc.openerp.com/install/index.html detailed installation instructions]. Additionally, there is an online copy of the book, [http://doc.openerp.com/book/index.html "Open ERP for Retail and Industrial Management"]. This copy is also available as a [http://www.openerp.com/en/buy/e-book.html PDF file]{{Linkrot|2011|09|06}}, and can be purchased in [http://www.openerp.com/buy.html?page=shop.product_details&flypage=openerp.tpl&product_id=36&category_id=8 hardcopy form from Open ERP]{{Linkrot|2011|09|06}} or from [http://www.amazon.com/Open-ERP-Retail-Industrial-Management/dp/2960087607/ Amazon.com]. While Open ERP documentation, such as "Open ERP for Retail and Industrial Management" is freely downloadable, it does not come with a free documentation license. Further details about this issue are found on the [http://doc.openerp.com/documentation_license.html Open ERP website]{{Linkrot|2011|09|06}}. Finally, [http://www.openerp.tv/ Open ERP TV] provides screencasts, some of which document various features and procedures of the software.<br />
<br />
=Open ERP Community=<br />
<br />
The Open ERP Community is centered upon the [http://openobject.com/ Open Object website]. Free technical support for Open ERP may be found in the [http://openobject.com/forum/index.php webforums], a [http://tiny.be/mailman/listinfo/tinyerp-users mailing list]{{Linkrot|2011|09|06}} which is linked to the webforums, an [http://openobject.com/irc/ IRC channel] on freenode.net, an [http://www.openobject.com/wiki/index.php/Main_Page Open ERP wiki], and the [http://doc.openerp.com/ Official ERP Documentation webpage.] The latest news may be found on [http://openerp.com/planet/ Open ERP Planet], while various Open ERP screencasts are provided on [http://www.openerp.tv/ Open ERP TV]. Fee-based support services are provided by [http://openerp.com/en/partners.html Open ERP Partners]{{Linkrot|2011|09|06}}.<br />
<br />
=Open Object RAD=<br />
<br />
Open Object is the Python-based [http://openobject.com/index.php?option=com_content&view=article&id=46&Itemid=53 Rapid Application Development framework] for developing Open ERP modules. It allows developers and businesses to customize Open ERP for specific needs. Open Object RAD development work is centered upon the [https://launchpad.net/openobject Open Object Launchpad page]. Developer news and blogs are published on [http://openobject.com/planet/ Open Object Planet]. There are pages for [http://www.openerp.com/index.php?option=com_content&view=article&id=18&Itemid=28 software downloads], [http://doc.openerp.com/modindex.html Open ERP module downloads]{{Linkrot|2011|09|06}}, and [http://openobject.com/index.php?option=com_content&view=article&id=53&Itemid=61 development source code downloads].</div>ChrisDennishttps://wiki.archlinux.org/index.php?title=Odoo&diff=254978Odoo2013-04-23T11:55:29Z<p>ChrisDennis: corrected the name of the service</p>
<hr />
<div>[[Category:Office]]<br />
{{stub}}<br />
<br />
=Introduction=<br />
<br />
This introduction briefly describes [http://openerp.com/ Open ERP], its basic design, and its community. The rest of this wikipage details installing and configuring Open ERP on Arch Linux. It also provides additional information about Open ERP documentation, community, and development.<br />
<br />
Open ERP is Enterprise Resource Planning software. It provides a complete, integrated ERP solution for small and medium sized businesses and organizations. Open ERP includes financial and analytic accounting, warehouse and inventory management, sales and purchase management, customer and supplier relations management, association management, tasks automation, human resource management, marketing campaign, document management, help desk, e-commerce integration, and point of sale functionality.<br />
<br />
Open ERP features an application server which uses PostgreSQL for its database, along with a standalone GTK-based client, as well as a web-based client. It is written in the Python programming language, with a highly modular design which allows for the rapid development of new modules through Open Object RAD. Open ERP developers have a strong committment to free software.<br />
<br />
A thriving support and development community has grown up around Open ERP, providing free technical support, bugfixing, new development, and support services. Open ERP provides extensive documentation in various electronic formats, as well as hardcopy. The company responsible for development of Open ERP earns profits through partnership services with Open ERP consultants, and by providing support, training, hosting services, software development, and software quality testing and verification.<br />
<br />
=Before Installing Open ERP=<br />
<br />
The following instructions assume that you have installed the 'sudo' command on your Arch Linux system. If you have not already done so, go to the [[sudo]] Arch Wikipage for more information.<br />
<br />
===Installing PostgreSQL===<br />
<br />
Open ERP uses the PostgreSQL database, which should be installed and configured before installing Open ERP. Follow the instructions in the "Installing PostgreSQL" section of the [https://wiki.archlinux.org/index.php/PostgreSQL#Installing_PostgreSQL Arch PostgreSQL Wikipage]. Complete these installation instructions, but do '''not''' perform any other configuration from that page. Return to this page for additional configuration steps.<br />
<br />
===Configuring PostgreSQL for local use on your own machine===<br />
<br />
If you plan to use PostgreSQL and Open ERP on the same machine, you will need to configure PostgreSQL to listen on the localhost's 5432 TCP port. As root, open the following configuration file with a text editor:<br />
<br />
/var/lib/postgres/data/postgresql.conf<br />
<br />
Search for the following section within the postgresql.conf file:<br />
<br />
#------------------------------------------------------------------------------<br />
# CONNECTIONS AND AUTHENTICATION<br />
#------------------------------------------------------------------------------<br />
<br />
# - Connection Settings -<br />
<br />
#listen_addresses = 'localhost' # what IP address(es) to listen on;<br />
# comma-separated list of addresses;<br />
# defaults to 'localhost', '*' = all<br />
# (change requires restart)<br />
#port = 5432 # (change requires restart)<br />
<br />
Uncomment the #listen_addresses line, and replace the text 'localhost' with '127.0.0.1'. Also, uncomment the #port line. Save the file. When complete, the file should appear as follows:<br />
<br />
#------------------------------------------------------------------------------<br />
# CONNECTIONS AND AUTHENTICATION<br />
#------------------------------------------------------------------------------<br />
<br />
# - Connection Settings -<br />
<br />
listen_addresses = '127.0.0.1' # what IP address(es) to listen on;<br />
# comma-separated list of addresses;<br />
# defaults to 'localhost', '*' = all<br />
# (change requires restart)<br />
port = 5432 # (change requires restart)<br />
<br />
Restart PostgreSQL so that it uses the newly changed conf file, by executing the following command:<br />
<br />
sudo /etc/rc.d/postgresql restart<br />
<br />
Verify that PostgreSQL is listening on the localhost port 5432 by executing the following command:<br />
<br />
# ss -anpt<br />
<br />
Within the output from this command, you should find the following line of text, except for the PID number which will very likely be different:<br />
<br />
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 13420/postgres<br />
<br />
===Configuring PostgreSQL for remote use over a network===<br />
<br />
If you need remote access to PostgreSQL over a network, read the following section from the [https://wiki.archlinux.org/index.php/PostgreSQL#Configure_PostgreSQL_to_be_accessible_from_remote PostgreSQL Arch Wikipage].<br />
<br />
===Setting up PostgreSQL to run with Open ERP===<br />
<br />
Next, it is necessary to create a new PostgreSQL user for Open ERP. In this example, the user is 'yourusername', but you should replace this with your Arch system login username. First, log in as the default PostgreSQL superuser, 'postgres', by executing the following command from the CLI:<br />
<br />
sudo su - postgres<br />
<br />
Once logged in as postgres, begin the process of creating the 'yourusername' user, with the folowing command:<br />
<br />
createuser yourusername -P<br />
<br />
You will first be asked for a password. For highly secure yet easy to remember passwords, consider using a [http://world.std.com/~reinhold/diceware.html Diceware Passphrase]. Re-enter the password as requested. The next three questions should be answered in sequence with n, y, and n. Shall the new role be a superuser? n Shall the new role be allowed to create database? y Shall the new role be allowed to create more new roles? n<br />
<br />
Once you are finished answering these questions, type the word 'exit' to log out from PostgreSQL as the postgres superuser.<br />
<br />
You may want to edit your /etc/rc.conf file by adding postgresql to the Daemons list, so that PostgreSQL will automatically start up when you boot up your computer.<br />
<br />
This completes the installation and setup of PostgreSQL for use with Open ERP under Arch Linux. Additional detailed information about PostgreSQL configuration may be found on the Arch Wikipage for [[PostgreSQL]], and the [http://www.postgresql.org/docs/manuals/ PostgreSQL Manuals webpage]. Also, there is a powerful GUI PostgreSQL Admin tool, [http://www.pgadmin.org/ pgAdmin], which is available in the Arch repositories.<br />
<br />
=Installing Open ERP from AUR=<br />
<br />
Open ERP requires the installation of the Open ERP Server, Open ERP comes with a webserver so you can use your web browser to use it, or you cna use a Open ERP GTK-Client installed from AUR. Currently, Open ERP is not available in the main repositories of Arch Linux, but it is available through the Arch User Repository. Open ERP requires Python 2.7, various libraries compiled with Python 2.7, and a few other dependencies not found in the Arch repositories. All of these packages are provided through AUR. The best tool for downloading, compiling, and installing AUR packages is [[yaourt]]. The following instructions assume that yaourt has been installed and configured on the user's system.<br />
<br />
===install Open ERP===<br />
<br />
yaourt -S openerp<br />
<br />
===configure Open ERP===<br />
<br />
the configure file of Open ERP server is at /etc/openerp/openerp-server.conf. make it look like this:<br />
<br />
[options]<br />
; This is the password that allows database operations:<br />
; admin_passwd = admin<br />
db_host = localhost<br />
db_port = 5432<br />
db_user = yourusername ##this is username you created in postegres.<br />
db_password =<br />
<br />
=== start Open ERP server===<br />
<br />
use the command below to enable autostart openerp server when system boot:<br />
<br />
systemctl enable openerp-server.service<br />
<br />
use the command below to start openerp:<br />
<br />
systemctl start openerp-start.service<br />
<br />
=== login to Open ERP ===<br />
<br />
use your favorite web browser and go to link below:<br />
<br />
127.0.0.1:8069<br />
<br />
shows openerp login page.<br />
<br />
===Open ERP GTK-Client===<br />
<br />
To install the Open ERP standalone GTK-based client, from the CLI, execute the following command:<br />
<br />
yaourt -S openerp-client<br />
<br />
=Additional Open ERP Documentation=<br />
<br />
There are various sources of Open ERP documentation. The best place to start is the [http://doc.openerp.com/ Open ERP Documentation webpage]. This page links to different online documents, including [http://doc.openerp.com/install/index.html detailed installation instructions]. Additionally, there is an online copy of the book, [http://doc.openerp.com/book/index.html "Open ERP for Retail and Industrial Management"]. This copy is also available as a [http://www.openerp.com/en/buy/e-book.html PDF file]{{Linkrot|2011|09|06}}, and can be purchased in [http://www.openerp.com/buy.html?page=shop.product_details&flypage=openerp.tpl&product_id=36&category_id=8 hardcopy form from Open ERP]{{Linkrot|2011|09|06}} or from [http://www.amazon.com/Open-ERP-Retail-Industrial-Management/dp/2960087607/ Amazon.com]. While Open ERP documentation, such as "Open ERP for Retail and Industrial Management" is freely downloadable, it does not come with a free documentation license. Further details about this issue are found on the [http://doc.openerp.com/documentation_license.html Open ERP website]{{Linkrot|2011|09|06}}. Finally, [http://www.openerp.tv/ Open ERP TV] provides screencasts, some of which document various features and procedures of the software.<br />
<br />
=Open ERP Community=<br />
<br />
The Open ERP Community is centered upon the [http://openobject.com/ Open Object website]. Free technical support for Open ERP may be found in the [http://openobject.com/forum/index.php webforums], a [http://tiny.be/mailman/listinfo/tinyerp-users mailing list]{{Linkrot|2011|09|06}} which is linked to the webforums, an [http://openobject.com/irc/ IRC channel] on freenode.net, an [http://www.openobject.com/wiki/index.php/Main_Page Open ERP wiki], and the [http://doc.openerp.com/ Official ERP Documentation webpage.] The latest news may be found on [http://openerp.com/planet/ Open ERP Planet], while various Open ERP screencasts are provided on [http://www.openerp.tv/ Open ERP TV]. Fee-based support services are provided by [http://openerp.com/en/partners.html Open ERP Partners]{{Linkrot|2011|09|06}}.<br />
<br />
=Open Object RAD=<br />
<br />
Open Object is the Python-based [http://openobject.com/index.php?option=com_content&view=article&id=46&Itemid=53 Rapid Application Development framework] for developing Open ERP modules. It allows developers and businesses to customize Open ERP for specific needs. Open Object RAD development work is centered upon the [https://launchpad.net/openobject Open Object Launchpad page]. Developer news and blogs are published on [http://openobject.com/planet/ Open Object Planet]. There are pages for [http://www.openerp.com/index.php?option=com_content&view=article&id=18&Itemid=28 software downloads], [http://doc.openerp.com/modindex.html Open ERP module downloads]{{Linkrot|2011|09|06}}, and [http://openobject.com/index.php?option=com_content&view=article&id=53&Itemid=61 development source code downloads].</div>ChrisDennishttps://wiki.archlinux.org/index.php?title=Talk:Odoo&diff=245907Talk:Odoo2013-02-01T18:21:00Z<p>ChrisDennis: Suggestion for improvement re config file</p>
<hr />
<div>I'm not a postgresql expert (which is why I'm following these instructions), but the suggestion to change /var/lib/postgres/data/postgresql.conf to only listen on 127.0.0.1 seems wrong, when the default setting is to use 'localhost', which implies both 127.0.0.1 and ::1, (i.e. localhost on both IPv4 and IPv6).<br />
<br />
The instructions ought to say "make sure it's listening on the 'localhost' connection unless you know what you're doing and want to accept connections from elsewhere".<br />
<br />
[[User:ChrisDennis|ChrisDennis]] ([[User talk:ChrisDennis|talk]]) 18:21, 1 February 2013 (UTC)</div>ChrisDennishttps://wiki.archlinux.org/index.php?title=PostgreSQL&diff=238353PostgreSQL2012-12-04T16:02:43Z<p>ChrisDennis: Run systemd-tmpfiles instead of rebooting the whole system.</p>
<hr />
<div>[[Category:Database management systems]]<br />
[[Category:Web Server]]<br />
[[it:PostgreSQL]]<br />
[[ru:PostgreSQL]]<br />
[[zh-CN:PostgreSQL]]<br />
{{Poor writing|excessive use of lists, please use them only when there are items to list.}}<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 {{Pkg|postgresql}}<br />
# pacman -S postgresql<br />
Configure the PGROOT<br />
<br />
Edit the /etc/conf.d/postgresql (if you don't know what value to put just uncomment the line)<br />
<br />
Create the file tmpfiles.d for /run/postgresql:<br />
# systemd-tmpfiles --create postgresql.conf<br />
<br />
Create the data directory (acordingly with the PGROOT variable set before in the config file)<br />
# mkdir /var/lib/postgres/data<br />
Set /var/lib/postgres/data ownership to user 'postgres'<br />
# chown -c postgres:postgres /var/lib/postgres/data<br />
As user 'postgres' start the database<br />
$ initdb -D '/var/lib/postgres/data'<br />
Start PostgreSQL<br />
# systemctl start postgresql<br />
(Optional) Add PostgreSQL to the list of daemons that start on system startup<br />
# systemctl enable postgresql<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 />
{{hc|$ createuser -s -U postgres --interactive|<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 myDatabaseName<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 "-d" 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># 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># systemctl restart postgresql</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># systemctl restart httpd</pre><br />
<br />
==Change Default Data Dir (Optional)==<br />
The default directory where all your newly created databases will be stored is <code>/var/lib/postgres/data</code>. To change this, 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 -p ''/pathto/pgroot/data''<br />
chown -R postgres:postgres ''/pathto/pgroot''<br />
Become the postgres user(change to root, then postgres user), and initialize the new cluster:<br />
initdb -D ''/pathto/pgroot/data''<br />
Edit <code>/etc/conf.d/postgresql</code> and change the PGROOT variable(optionally PGLOG) to point to your new pgroot directory.<br />
#PGROOT="/var/lib/postgres/"<br />
PGROOT="''/pathto/pgroot/''"<br />
If using systemd, copy <code>/usr/lib/systemd/system/postgresql.service</code> to <code>/etc/systemd/system/postgresql.service</code> and change the default PGROOT path.<br />
#Environment=PGROOT=/var/lib/postgres/<br />
Environment=PGROOT=''/pathto/pgroot/''<br />
You will also need to change the default PIDFile path.<br />
PIDFile=''/pathto/pgroot/''data/postmaster.pid<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 />
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 />
Now we can drop it:<br />
DROP DATABASE template1;<br />
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 />
Now modify template1 so it is actually a template:<br />
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';<br />
(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 />
(this last step can create problems when upgrading via <code>pg_upgrade</code>)<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 />
[[Phppgadmin]] ([http://phppgadmin.sourceforge.net website]) 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 />
<br />
=== Quick Guide ===<br />
This is for upgrading from 9.1 to 9.2.<br />
<br />
sudo pacman -S --needed postgresql-old-upgrade<br />
sudo -u postgres mv /var/lib/postgres/data /var/lib/postgres/data-9.1<br />
sudo -u postgres mkdir /var/lib/postgres/data<br />
sudo -u postgres initdb -D /var/lib/postgres/data<br />
sudo -u postgres pg_upgrade \<br />
-b /opt/pgsql-9.1/bin/ \<br />
-B /usr/bin/ \<br />
-d /var/lib/postgres/data-9.1 \<br />
-D /var/lib/postgres/data<br />
<br />
If the "pg_upgrade" step fails with:<br />
* ''cannot write to log file pg_upgrade_internal.log<br /> Failure, exiting'' <br />Make sure you're in a directory that the "postgres" user has enough rights to write the log file to (<code>/tmp</code> for example). Or use "su - postgres" instead of "sudo -u postgres".<br />
* ''LC_COLLATE error that says that old and new values are different''<br />Figure out what the old locale was, C or en_US.UTF-8 for example, and force it when calling initdb.<br />
sudo -u postgres LC_ALL=C initdb -D /var/lib/postgres/data<br />
<br />
* ''There seems to be a postmaster servicing the old cluster.<br/>Please shutdown that postmaster and try again.''<br/>Make sure postgres isn't running. If you still get the error then chances are these an old PID file you need to clear out.<br />
> sudo -u postgres ls -l /var/lib/postgres/data-9.1<br />
total 88<br />
-rw------- 1 postgres postgres 4 Mar 25 2012 PG_VERSION<br />
drwx------ 8 postgres postgres 4096 Jul 17 00:36 base<br />
drwx------ 2 postgres postgres 4096 Jul 17 00:38 global<br />
drwx------ 2 postgres postgres 4096 Mar 25 2012 pg_clog<br />
-rw------- 1 postgres postgres 4476 Mar 25 2012 pg_hba.conf<br />
-rw------- 1 postgres postgres 1636 Mar 25 2012 pg_ident.conf<br />
drwx------ 4 postgres postgres 4096 Mar 25 2012 pg_multixact<br />
drwx------ 2 postgres postgres 4096 Jul 17 00:05 pg_notify<br />
drwx------ 2 postgres postgres 4096 Mar 25 2012 pg_serial<br />
drwx------ 2 postgres postgres 4096 Jul 17 00:53 pg_stat_tmp<br />
drwx------ 2 postgres postgres 4096 Mar 25 2012 pg_subtrans<br />
drwx------ 2 postgres postgres 4096 Mar 25 2012 pg_tblspc<br />
drwx------ 2 postgres postgres 4096 Mar 25 2012 pg_twophase<br />
drwx------ 3 postgres postgres 4096 Mar 25 2012 pg_xlog<br />
-rw------- 1 postgres postgres 19169 Mar 25 2012 postgresql.conf<br />
-rw------- 1 postgres postgres 48 Jul 17 00:05 postmaster.opts<br />
-rw------- 1 postgres postgres 80 Jul 17 00:05 postmaster.pid # <-- This is the problem<br />
<br />
> sudo -u postgres mv /var/lib/postgres/data-9.1/postmaster.pid /tmp<br />
* ''ERROR: could not access file "$libdir/postgis-2.0": No such file or directory'' <br> Retrieve postgis-2.0.so from postgis package for version postgresql 9.1 () and copy it to /opt/pgsql-9.1/lib (make sure the privileges are right)<br />
<br />
=== Detailed Instructions ===<br />
{{Warning|Official PostgreSQL [http://www.postgresql.org/docs/current/static/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 {{Pkg|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 -Syu postgresql postgresql-libs postgresql-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 />
# rc.d stop postgresql<br />
# su - postgres -c 'mv /var/lib/postgres/data /var/lib/postgres/olddata'<br />
# rc.d start postgresql<br />
# rc.d stop postgresql<br />
<br />
Reference the [http://www.postgresql.org/docs/current/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 />
# su - postgres -c 'pg_upgrade -d /var/lib/postgres/olddata/ -D /var/lib/postgres/data/ -b /opt/pgsql-8.4/bin/ -B /usr/bin/'<br />
<br />
You could also do something like this (after the upgrade and install of postgresql-old-upgrade)<br />
<br />
# rc.d stop postgresql<br />
# /opt/pgsql-8.4/bin/pg_ctl -D /var/lib/postgres/olddata/ start<br />
# pg_dumpall >> old_backup.sql<br />
# /opt/pgsql-8.4/bin/pg_ctl -D /var/lib/postgres/olddata/ stop<br />
# rc.d start postgresql<br />
# psql -f old_backup.sql postgres<br />
<br />
==Troubleshooting==<br />
<br />
===Improve performance of small transactions===<br />
<br />
If you are using PostgresSQL on a local machine for development and it seems slow, you could try turning [http://www.postgresql.org/docs/current/static/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT synchronous_commit off] in the configuration (<code>/var/lib/postgres/data/postgresql.conf</code>). Beware of the [http://www.postgresql.org/docs/current/static/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT caveats], however.<br />
<br />
<pre>synchronous_commit = off</pre><br />
<br />
===Prevent disk writes when idle===<br />
<br />
PostgreSQL periodically updates its internal "statistics" file. By default, this file is stored on disk, which prevents disks spinning down on laptops and causes hard drive seek noise. It's simple and safe to relocate this file to a memory-only file system with the following configuration option:<br />
<br />
<pre>stats_temp_directory = '/run/postgresql'</pre><br />
<br />
==See also==<br />
*[http://www.postgresql.org/ Official PostgreSQL Homepage]</div>ChrisDennis