smallserial / serial2
Mike Pultz <mike@mikepultz.com>
From: "Mike Pultz" <mike@mikepultz.com>
To: <pgsql-hackers@postgresql.org>
Date: 2011-04-21T01:27:27Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add a variant expected-output file for the sequence regression test, to cover
- bb3f839bfcb3 8.4.0 cited
I use tables all the time that have sequences on smallint's;
I'd like to simplify my create files by not having to create the sequence
first, but I also don't want to give up those 2 bytes per column!
Can this be added?
Mike
--- postgresql-9.0.4/src/backend/parser/parse_utilcmd.c 2011-04-14
23:15:53.000000000 -0400
+++ postgresql-9.0.4.new/src/backend/parser/parse_utilcmd.c 2011-04-20
21:10:26.000000000 -0400
@@ -280,8 +280,15 @@
{
char *typname =
strVal(linitial(column->typeName->names));
- if (strcmp(typname, "serial") == 0 ||
- strcmp(typname, "serial4") == 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;
column->typeName->names = NIL;