Search Postgresql Archives

Re: Mysterious empty database name?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Excerpts from Azlin Rahim's message of mar may 25 18:23:13 -0400 2010:
> In our database list, there is one 'mysterious' database with a blank name.
> We don't know how it got there.

Maybe somebody SQL-injected you and created it.

> Below is the output of pg_database. Does anyone have any idea why this is
> happening? Any way to remove the 'mysterious' database safely.

I'd investigate a bit more what's inside, before deleting it.  Maybe the
name has only whitespace or control chars.  You can use double quotes to
refer to such names.  For example, this is a name a space and a
backspace:

 =# create database " ^?";
CREATE DATABASE


You can see the ASCII chars that make up the name with something like this:

 =# select datname, ascii(substring(datname, generate_series(1, length(datname)), 1)) from pg_database;

  \x7F      |    32
  \x7F      |   127

Now if somebody messed with an Unicode control char, I don't know what
to tell you.

-- 
Álvaro Herrera <alvherre@xxxxxxxxxxxxxxxxx>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux