Re: psql -l gives bad output

From: Ron Snyder <snyder(at)roguewave(dot)com>
To: 'Tom Lane' <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 'Jeff Beck' <jeff(dot)beck(at)mssm(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: psql -l gives bad output
Date: 2002-05-22 05:07:58
Message-ID: F888C30C3021D411B9DA00B0D0209BE803BB99ED@cvo-exchange.cvo.roguewave.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > The command dropdb doesn't seem (at least for me) to work
> the exact same
> > way,
>
> It works for me in current sources:

Current from cvs, or current 7.2.1?
bash-2.05$ createdb `ab
> cd
bash-2.05$ createdb 'ab
> cd'
CREATE DATABASE
bash-2.05$ dropdb 'ab
> cd'
ERROR: DROP DATABASE: database "ab cd" does not exist
dropdb: database removal failed
bash-2.05$ psql template1 -c 'select version();'
version
-------------------------------------------------------------
PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.96
(1 row)
bash-2.05$ which psql dropdb
/usr/local/pgsql-7.2.1/bin/psql
/usr/local/pgsql-7.2.1/bin/dropdb

It's definitely not a problem for me, but it does seem odd that it works for
you and not for me. (I suppose since all I'm doing is sitting here sort of
watching nypd blue, I'll see if I can figure it out.) :)

-ron

>
> $ createdb 'ab
> > cd'
> CREATE DATABASE
> $ psql -l
> List of databases
> Name | Owner | Encoding
> ------------+----------+-----------
> ab
> cd | postgres | SQL_ASCII
> regression | postgres | SQL_ASCII
> template0 | postgres | SQL_ASCII
> template1 | postgres | SQL_ASCII
> (4 rows)
>
> $ dropdb 'ab
> > cd'
> DROP DATABASE
> $ psql -l
> List of databases
> Name | Owner | Encoding
> ------------+----------+-----------
> regression | postgres | SQL_ASCII
> template0 | postgres | SQL_ASCII
> template1 | postgres | SQL_ASCII
> (3 rows)
>
>
> But I recall a number of rounds of bug-fixes concerning quoting in
> the pgsql shell scripts, so I'd not be surprised in the least to hear
> that pre-7.2 PG releases get this wrong. Or for that matter, we might
> still have some problems in this line on some platforms with oddball
> shells. If you find that dropdb messes up with weird names in 7.2,
> please send details about the test case and your platform...
>
> regards, tom lane
>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Snyder 2002-05-22 05:48:29 Re: psql -l gives bad output
Previous Message Tom Lane 2002-05-22 04:56:59 Re: psql -l gives bad output