datatype preceded by underscore creates array

Поиск
Список
Период
Сортировка
От George Pavlov
Тема datatype preceded by underscore creates array
Дата
Msg-id 8C5B026B51B6854CBE88121DBF097A8651DB95@ehost010-33.exch010.intermedia.net
обсуждение исходный текст
Ответы Re: datatype preceded by underscore creates array  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Is there any special meaning to preceding a datatype (or at least some
datatypes) in a table or function definition by underscore that is a
synonym for an array? I can't see it documented anywhere. Below are some
examples. The other question is why "_int4" parses to int[], but "_int"
does not, etc. This is on PostgreSQL 8.1.3 Linux.

gp=> create table a1 (b _int4);
CREATE TABLE
gp=> \d a1
         Table "mnp.a1"
 Column |   Type    | Modifiers
--------+-----------+-----------
 b      | integer[] |

gp=> create table a2 (b _char);
CREATE TABLE
gp=> \d a2
        Table "mnp.a2"
 Column |   Type   | Modifiers
--------+----------+-----------
 b      | "char"[] |

gp=> create table a3 (b _int);
ERROR:  type "_int" does not exist

gp=> create table a4 (b _char(1));
ERROR:  syntax error at or near "(" at character 25
LINE 1: create table a4 (b _char(1));
                                ^


В списке pgsql-general по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: function for current date-time
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: old Pg interface