Re: [HACKERS] Database names with spaces - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Database names with spaces
Date
Msg-id 199910060308.XAA05984@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Database names with spaces  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Bruce Momjian <maillist@candle.pha.pa.us> writes:
> > Looks like a bug.  Added to TODO list.
> 
> >> I see a todo item
> >> * Views with spaces in view name fail when referenced
> >> 
> >> I have another one for you:
> >> * Databases with spaces in name fail to be created and destroyed despite
> >> responses to the contrary.
> 
> IIRC, createdb and destroydb use "cp -r" and "rm -r" respectively.
> Lack of careful quoting in the system calls is probably what's
> causing the problem here.
> 
> However, I wonder if it wouldn't be a better idea to forbid funny
> characters in things that will become Unix filenames.  In particular,
> something like CREATE DATABASE "../../../something" could have real
> bad consequences...

I just tried it:
test=> create database "../../pg_hba.conf"test-> \gERROR:  Unable to locate path '../../pg_hba.conf'        This may be
dueto a missing environment variable in the server
 

Seems we are safe.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Vince Vielhaber
Date:
Subject: libpq++ doc error?
Next
From: Roland Roberts
Date:
Subject: Re: [HACKERS] psql Week 1