Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 5FEB5475B84 for ; Sun, 24 Nov 2002 17:41:08 -0500 (EST) Received: from anchor-post-39.mail.demon.net (anchor-post-39.mail.demon.net [194.217.242.80]) by postgresql.org (Postfix) with ESMTP id AC3CA475AEC for ; Sun, 24 Nov 2002 17:41:07 -0500 (EST) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-39.mail.demon.net with esmtp (Exim 3.36 #2) id 18G5R6-0007TN-0U; Sun, 24 Nov 2002 22:41:08 +0000 Received: from localhost ([127.0.0.1] ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.36 #1 (Debian)) id 18G5R3-0000ZN-00; Sun, 24 Nov 2002 22:41:05 +0000 Subject: Re: Problems invoking psql, was: Re: Troubles at Startup From: Oliver Elphick To: Hugh Esco Cc: pgsql-admin@postgresql.org In-Reply-To: <5.1.0.14.0.20021124105743.027ff220@petra.cagreens.org> References: <5.1.0.14.0.20021123100543.033c7ec0@petra.cagreens.org> <5.1.0.14.0.20021123100543.033c7ec0@petra.cagreens.org> <5.1.0.14.0.20021124105743.027ff220@petra.cagreens.org> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1038177665.740.20.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 Date: 24 Nov 2002 22:41:05 +0000 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/237 X-Sequence-Number: 6425 On Sun, 2002-11-24 at 16:18, Hugh Esco wrote: > So it appears that instead of copying the symbolic link, it copied instead > pg_wrapper, renaming it in the new directory as psql. > > >hesco@biko:~$ /usr/lib/postgresql/bin/psql -U hesco template1 > > hangs, and spins the hard drive interminably. > So I open a second shell and do: > >hesco@biko:~$ su postgres > >Password: > >postgres@biko:/home/hesco$ /usr/lib/postgresql/bin/psql > >No database specified > >postgres@biko:/home/hesco$ /usr/lib/postgresql/bin/psql template1 > > > and that invocation also hangs, and spins the hard drive interminably. > Presumably it will try to call itself recursively. Since it does an exec, each successive process will replace the one before. ... > >biko:/home/hesco# apt-get remove postgresql-client > >Reading Package Lists... Done > >Building Dependency Tree... Done > >The following packages will be REMOVED: > > postgresql postgresql-client > >0 packages upgraded, 0 newly installed, 2 to remove and 0 not upgraded. > >Need to get 0B of archives. After unpacking 4530kB will be freed. > >Do you want to continue? [Y/n] y > >dpkg: conflicting diversions involving `/Package: mysql-common' or > >`/Status: ins > >tall ok installed' > >E: Sub-process /usr/bin/dpkg returned an error code (2) I don't know what that's about; you probably have some package installed that depends on either mysql or postgresql in some way, but I don't know of any file diversions involving postgresql packages. What have you got in /var/lib/dpkg/diversions? > >biko:/home/hesco# apt-get install postgresql-client > >Reading Package Lists... Done > >Building Dependency Tree... Done > >Sorry, postgresql-client is already the newest version. > >0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded. You need to use the --reinstall option if the package is up to date: apt-get --reinstall install postgresql-client Then check the contents of /usr/lib/postgresql/bin. You should have the following real executable files, which are installed by postgresql-client: /usr/lib/postgresql/bin/readpgenv /usr/lib/postgresql/bin/psql /usr/lib/postgresql/bin/createuser /usr/lib/postgresql/bin/createdb /usr/lib/postgresql/bin/dropuser /usr/lib/postgresql/bin/dropdb /usr/lib/postgresql/bin/pg_dump /usr/lib/postgresql/bin/pg_restore You should be able to do the following as user postgres: $ /usr/bin/psql -d template1 or $ /usr/lib/postgresql/bin/psql -d template1 and get a connection in both cases. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "Jesus saith unto him, I am the way, the truth, and the life; no man cometh unto the Father, but by me." John 14:6