Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
f7ad874c
Commit
f7ad874c
authored
Oct 29, 2008
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Since SQL:2003, the array size specification in the SQL ARRAY syntax has
been optional.
parent
f7ef575f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
doc/src/sgml/array.sgml
doc/src/sgml/array.sgml
+6
-3
src/backend/parser/gram.y
src/backend/parser/gram.y
+13
-3
No files found.
doc/src/sgml/array.sgml
View file @
f7ad874c
<!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.6
6 2008/04/28 14:48:57 alvher
re Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.6
7 2008/10/29 11:24:52 pete
re Exp $ -->
<sect1 id="arrays">
<sect1 id="arrays">
<title>Arrays</title>
<title>Arrays</title>
...
@@ -76,9 +76,12 @@ CREATE TABLE tictactoe (
...
@@ -76,9 +76,12 @@ CREATE TABLE tictactoe (
<programlisting>
<programlisting>
pay_by_quarter integer ARRAY[4],
pay_by_quarter integer ARRAY[4],
</programlisting>
</programlisting>
This syntax requires an integer constant to denote the array size.
Or, if no array size is to be specified:
<programlisting>
pay_by_quarter integer ARRAY,
</programlisting>
As before, however, <productname>PostgreSQL</> does not enforce the
As before, however, <productname>PostgreSQL</> does not enforce the
size restriction.
size restriction
in any case
.
</para>
</para>
</sect2>
</sect2>
...
...
src/backend/parser/gram.y
View file @
f7ad874c
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.63
1 2008/10/28 14:09:45
petere Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.63
2 2008/10/29 11:24:53
petere Exp $
*
*
* HISTORY
* HISTORY
* AUTHOR DATE MAJOR EVENT
* AUTHOR DATE MAJOR EVENT
...
@@ -7124,19 +7124,29 @@ Typename: SimpleTypename opt_array_bounds
...
@@ -7124,19 +7124,29 @@ Typename: SimpleTypename opt_array_bounds
$$->arrayBounds = $3;
$$->arrayBounds = $3;
$$->setof = TRUE;
$$->setof = TRUE;
}
}
/* SQL standard syntax, currently only one-dimensional */
| SimpleTypename ARRAY '[' Iconst ']'
| SimpleTypename ARRAY '[' Iconst ']'
{
{
/* SQL99's redundant syntax */
$$ = $1;
$$ = $1;
$$->arrayBounds = list_make1(makeInteger($4));
$$->arrayBounds = list_make1(makeInteger($4));
}
}
| SETOF SimpleTypename ARRAY '[' Iconst ']'
| SETOF SimpleTypename ARRAY '[' Iconst ']'
{
{
/* SQL99's redundant syntax */
$$ = $2;
$$ = $2;
$$->arrayBounds = list_make1(makeInteger($5));
$$->arrayBounds = list_make1(makeInteger($5));
$$->setof = TRUE;
$$->setof = TRUE;
}
}
| SimpleTypename ARRAY
{
$$ = $1;
$$->arrayBounds = list_make1(makeInteger(-1));
}
| SETOF SimpleTypename ARRAY
{
$$ = $2;
$$->arrayBounds = list_make1(makeInteger(-1));
$$->setof = TRUE;
}
;
;
opt_array_bounds:
opt_array_bounds:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment