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;

Reply via email to