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

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: stand-alone composite types patch (was [HACKERS] Proposal:
Дата
Msg-id 3D530150.90409@joeconway.com
обсуждение исходный текст
Ответ на stand-alone composite types patch (was [HACKERS] Proposal: stand-alone composite types)  (Joe Conway <mail@joeconway.com>)
Ответы Re: stand-alone composite types patch (was [HACKERS] Proposal: stand-alone composite types)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: stand-alone composite types patch (was [HACKERS] Proposal: stand-alone composite types)
Следующее
От: Alvaro Herrera
Дата:
Сообщение: little psql additions