Problems invoking psql, was: Re: Troubles at Startup - Mailing list pgsql-admin

From Hugh Esco
Subject Problems invoking psql, was: Re: Troubles at Startup
Date
Msg-id 5.1.0.14.0.20021124105743.027ff220@petra.cagreens.org
Whole thread Raw
In response to Re: Troubles at Startup  (Oliver Elphick <olly@lfix.co.uk>)
Responses Re: Problems invoking psql, was: Re: Troubles at Startup
List pgsql-admin
Mr. Elphick:

OK.  Here is what I got.

>hesco@biko:~$ ls -al /usr/bin/psql
>lrwxrwxrwx    1 root     root           10 Oct 10 16:24 /usr/bin/psql ->
>pg_wrapper
>hesco@biko:~$ ls -al /usr/bin/pg_w*
>-rwxr-xr-x    1 root     root         6584 Sep 11 04:30 /usr/bin/pg_wrapper
>hesco@biko:~$ ls -al /usr/lib/postgresql/bin/psql
>-rwxr-xr-x    1 root     root         6584 Nov 21 20:57
>/usr/lib/postgresql/bin/psql

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.

then running top in a third shell shows me:
>   512 hesco     10   0   320  320   268 S     2.1  0.5   0:03 psql
>  1978 postgres  10   0   320  320   268 S     2.1  0.5   0:00 psql

when I Control-C each of those first two shells, the hard drive stops
spinning.
Then I do the following:
>postgres@biko:/home/hesco$ su
>Password:
>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)
>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.
>biko:/home/hesco#


I do not know what to make of these error messages:
>dpkg: conflicting diversions involving `/Package: mysql-common' or
>`/Status: ins
>tall ok installed'
>E: Sub-process /usr/bin/dpkg returned an error code (2)

-- Hugh Esco

At 06:37 PM 11/23/02 +0000, you wrote:
>On Sat, 2002-11-23 at 15:13, Hugh Esco wrote:
> > Problem solved!
> >
> > When using pg_ctl to make the postmaster see a pg_hba.conf file that had
> > been edited while the database server was running, I got a message that it
> > looked for, but did not find, the psql script in the
> > /usr/lib/postgresql/bin directory.  So I copied this file from /usr/bin
> > (where the apt-get install postgresql had installed it) to
> > /usr/lib/postgresql/bin.  And while I am still having trouble invoking a
> > psql command line prompt, I am now getting postmaster starting up
> > automatically at boot up, exactly as /etc/rc#.d says it should.
>
>I'm not surprised you're having trouble getting a command line, since
>you appear to have overwritten the real psql in
>/usr/lib/postgresql/bin/psql with the symbolic link /usr/bin/psql, which
>is a link to /usr/bin/pg_wrapper, which tries to call
>/usr/lib/postgresql/bin/psql.
>
>I also don't see how this can make any difference to how postmaster
>starts up, since postmaster does not use psql at all.
>
> > Is there some appropriate place I should report this problem to the folks
> > who build and maintain the Debian package for postgresql, so this matter
> > can be handled in future distributions?
>
>Debian bug reports in general go to bugs.debian.org.  The proper way to
>report them is to use reportbug (install the reportbug package).  Debian
>PostgreSQL bug reports will come to me, so you needn't bother in this
>particular case.
>
>You never did answer the question whether you could run
>/usr/lib/postgresql/bin/psql directly.
>
>psql is part of the postgresql-client package, not postgresql.  It seems
>to me you should reinstall postgresql-client, and then we can take
>another look at your situation.
>
>--
>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
>                  ========================================
>      "The LORD is nigh unto all them that call upon him, to
>       all that call upon him in truth."
>                                    Psalms 145:18


pgsql-admin by date:

Previous
From: Egon Reetz
Date:
Subject: Re: Dropping Foreign Key without recreating table
Next
From: Oliver Elphick
Date:
Subject: Re: Problems invoking psql, was: Re: Troubles at Startup