Re: stand-alone composite types patch (was [HACKERS] Proposal: - Mailing list pgsql-patches

From Joe Conway
Subject Re: stand-alone composite types patch (was [HACKERS] Proposal:
Date
Msg-id 3D530150.90409@joeconway.com
Whole thread Raw
In response to stand-alone composite types patch (was [HACKERS] Proposal: stand-alone composite types)  (Joe Conway <mail@joeconway.com>)
Responses Re: stand-alone composite types patch (was [HACKERS] Proposal: stand-alone composite types)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
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


pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: stand-alone composite types patch (was [HACKERS] Proposal: stand-alone composite types)
Next
From: Alvaro Herrera
Date:
Subject: little psql additions