Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit20e82a7

Browse files
committed
Give an explicit error for serial[], rather than silently ignoring
the array decoration as the code had been doing.
1 parent4b7ae4a commit20e82a7

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎src/backend/parser/parse_utilcmd.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
2020
* Portions Copyright (c) 1994, Regents of the University of California
2121
*
22-
*$PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.9 2008/02/07 17:09:51 tgl Exp $
22+
*$PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.10 2008/03/21 22:10:56 tgl Exp $
2323
*
2424
*-------------------------------------------------------------------------
2525
*/
@@ -266,7 +266,8 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
266266

267267
/* Check for SERIAL pseudo-types */
268268
is_serial= false;
269-
if (list_length(column->typename->names)==1)
269+
if (list_length(column->typename->names)==1&&
270+
!column->typename->pct_type)
270271
{
271272
char*typname=strVal(linitial(column->typename->names));
272273

@@ -284,6 +285,16 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
284285
column->typename->names=NIL;
285286
column->typename->typeid=INT8OID;
286287
}
288+
289+
/*
290+
* We have to reject "serial[]" explicitly, because once we've
291+
* set typeid, LookupTypeName won't notice arrayBounds. We don't
292+
* need any special coding for serial(typmod) though.
293+
*/
294+
if (is_serial&&column->typename->arrayBounds!=NIL)
295+
ereport(ERROR,
296+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
297+
errmsg("array of serial is not implemented")));
287298
}
288299

289300
/* Do necessary work on the column type declaration */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp