Why can I create a table named " " ? - Mailing list pgsql-general

From Arjen van der Meijden
Subject Why can I create a table named " " ?
Date
Msg-id 000701c3add0$bf6620d0$3ac15e91@acm
Whole thread Raw
In response to Debian packages of 7.4  (Oliver Elphick <olly@lfix.co.uk>)
Responses Re: Why can I create a table named " " ?
List pgsql-general
Hi,

A colleague and I noticed that MySQL allows this:
CREATE TABLE ` ` ( ` ` INT NOT NULL );

A table with a space as its name and a space as a column name.
We were quite surprised by that and we tested it on postgresql at once
to see whether it was the only one to do so.

Now we were even more surprised that postgresql allows this aswell:
kb=# CREATE TABLE " " (" " int not null);
CREATE TABLE
kb=# \d " "
       Table "public. "
 Column |  Type   | Modifiers
--------+---------+-----------
        | integer | not null

Is this per spec, a bug or intended behaviour?

Best regards,

Arjen van der Meijden




pgsql-general by date:

Previous
From: Oliver Elphick
Date:
Subject: Debian packages of 7.4
Next
From: Peter Eisentraut
Date:
Subject: Re: Why can I create a table named " " ?