mirror of
https://github.com/postgres/postgres.git
synced 2025-06-17 17:02:08 +03:00
Add smallserial pseudotype.
This is just like serial and bigserial, except it generates an int2 column rather than int4 or int8. Mike Pultz, reviewed by Brar Piening and Josh Kupershmidt
This commit is contained in:
@ -307,7 +307,14 @@ transformColumnDefinition(CreateStmtContext *cxt, ColumnDef *column)
|
||||
{
|
||||
char *typname = strVal(linitial(column->typeName->names));
|
||||
|
||||
if (strcmp(typname, "serial") == 0 ||
|
||||
if (strcmp(typname, "smallserial") == 0 ||
|
||||
strcmp(typname, "serial2") == 0)
|
||||
{
|
||||
is_serial = true;
|
||||
column->typeName->names = NIL;
|
||||
column->typeName->typeOid = INT2OID;
|
||||
}
|
||||
else if (strcmp(typname, "serial") == 0 ||
|
||||
strcmp(typname, "serial4") == 0)
|
||||
{
|
||||
is_serial = true;
|
||||
|
Reference in New Issue
Block a user