File tree 2 files changed +19
-6
lines changed
2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1
- <!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.66 2008/04/28 14:48:57 alvherre Exp $ -->
1
+ <!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.67 2008/10/29 11:24:52 petere Exp $ -->
2
2
3
3
<sect1 id="arrays">
4
4
<title>Arrays</title>
@@ -76,9 +76,12 @@ CREATE TABLE tictactoe (
76
76
<programlisting>
77
77
pay_by_quarter integer ARRAY[4],
78
78
</programlisting>
79
- This syntax requires an integer constant to denote the array size.
79
+ Or, if no array size is to be specified:
80
+ <programlisting>
81
+ pay_by_quarter integer ARRAY,
82
+ </programlisting>
80
83
As before, however, <productname>PostgreSQL</> does not enforce the
81
- size restriction.
84
+ size restriction in any case .
82
85
</para>
83
86
</sect2>
84
87
Original file line number Diff line number Diff line change 11
11
*
12
12
*
13
13
* IDENTIFICATION
14
- * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.631 2008/10/28 14:09:45 petere Exp $
14
+ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.632 2008/10/29 11:24:53 petere Exp $
15
15
*
16
16
* HISTORY
17
17
* AUTHOR DATE MAJOR EVENT
@@ -7124,19 +7124,29 @@ Typename: SimpleTypename opt_array_bounds
7124
7124
$$ ->arrayBounds = $3 ;
7125
7125
$$ ->setof = TRUE ;
7126
7126
}
7127
+ /* SQL standard syntax, currently only one-dimensional */
7127
7128
| SimpleTypename ARRAY ' [' Iconst ' ]'
7128
7129
{
7129
- /* SQL99's redundant syntax */
7130
7130
$$ = $1 ;
7131
7131
$$ ->arrayBounds = list_make1(makeInteger($4 ));
7132
7132
}
7133
7133
| SETOF SimpleTypename ARRAY ' [' Iconst ' ]'
7134
7134
{
7135
- /* SQL99's redundant syntax */
7136
7135
$$ = $2 ;
7137
7136
$$ ->arrayBounds = list_make1(makeInteger($5 ));
7138
7137
$$ ->setof = TRUE ;
7139
7138
}
7139
+ | SimpleTypename ARRAY
7140
+ {
7141
+ $$ = $1 ;
7142
+ $$ ->arrayBounds = list_make1(makeInteger(-1 ));
7143
+ }
7144
+ | SETOF SimpleTypename ARRAY
7145
+ {
7146
+ $$ = $2 ;
7147
+ $$ ->arrayBounds = list_make1(makeInteger(-1 ));
7148
+ $$ ->setof = TRUE ;
7149
+ }
7140
7150
;
7141
7151
7142
7152
opt_array_bounds:
You can’t perform that action at this time.
0 commit comments