cmd icon indicating copy to clipboard operation
cmd copied to clipboard

why convert a type "smallint" in progresql to int in go model?

Open xubing opened this issue 8 years ago • 2 comments

我在使用reverse转化progresql到model的时候,smallint类型转化成了int。 我查看代码,代码中其实已经有了smallint等int 类型的判断了。为什么生成model中是int,而不是int8 或者int16这样的呢。

xubing avatar Jun 27 '16 04:06 xubing

postgres有smallint吗?

lunny avatar Jun 27 '16 07:06 lunny

当然有。Postgresql的的数字类型

  • smallint 2 bytes
    • integer 4
    • bigint 8
    • decimal variable
    • numeric variable
    • real 4 bytes
    • double precision 8
    • smallserial 2 bytes 1-32767
    • serial 4 bytes
    • bigserial 8 bytes

xubing avatar Jun 27 '16 13:06 xubing