Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TKVHx-000503-N1 for pgsql-bugs@postgresql.org; Sat, 06 Oct 2012 14:23:33 +0000 Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TKVHt-00019a-1X for pgsql-bugs@postgresql.org; Sat, 06 Oct 2012 14:23:32 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TKVHo-0003zu-7M for pgsql-bugs@postgresql.org; Sat, 06 Oct 2012 14:23:25 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1TKVHn-0007tu-Nq for pgsql-bugs@postgresql.org; Sat, 06 Oct 2012 14:23:23 +0000 Date: Sat, 06 Oct 2012 14:23:23 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7587: createdb allows invalid DB names To: pgsql-bugs@postgresql.org From: foss@johnbradshaw.org X-Pg-Spam-Score: -4.0 (----) X-Archive-Number: 201210/44 X-Sequence-Number: 34344 The following bug has been logged on the website: Bug reference: 7587 Logged by: John Bradshaw Email address: foss@johnbradshaw.org PostgreSQL version: 9.1.6 Operating system: Ubuntu 12.04 LTS Description: = createdb allows illegal period/dot (".") in DB names. Can't ALTER DATABASE name in psql as it doesn't allow periods/dots in database names. Had to dropdb (which also allows dot in names) and recreate from dump. Would be nice if createdb checked for illegal characters in DB names. postgres@dev2:~$ psql -V psql (PostgreSQL) 9.1.6 contains support for command-line editing postgres@dev2:~$ sudo dpkg -l postgresql-9.1 Desired=3DUnknown/Install/Remove/Purge/Hold | Status=3DNot/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-p= end |/ Err?=3D(none)/Reinst-required (Status,Err: uppercase=3Dbad) ||/ Name Version = Description +++-=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D-= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D-=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D ii postgresql-9.1 9.1.6-0ubuntu12.04 = object-relational SQL database, version 9.1 server postgres@dev2:~$ createdb badname.sql postgres@dev2:~$ psql badname.sql psql (9.1.6) Type "help" for help. badname.sql=3D# alter DATABASE badname.sql RENAME TO to goodname; ERROR: syntax error at or near "." LINE 1: alter DATABASE badname.sql RENAME TO to goodname; ^ badname.sql=3D# \q postgres@dev2:~$ dropdb badname.sql