postgresql does not start

Bug #162517 reported by Wolf Rogner
4
Affects Status Importance Assigned to Milestone
postgresql-8.2 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: postgresql-8.2

uname -a
Linux s2 2.6.22-14-generic #1 SMP Sun Oct 14 21:45:15 GMT 2007 x86_64 GNU/Linux

apt-get install postgresql-8.2

installs the server but does not start it.

Directory /etc/postgres and configuration files missing

Any suggestions?

Revision history for this message
Thomas Babut (thbabut) wrote :

I am running Ubuntu 7.10 (i386) and postgresql-8.2 starts fine after installation.

Could you post the output of the installation process? And what packages are installed?

# sudo dpkg -l|grep postgres

Revision history for this message
Volker Paul (v.paul) wrote :

Maybe you need to run initdb.

Revision history for this message
Wolf Rogner (war-rsb) wrote :

sudo dpkg -l | grep postgres:

ii postgresql 8.2.5-1.1 object-relational SQL database (latest versi
ii postgresql-8.2 8.2.5-1.1 object-relational SQL database, version 8.2
ii postgresql-client-8.2 8.2.5-1.1 front-end programs for PostgreSQL 8.2
ii postgresql-client-common 78 manager for multiple PostgreSQL client versi
ii postgresql-common 78 manager for PostgreSQL database clusters
ii postgresql-doc 8.2.5-1.1 documentation for the PostgreSQL database ma
ii postgresql-doc-8.2 8.2.5-1.1 documentation for the PostgreSQL database ma
ii postgresql-plpython-8.2 8.2.5-1.1 PL/Python procedural language for PostgreSQL

running /usr/lib/postgresql/8.2/bin/initdb created the necessary files in the database file but not in /etc/postgres.

Starting postgres manually works now, but starting postgres at boot time still does not work.

Revision history for this message
Thomas Babut (thbabut) wrote :

Is there a symlink in the default runlevel?

# ls -l /etc/rc*.d/*postgres*

Have you also tried to remove and purge all postgresql packages and to install it again?

# apt-get remove --purge libpq5 postgresql postgresql-8.2 postgresql-client-8.2 postgresql-client-common postgresql-common postgresql-plpython-8.2
# apt-get install postgresql-8.2

Does after that the problem still exist?

Revision history for this message
Thomas Babut (thbabut) wrote :

Please notice that purging the postgresql packages all postgresql related configuration files and I think databases too will be deleted.

Revision history for this message
Thomas Babut (thbabut) wrote :

I cannot confirm this bug, so more informations are needed.

Changed in postgresql-8.2:
status: New → Incomplete
Revision history for this message
Wolf Rogner (war-rsb) wrote :

First: Thanks for the hints. I could start postgres and get webmin to show databases.
Re. your questions:

1. Yes there are symlinks in the rc?.d directories. They point to /etc/init.d/postgresql-8.2 (which exists)
2. Initially I have tried to remove and reinstall postgresql
3. I am going on from here (postgresql and addons installed) and try to fix the problem here

Question: Should postgres database should be launched after installing the package or is there some preconfiguration required (there is no documentation about this available)

Revision history for this message
Thomas Babut (thbabut) wrote :

1. Are there also symlinks beginning with the letter S? What makes you sure, that postgresql is not being started after boot?
2. Did you use remove with --purge and have you installed postgresql again?

To your Question: After installing postgresql the database should automatically get initialized and started. There is no preconfiguration required.

Revision history for this message
Wolf Rogner (war-rsb) wrote :

S19post.... in run level 2 .. 5 and K19post... in run level 1, 6

I did use purge when removing it.

What makes me sure postgres is not running?
If I launch postgres manually (su -c '/usr/lib/postgresql/8.2/bin/postgres -D /home/db' postgres) I see 3 databases up in webmin.
If I restart, or try to launch the database using /etc/init/postgresql-8.2 start nothing shows ("PostgreSQL is not running on your system - database list could not be retrieved")

To my question: If that should be the case then the package under x64 is broken. In order to run the database, configuration files have to be copied somewhere running the initdb first. The pg_hba.conf has to be manually configured to point to the db directory (which initdb creates in the same directory). Default values for this directory (/etc/postgresql) are set, but the corresponding directories are not created.

My problem now seems: How can I convince /etc/init.d/postgresql to start the database with the correct user (postgresql) and refer to the right directory (in my case /home/db).

Revision history for this message
Thomas Babut (thbabut) wrote :

After purging all postgresql packages you have installed postgresql again. What happens then? Does it work directly with the default configuration? If not, could you please post the output of the total installation process from apt-get?

Unfortunately I have no Ubuntu x64 installation at this moment.

Revision history for this message
Wolf Rogner (war-rsb) wrote :
Download full text (4.6 KiB)

root@s2:~# apt-get install postgresql postgresql-doc postgresql-plpython-8.2 Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  postgresql-8.2 postgresql-client-8.2 postgresql-client-common
  postgresql-common postgresql-doc-8.2
Suggested packages:
  oidentd ident-server
The following NEW packages will be installed:
  postgresql postgresql-8.2 postgresql-client-8.2 postgresql-client-common
  postgresql-common postgresql-doc postgresql-doc-8.2 postgresql-plpython-8.2
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/6492kB of archives.
After unpacking 27.5MB of additional disk space will be used.
Do you want to continue [Y/n]? y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "de_AT.utf8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
Preconfiguring packages ...
Selecting previously deselected package postgresql-client-common.
(Reading database ... 58191 files and directories currently installed.)
Unpacking postgresql-client-common (from .../postgresql-client-common_78_all.deb) ...
Selecting previously deselected package postgresql-client-8.2.
Unpacking postgresql-client-8.2 (from .../postgresql-client-8.2_8.2.5-1.1_amd64.deb) ...
Selecting previously deselected package postgresql-common.
Unpacking postgresql-common (from .../postgresql-common_78_all.deb) ...
Selecting previously deselected package postgresql-8.2.
Unpacking postgresql-8.2 (from .../postgresql-8.2_8.2.5-1.1_amd64.deb) ...
Selecting previously deselected package postgresql.
Unpacking postgresql (from .../postgresql_8.2.5-1.1_all.deb) ...
Selecting previously deselected package postgresql-doc-8.2.
Unpacking postgresql-doc-8.2 (from .../postgresql-doc-8.2_8.2.5-1.1_all.deb) ...
Selecting previously deselected package postgresql-doc.
Unpacking postgresql-doc (from .../postgresql-doc_8.2.5-1.1_all.deb) ...
Selecting previously deselected package postgresql-plpython-8.2.
Unpacking postgresql-plpython-8.2 (from .../postgresql-plpython-8.2_8.2.5-1.1_amd64.deb) ...
Setting up postgresql-client-common (78) ...
Setting up postgresql-client-8.2 (8.2.5-1.1) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "de_AT.utf8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Setting up postgresql-common (78) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "de_AT.utf8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
perl: warning...

Read more...

Revision history for this message
Thomas Babut (thbabut) wrote :

Please run as root:
# dpkg-reconfigure locales

Did you do a fresh install or an upgrade of your Ubuntu?

Revision history for this message
Wolf Rogner (war-rsb) wrote :

root@s2:~# dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "de_AT.utf8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales...
  en_US.UTF-8... up-to-date
Generation complete.

root@s2:~# locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME=de_AT.utf8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

You might find that all settings are en_US (as I use English as my default language) only the time locale is set to Austrian.

I did an update from 7.04 -> 7.10. (and just that you don't get any ideas: I have no intention of reinstalling Ubuntu on this server as it is productive ;-)

The problem lies in the way, /etc/init.d/progresql starts up. Starting the server manually works fine.

Revision history for this message
Wolf Rogner (war-rsb) wrote :

This is an excerpt from /usr/share/postgresql-common/init.d-functions:

do_ctl_all() {
    [ "$1" ] || { echo "Error: invalid command '$1'" >&2; exit 1; }
    [ "$2" ] || { echo "Error: invalid version '$2'" >&2; exit 1; }
    [ -d "/etc/postgresql/$2" ] || return 0
    [ "$(ls /etc/postgresql/$2)" ] || return 0
    [ -x "/usr/lib/postgresql/$2/bin/postmaster" ] || return 0

    status=0
    log_daemon_msg "$3"
    for c in /etc/postgresql/"$2"/*; do
        [ -e "$c/pgdata" ] || continue
        name=$(basename "$c")
    :
    :

As you can see, there is a check for the directory /etc/postgresql/8.x. This directory neither exists nor is it created during the installation process (as you can verify by looking into the archive.

If you install 8.2 plain, I doubt that it will get started regardless of i386 or x64 architecture (as both packages have similar postinst files).

Question: Where do I find information what needs to be in the directory /etc/postgresql ?

Revision history for this message
Wolf Rogner (war-rsb) wrote :

I downloaded the required files from postgresql.org. Take the source tar, extract the startup file and edit it to your needs. Here is mine

#! /bin/sh

# chkconfig: 2345 98 02
# description: PostgreSQL RDBMS

# This is an example of a start/stop script for SysV-style init, such
# as is used on Linux systems. You should edit some of the variables
# and maybe the 'echo' commands.
#
# Place this file at /etc/init.d/postgresql (or
# /etc/rc.d/init.d/postgresql) and make symlinks to
# /etc/rc.d/rc0.d/K02postgresql
# /etc/rc.d/rc1.d/K02postgresql
# /etc/rc.d/rc2.d/K02postgresql
# /etc/rc.d/rc3.d/S98postgresql
# /etc/rc.d/rc4.d/S98postgresql
# /etc/rc.d/rc5.d/S98postgresql
# Or, if you have chkconfig, simply:
# chkconfig --add postgresql
#
# Proper init scripts on Linux systems normally require setting lock
# and pid files under /var/run as well as reacting to network
# settings, so you should treat this with care.

# Original author: Ryan Kirkpatrick <email address hidden>

# $PostgreSQL: pgsql/contrib/start-scripts/linux,v 1.8 2006/07/13 14:44:33 petere Exp $

## EDIT FROM HERE

# Installation prefix
prefix="/usr/lib/postgresql/8.2"

# Data directory
PGDATA="/home/db"

# Who to run the postmaster as, usually "postgres". (NOT "root")
PGUSER=postgres

# Where to keep a log file
PGLOG="$PGDATA/serverlog"

## STOP EDITING HERE

# The path that is to be used for the script
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# What to use to start up the postmaster (we do NOT use pg_ctl for this,
# as it adds no value and can cause the postmaster to misrecognize a stale
# lock file)
DAEMON="$prefix/bin/postgres"

# What to use to shut down the postmaster
PGCTL="$prefix/bin/pg_ctl"

set -e

# Only start if we can find the postmaster.
test -x $DAEMON || exit 0

# Parse command line parameters.
case $1 in
  start)
 echo -n "Starting PostgreSQL: "
 su - $PGUSER -c "$DAEMON -D '$PGDATA' &" >>$PGLOG 2>&1
 echo "ok"
 ;;
  stop)
 echo -n "Stopping PostgreSQL: "
 su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast"
 echo "ok"
 ;;
  restart)
 echo -n "Restarting PostgreSQL: "
 su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast -w"
 su - $PGUSER -c "$DAEMON -D '$PGDATA' &" >>$PGLOG 2>&1
 echo "ok"
 ;;
  reload)
        echo -n "Reload PostgreSQL: "
        su - $PGUSER -c "$PGCTL reload -D '$PGDATA' -s"
        echo "ok"
        ;;
  status)
 su - $PGUSER -c "$PGCTL status -D '$PGDATA'"
 ;;
  *)
 # Print help
 echo "Usage: $0 {start|stop|restart|reload|status}" 1>&2
 exit 1
 ;;
esac

exit 0

Now it works

Revision history for this message
Martin Pitt (pitti) wrote :

Apparently you set a default locale in /etc/environment or somewhere else which does not exist. Please create it (with sudo locale-gen en_US.UTF-8) and then reinstall postgresql or use pg_createcluster.

Please note that directories manually created with initdb cannot be handled through the default init scripts. You should use pg_createcluster (see manpage).

Changed in postgresql-8.2:
status: Incomplete → Invalid
Revision history for this message
Wolf Rogner (war-rsb) wrote :

Martin, I appreciate your effort to help me but I am afraid you are missing the point here. Locales have nothing to do with startup scripts.

I analyzed the deb package and especially the installation files. I did the same with the standard installation files from postgres.org.

There is one file missing that I cited above. This is an error in the installation routine.

It might have been there in previous versions and provides the startup after upgrade. But if you install fresh, it is not there. So there is no automatic startup of the database.

Postgres can be started manually and maybe people are happy with it. I am not. I want 100%.

As I stated: copy the file above into /etc/init.d and the problem is solved.

If someone would update the installation package, it would be solved permanently. This is the only solution possible. And its simple.

As to your comment about the locals:

Locals are set correctly, however I use an English system with a German keyboard. The result is ugly error messages. This is a different issue.

Wolf

Revision history for this message
Martin Pitt (pitti) wrote :

The startup scripts are fine. /etc/init.d/postgresql-8.2 exists, and it duefully will start all 8.2 instances that you created with pg_createcluster. The script you mention is from upstream; you can use and customize it if you don't want to use the Debian/Ubuntu packaging, but if you do that then you cannot complain about the Ubuntu scripts not dealing with your custom setup.

The root cause is that when you installed postgresql-8.2 the first time, the default locale did not exist and thus the package maintainer script could not create the initial default instance for 8.2 (called 'main', configuration in /etc/postgresql/8.2/main/).

So you have two options:

 * Ignore the Ubuntu packacking and continue using your custom configuration (but then you loose all the tools like pg_upgradecluster for automatic upgrading).

 * Dump your custom database, and revert to the distribution scripts, to retain distro support and tools. To do that I would recommend the following steps:

   - pg_dumpall your current db
   - Purge postgresql-8.2 (removal is NOT sufficient): sudo apt-get remove --purge postgresql-8.2
   - Remove all scripts you installed manually, like /etc/init.d/postgresql, the data directory, etc.
   - sudo apt-get install postgresql-8.2
   - sudo -u postgres -i # to get a shell as the PostgreSQL superuser
   - feed back your dump: psql template1 -f dump.sql

Revision history for this message
Martin Pitt (pitti) wrote :

Oh, Wolf, and please fix your locales first. Seems that en_US.UTF-8 is still invalid. Please do

  sudo locale-gen en_US.UTF-8

Otherwise it will fail again.

Revision history for this message
Wolf Rogner (war-rsb) wrote :

How can we procede if I try the things you suggest and the startup script is still missing.

I went back to locale en_US.UTF-8 (this cripples my Thunderbird and OpenOffice time display)
I removed and purged postgres (well I moved the files to a save place) and reinstalled.
I would be happy if after a reboot postgres was here. It does not start as the directory /etc/postgres/8.2 is ... not there.

Did you test it on 64 or 32 bit (as on 32 the required files are installed)?

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 162517] Re: postgresql does not start

> I went back to locale en_US.UTF-8 (this cripples my Thunderbird and OpenOffice time display)

That would be weird, since we only support UTF-8 locales, and everyone
else is using OO.o and Thunderbird with Unicode, too. Anyway, if you
prefer to use ISO-8859, you can create that as well (sudo locale-gen en_US)
and set en_US as default locale instead of en_US.UTF-8
(/etc/environment, LANG=en_US).

> I would be happy if after a reboot postgres was here. It does not
> start as the directory /etc/postgres/8.2 is ... not there.

Can you please cut&paste the exact commands you used and their output?
(I guess 'postgres' is just a typo in the bug mail, it should be
'postgresql').

> Did you test it on 64 or 32 bit (as on 32 the required files are
> installed)?

I am usually on 64 bit, but it shouldn't make a difference.
postgresql-common is architecture independent (written in Perl).

Revision history for this message
Wolf Rogner (war-rsb) wrote :

I think we are back to square one and it leads us nowhere.

Sorry that you wont take the lead.

My conclusion: Problem is not related to locales and problem occures because of crippled package (missing installation files).

Close the incident and thanks for your efforts.

Wolf

Revision history for this message
Martin Pitt (pitti) wrote :

Wolf, I am willing to get to the cause of the problem, but I need the copy&paste of the command outputs:

  sudo apt-get remove --purge postgresql-8.2
  sudo rm -r /etc/postgresql /var/lib/postgresql
  sudo apt-get install postgresql-8.2

(Please do backups before if you have something important.)

Reopening bug.

Revision history for this message
Wolf Rogner (war-rsb) wrote :
Download full text (4.9 KiB)

root@s2:/etc/init.d# apt-get remove --purge postgresql-8.2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  postgresql-common postgresql-client-8.2 postgresql-client-common
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  postgresql-8.2* postgresql-plpython-8.2*
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 12.7MB disk space will be freed.
Do you want to continue [Y/n]? y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "de_AT.utf8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 59525 files and directories currently installed.)
Removing postgresql-plpython-8.2 ...
Removing postgresql-8.2 ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "de_AT.utf8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Purging configuration files for postgresql-8.2 ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "de_AT.utf8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
root@s2:/etc/init.d# rm -r /etc/postgresql /var/lib/postgresql
rm: cannot remove `/etc/postgresql': No such file or directory
root@s2:/etc/init.d# rm -r /var/lib/postgresql
rm: cannot remove `/var/lib/postgresql': No such file or directory
root@s2:/etc/init.d# apt-get install postgresql-8.2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  oidentd ident-server
The following NEW packages will be installed:
  postgresql-8.2
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/3372kB of archives.
After unpacking 12.4MB of additional disk space will be used.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "de_AT.utf8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously deselected package postgresql-8.2.
(Reading database ... 59446 files and directories currently installed.)
Unpacking postgresql-8.2 (from .../postgresql-8.2_8.2.6-0ubuntu0.7.10.1_amd64.deb) ...
Setting up postgresql-8.2 (8.2.6-0ubuntu0.7.10.1) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings...

Read more...

Revision history for this message
Wolf Rogner (war-rsb) wrote :

If I replace your init script with mine it works quite fine.

rroot@s2:/etc/init.d# ./postgresql-8.2 status
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "de_AT.utf8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Version Cluster Port Status Owner Data directory Log file
root@s2:/etc/init.d# mv postgresql-8.2 postgresql-8.2_original
root@s2:/etc/init.d# mv postgresql-8.2_war postgresql-8.2
root@s2:/etc/init.d# ./postgresql-8.2
Usage: ./postgresql-8.2 {start|stop|restart|reload|status}
root@s2:/etc/init.d# ./postgresql-8.2 stop
Stopping PostgreSQL: No directory, logging in with HOME=/
server stopped
ok

Revision history for this message
Wolf Rogner (war-rsb) wrote :

Finally:

doing a
pg_createcluster 8.2 main --start

started the database !!!

So it can be done, but not with the init script in /etc/init.d

Please fix it

Revision history for this message
Martin Pitt (pitti) wrote :

Hi,

Wolf Rogner [2008-01-22 20:23 -0000]:
> Selecting previously deselected package postgresql-8.2.
> (Reading database ... 59446 files and directories currently installed.)
> Unpacking postgresql-8.2 (from .../postgresql-8.2_8.2.6-0ubuntu0.7.10.1_amd64.deb) ...
> Setting up postgresql-8.2 (8.2.6-0ubuntu0.7.10.1) ...
> perl: warning: Setting locale failed.
> perl: warning: Please check that your locale settings:
> LANGUAGE = (unset),
> LC_ALL = (unset),
> LC_TIME = "de_AT.utf8",
> LANG = "en_US.UTF-8"
> are supported and installed on your system.
> perl: warning: Falling back to the standard locale ("C").
> Error: The locale requested by the environment is invalid.
> Error: could not create default cluster. Please create it manually with

This is exactly what I mentioned above: Your locales are invalid. If
you do

  sudo locale-gen de_AT.UTF-8 en_US.UTF-8

it will work fine. The scripts deliberately don't create a DB with a
broken locale, since this would lead to wrong collation and string
operations.

 status invalid

Revision history for this message
Wolf Rogner (war-rsb) wrote :

How do I have to put it:

create_db works fine. The database gets created
pg_createcluster works fine and even starts (magically as I have not read the code) the database server
it is the init script that checks for a nonexistent directory

only postgresql_common is created.

If you insist that locales are the fault, how could I possibly have created a database and even used it from OpenOffice.
The locales have NOTHING whatsoever to do with it.

btw: I even tried the sudo locale-gen as you suggested. Remove Postgresql, install Postgresql same nonexistent directory and broken startup script.

I get the feeling that you prefer spending time discussing instead of fixing.
Read my blog on this: http://wolfs-ubuntu.blogspot.com/2007/11/installing-postgresql-82-on-710-server.html

Revision history for this message
Martin Pitt (pitti) wrote :

Wolf Rogner [2008-01-23 19:38 -0000]:
> I get the feeling that you prefer spending time discussing instead
> of fixing.

No, I don't. I spent a hell of a lot of time to make the locale
handling in Postgresql work right. Without working locales, collation
and string comparisons will fail, and the client libs will return
strings which have an invalid encoding. I am not going to deliberately
break postgresql to create DB instances which have nonobvious bugs in
it.

http://www.postgresql.org/docs/8.2/interactive/locale.html
http://www.postgresql.org/docs/8.2/interactive/multibyte.html

> Read my blog on this:
> http://wolfs-ubuntu.blogspot.com/2007/11/installing-postgresql-82-on-710-server.html

That's FUD. We live in a free world, so I won't stop you from doing
whatever blogs you want, or configuring your local psql installation
however you want. If you don't need non-ASCII characters, that's fine.

But don't insist that the PostgreSQL packages are broken without even
listening to my explanation. Your system is broken (it sets LANG and
LC_* to invalid values), the PostgreSQL packages clearly tell you
about the condition. If you ignore it, that's fine. Calling it a bug
is not justified.

Revision history for this message
Wolf Rogner (war-rsb) wrote :

Don't know what FUD is.

I can create databases using different character sets manually.

However your argument about collation sequences and string handling got me thinking again.

Tried to repeat the sequence you suggested step by step (without thinking this time).
Sure enough, postgresql installed and started.
Tried to understand what I did wrong (I administer my machine using webmin. So setting all locales during the installation process was not required. webmin covers most locale handling). Hope I did.

So:

1. I am sorry
2. you were right
3. I was wrong
4. I'll change my blog accordingly
5. Thank you for patience and even putting up with my bad temper

6. (I dare not say it) how can I change the location of my database :-?

Revision history for this message
Martin Pitt (pitti) wrote :

Hi Wolf,

Wolf Rogner [2008-01-24 20:46 -0000]:
> Tried to understand what I did wrong (I administer my machine using
> webmin. So setting all locales during the installation process was
> not required. webmin covers most locale handling). Hope I did.

If you changed the locales in webmin, then webmin apparently has a bug
that it does not actually create the locales you set.

> 5. Thank you for patience and even putting up with my bad temper

Sorry in return for becoming a bit rude in my previous reply.

> 6. (I dare not say it) how can I change the location of my database :-?

On cluster creation: pg_createcluster -d /path/to/data/dir (see
manpage).

On already existing clusters:
 - stop the db (init script or pg_ctlcluster)
 - move /var/lib/postgresql/8.2/main to whereever you want
 - do either of (whichever you like more):
   * change the /etc/postgresql/8.2/main/pgdata symlink to the new
     location
   * set data_directory in /etc/postgresql/8.2/main/postgresql.conf
     and remove above symlink [1]

Martin

[1] I know that removal of the symlink should not be necessary, the
config file option should trump the pgdata symlink. This is fixed in
the current versions in Hardy.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.