Difference between revisions of "Talk:PostgreSQL"

From ArchWiki
Jump to: navigation, search
(Installing PostgreSQL -> reboot not necessary)
(5 intermediate revisions by 3 users not shown)
Line 22: Line 22:
  
 
Is this section still necessary?  I am just learning, but did a "show client_encoding" on template1 and it returns UTF8 out of the box. --[[User:Nitmd|Nitmd]] 11:55, 18 September 2010 (CDT)
 
Is this section still necessary?  I am just learning, but did a "show client_encoding" on template1 and it returns UTF8 out of the box. --[[User:Nitmd|Nitmd]] 11:55, 18 September 2010 (CDT)
 +
 +
I think it's still necessary (and thank you for making this section). Just removed "vacuum freeze", since it's no longer recommended and the command will be obsolete in future releases of postgresql. BTW: I ran into a problem with the statement to disallow connections to the template1 database. This is because I wanted to build a new database named "postgres". After dropping the postgresql db, creating a new template1 and disallowing the connections to template1, I had no database to connect to, so I couldn't create a new database. Had to delete the data dir and start over.[[User:Tankgrun|Tankgrun]] 10:07, 12 August 2011 (EDT)
 +
 +
== Better systemd support ==
 +
 +
The wiki is out dated and the package will most certainly not work with systemd without tinkering with the service files. This article needs a re-write. --Newonelectron
 +
 +
== Installing PostgreSQL -> reboot not necessary ==
 +
 +
"Reboot the system to automatically create the file tmpfiles.d for /run/postgresql". I believe "systemd-tmpfiles --create" is enough to create /run/postfix without reboot. But I'm not confident enough to change it without asking first :).
 +
--[[User:Hiciu|Hiciu]] ([[User talk:Hiciu|talk]]) 13:35, 26 November 2012 (UTC)
 +
 +
edit: well, I was wrong. "systemd-tmpfiles --create" creates /run/postgresql, but it also (at least for me) breaks sudo so reboot is necessary anyway (sudo, after asking for password, returns "System is booting up."). --[[User:Hiciu|Hiciu]] ([[User talk:Hiciu|talk]]) 13:46, 26 November 2012 (UTC)
 +
 +
edit: correct command is "sudo systemd-tmpfiles --create /usr/lib/tmpfiles.d/postgresql.conf" --[[User:Hiciu|Hiciu]] ([[User talk:Hiciu|talk]]) 14:01, 26 November 2012 (UTC)

Revision as of 14:01, 26 November 2012

Updated this wiki to make it more clear and up-to-date. -- Evanlec

Problem with installation

I tried to install postgresql with the wiki, but i found this problem: pg_ctl: PID file "/var/lib/postgres/data/postmaster.pid" does not exist Is server running?

I searched the forums and I found out that an instruction was missed to do:

$ initdb -D /var/lib/postgres/data/

I Hope this helps for this wiki


UTF-8

Added instructions on how to create new databases as unicode by default. This seems relevant as the default "encoding" SQL_ASCII is pretty useless for most people. --Cabrilo 06:15, 11 January 2010 (EST)

Is step 4 correct? Elipsion 08:15, 13 January 2010 (EST)

  • Good catch. Obviously it wasn't, datistemplate should've been set to TRUE for that database. Thanks for noticing it, I fixed it. --Cabrilo 12:00, 13 January 2010 (EST)

Is this section still necessary? I am just learning, but did a "show client_encoding" on template1 and it returns UTF8 out of the box. --Nitmd 11:55, 18 September 2010 (CDT)

I think it's still necessary (and thank you for making this section). Just removed "vacuum freeze", since it's no longer recommended and the command will be obsolete in future releases of postgresql. BTW: I ran into a problem with the statement to disallow connections to the template1 database. This is because I wanted to build a new database named "postgres". After dropping the postgresql db, creating a new template1 and disallowing the connections to template1, I had no database to connect to, so I couldn't create a new database. Had to delete the data dir and start over.Tankgrun 10:07, 12 August 2011 (EDT)

Better systemd support

The wiki is out dated and the package will most certainly not work with systemd without tinkering with the service files. This article needs a re-write. --Newonelectron

Installing PostgreSQL -> reboot not necessary

"Reboot the system to automatically create the file tmpfiles.d for /run/postgresql". I believe "systemd-tmpfiles --create" is enough to create /run/postfix without reboot. But I'm not confident enough to change it without asking first :). --Hiciu (talk) 13:35, 26 November 2012 (UTC)

edit: well, I was wrong. "systemd-tmpfiles --create" creates /run/postgresql, but it also (at least for me) breaks sudo so reboot is necessary anyway (sudo, after asking for password, returns "System is booting up."). --Hiciu (talk) 13:46, 26 November 2012 (UTC)

edit: correct command is "sudo systemd-tmpfiles --create /usr/lib/tmpfiles.d/postgresql.conf" --Hiciu (talk) 14:01, 26 November 2012 (UTC)