minor issue with psql keeping connections - Mailing list pgsql-bugs

From Robert Treat
Subject minor issue with psql keeping connections
Date
Msg-id 200410311016.08924.xzilla@users.sourceforge.net
Whole thread Raw
Responses Re: minor issue with psql keeping connections
List pgsql-bugs
pgsql running on port 5480, connect to template1 as non-superuser "phppgadmin"
who does not have createdb privileges. attempt to run a script that creates a
database "phppgadmin" and then do a \connect to that database.   this fails
(as it should) but when it does, it loses the connection to template1, and i
am not able to reconnect to any database, i think because it is looking on
port 5432 rather than the 5480 i specified when i originally connected.

postgres@phppgadmin:/usr/local/pgsql-8.0.0beta-4/bin$ ./psql -p5480 template1
-U phppgadmin
Welcome to psql 8.0.0beta4, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

template1=> select version();
                              version
--------------------------------------------------------------------
 PostgreSQL 8.0.0beta4 on i586-pc-linux-gnu, compiled by GCC 2.95.3
(1 row)

template1=> \i /usr/local/apache/htdocs/phppgadmin3cvs/sql/reports-pgsql.sql
ERROR:  permission denied to create database
psql:/usr/local/apache/htdocs/phppgadmin3cvs/sql/reports-pgsql.sql:7: ERROR:
permission denied to create database
FATAL:  database "phppgadmin" does not exist
psql:/usr/local/apache/htdocs/phppgadmin3cvs/sql/reports-pgsql.sql:9:
\connect: FATAL:  database "phppgadmin" does not exist
!> \c template1
could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
!>
!>

relativily minor issue, but seems like it should either be able to retain the
connection when inside the script, or recall that it needs to connect on 5480
after failure.

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

pgsql-bugs by date:

Previous
From: Markus Bertheau
Date:
Subject: Re: Not a real bug, but an error
Next
From: Robert Treat
Date:
Subject: Re: minor issue with psql keeping connections