datatype preceded by underscore creates array

From: "George Pavlov" <gpavlov(at)mynewplace(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: datatype preceded by underscore creates array
Date: 2006-10-16 19:33:35
Message-ID: 8C5B026B51B6854CBE88121DBF097A8651DB95@ehost010-33.exch010.intermedia.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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));
^

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-10-16 19:36:13 Re: old Pg interface
Previous Message A. Kretschmer 2006-10-16 19:17:16 Re: function for current date-time