Re: psql -l gives bad output - Mailing list pgsql-general

From Ron Snyder
Subject Re: psql -l gives bad output
Date
Msg-id F888C30C3021D411B9DA00B0D0209BE803BB99EC@cvo-exchange.cvo.roguewave.com
Whole thread Raw
In response to psql -l gives bad output  (Jeff Beck <jeff.beck@mssm.edu>)
Responses Re: psql -l gives bad output
List pgsql-general
> ---------------------------------+----------
>  pay                             | postgres
>  pay-test                        | postgres
>  pay-test
> /usr/local/pgsql/bi | postgres
It looks to me like this 'second paytest' database is actually named
'pay-test\n/usr/local/pgsql/bi' , possibly created by trying to create a
database without having a closing quote:
User# createdb 'pay-test

(and then beginning to type some /usr/local/pgsql/bin command.)

The command dropdb doesn't seem (at least for me) to work the exact same
way, so the only way I could recover is the following:

(First create the problem)
bash-2.05$ createdb 'blah
> this is a test'
CREATE DATABASE
bash-2.05$ psql -l
       List of databases
        Name         |  Owner
---------------------+----------
 blah
this is a test | pg721tmp
 quickview           | pg721tmp
 template0           | pg721tmp
 template1           | pg721tmp
(4 rows)

template1=# update pg_database set datname='foo' where datname like 'blah%';
UPDATE 1

bash-2.05$ psql -l
  List of databases
   Name    |  Owner
-----------+----------
 foo       | pg721tmp
 quickview | pg721tmp
 template0 | pg721tmp
 template1 | pg721tmp
(4 rows)




-ron



pgsql-general by date:

Previous
From: Roberto Andrade Fonseca
Date:
Subject: Pgsql and the MARC standards
Next
From: Tom Lane
Date:
Subject: Re: psql -l gives bad output