Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
>>Shouldn't "integer" be recognized as a valid type?
> Not when double-quoted; you are being overzealous about quoting.
I figured that out (new patch works "correctly"), but it does seem
inconsistent:
test=# create table tbl_0 (f1 "integer");
ERROR: Type "integer" does not exist
test=# create table "tbl_0" ("f1" integer);
CREATE TABLE
test=# select * from tbl_0 ;
f1
----
(0 rows)
test=# select f1 from tbl_0 ;
f1
----
(0 rows)
test=# select "f1" from tbl_0 ;
f1
----
(0 rows)
For table and column identifiers, if they were defined in all lowercase
I can either quote them, or not -- it works either way. Same for *user*
defined data types:
test=# CREATE TYPE myint42 ( internallength = 4, input = int4in, output
= int4out, default = '42', alignment = int4, storage = plain,
passedbyvalue);
CREATE TYPE
test=# create table "tbl_1" ("f1" myint42);
CREATE TABLE
test=# create table "tbl_2" ("f1" "myint42");
CREATE TABLE
test=# \d tbl_2
Table "tbl_2"
Column | Type | Modifiers
--------+---------+-----------
f1 | myint42 |
But *internal* data types only work unquoted.
Joe