Why can I create a table named " " ?

From: "Arjen van der Meijden" <acmmailing(at)vulcanus(dot)its(dot)tudelft(dot)nl>
To: "'PostgreSQL general list'" <pgsql-general(at)postgresql(dot)org>
Cc: <drm(at)tweakers(dot)net>
Subject: Why can I create a table named " " ?
Date: 2003-11-18 12:37:31
Message-ID: 000701c3add0$bf6620d0$3ac15e91@acm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2003-11-18 12:58:02 Re: Why can I create a table named " " ?
Previous Message Oliver Elphick 2003-11-18 12:14:45 Debian packages of 7.4