Talk:PostgreSQL

From Gentoo Linux Wiki

Jump to: navigation, search

I think something's missing here, I needed it:

[copied from="http://gentoo-wiki.com/HOWTO_Install_project-open"] Now we should change the password for postgre, the username (that should have been) created by portage for working with postgreSQL. Code: Let's setup the postgre user

  1. passwd postgres //Choose the password for the user postgre

If you get the error:

passwd: Authentication token manipulation error

You need to add a line of code to /etc/shadow. Code: Let's edit /etc/shadow

  1. nano -w /etc/shadow

At the bottom add the following line of code

postgres:::::::: [/copied]


Comment from Anonymous

hi DouweQuerty,

1.) when I installed Postgresql as described in this howto I didn't have a DB called postgres so I always have to connect to template1 which is fine but not as outlined in the HOWTO

2.) In the paragraph: "Code: Database User creation" the line "# createuser -U postgres –P" either throws an error or does sth. not intended. You know why? Because the dash before the 'P' is weird (it looks different) and I think this is causing the error. When I use a normal dash before the P it works.

If you agree with me in these two points please fix it in the article.

Thanks for this awesome Howto though ;)+

Keep it up!


Thnxs ... It took me 1 week to write this howto because I was at war with mysql. But it always nice to hear it is/was helpful. For your first point ... There are a few things that get mixed up here. A database is a group in which you create/store your tables. Thus you can have a database called 'money' in which you store your financial data and a database called 'porn' in which you store URLS/pictures etc. But postgresql will not create a database called 'postgres' ... You have to create your own databases (as described in the howto). Then a template is an example for your database of how to create new databases. In a template extra procedures and standard tables are defined which are then copied to every database you create thereafter. Thus connecting to template1 isn't a good idea ! Now the 'postgres' I refer to and the Howto you copied refers to, is a System user like 'root' is a system user. The system user 'postgres' ownes the database deamons and jobs. This because that is more secure than running it all as root. PS postgres is also a database-user which doesn't be asked for its password too. Remember to run "createuser -U postgres –P" as root and make sure you have started postgres (/etc/init.d/postgresql start). If the command needs a password than recheck http://gentoo-wiki.com/PostgreSQL#Setting_Internal_Connections especially the line : local all postgres trust the -P in the command is there to enforce postgresql to ask you for a password, which is according to the manual of createuser (command 'man createuser') thus shouldn't be much of a problem. I am off for a couple of weeks because I am going on a holiday. Hopefully this will solve all your problems

DQ

Contents

[edit] Guide slightly out of date?

I ran into a couple problems when setting up PostgreSQL while following this guide. I tried to follow it fairly closely, but it is entirely possible I missed something.

The server wouldn't start up at first. If I ran postmaster by hand I got an error that server.crt was missing. Following the steps at http://www.postgresql.org/docs/8.1/static/ssl-tcp.html fixed things.

Once the server would start up, I didn't have a database to use when I tried the first login (psql -U postgres). I got around that and was able to test things by running psql -U postgres template1

Blarson 16:16, 29 August 2007 (UTC)

[edit] Quick Test not working

I have installed postgresql-8.0.13 following the How-To. But the quick test is failing :

# psql -U postgres

psql: FATAL: database "postgres" does not exist

I think something is missing in the How-To.

[edit] Set locale typo/error

quoted from article:

set up your LC_MESSAGE locale variable. You might use

  1. export LC_MESSAGES="en_EN.utf8"


results in:

FATAL: XX000: failed to initialize lc_messages to ""


solution: http://svr5.postgresql.org/pgsql-bugs/2005-06/msg00052.php

=

  1. export LC_MESSAGES="en_US.utf8"

(en_US instead of en_EN)

[edit] Shorten Intro?

I agree with 129.13.186.4's changes; the intro is too long. This page is already above the 32k limit and puts up a warning when you edit it. This should be a guide to get PostgreSQL up and running quickly... not an article on what Postgres is, how it works, and the history and purpose of SQL.

My $0.02

Blarson 15:25, 3 July 2008 (UTC)

I agree but I think it's better to split the article into subpages rather than removing important information. My proposal is the following structure:
* PostgreSQL - contains intro and sections "Closing Remarks", "See also", links to subpages "Install", "Usage" and "Virtual Mail System"
* PostgreSQL/Install - contains information on installing and configuring PostgreSQL (sections "Installation and Setup", "Upgrading Postgresql", "Troubleshooting")
* PostgreSQL/Usage - contains sections "Using Postgresql" and "Administrator Tools"
* PostgreSQL/Virtual Mail System - contains section "Virtual Mail System"
What do you think?
syslogd 15:36, 3 July 2008 (UTC)
I really like your suggestion and am all-for splitting the page up. I would recommend adding a Troubleshooting section as well.
Skimming through the article, there seems to be a lot of First-Person Perspective which we should remove. I think it would be easiest to do this after the article is split up though.
Syslogd, will you have time/interest in performing the split? Hopefully it will be a quick copy-paste job, and we can go from there.
Thanks!
Blarson 16:10, 3 July 2008 (UTC)
Ok, I've splitted it up. We should begin with improving the articles. The Gentoo PostgreSQL guide is very good though. Perhaps we can borrow some contents?
syslogd 21:06, 3 July 2008 (UTC)

[edit] Todo

This page contains a lot of useful information, but not enough: The article still requires information about:

  • Generating a certificate for your postgres server
  • Setting the default configfile location (/etc/init.d/?)
  • Generating the default tables and users

--syslogd 21:13, 3 July 2008 (UTC)