Re: stand-alone composite types patch (was [HACKERS] Proposal:

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: stand-alone composite types patch (was [HACKERS] Proposal:
Date: 2002-08-08 23:40:00
Message-ID: 3D530150.90409@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Joe Conway <mail(at)joeconway(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-08-08 23:53:04 Re: Another python patch -- minor
Previous Message Bruce Momjian 2002-08-08 23:26:56 Re: contrib/ltree, pls, apply patch

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2002-08-09 00:50:14 little psql additions
Previous Message Tom Lane 2002-08-08 22:57:04 Re: stand-alone composite types patch (was [HACKERS] Proposal: stand-alone composite types)