Is it possible to store a 1 byte number in Postgres?

后端 未结 7 1972
南方客
南方客 2021-02-04 00:26

I have 7 8-bit integer values per record that I want to store in Postgres. Pg doesn\'t offer a single byte integer type, SMALLINT, or 2 bytes, being the smallest integer datatyp

7条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-04 01:21

    You will want to look into the bytea data type referenced here: http://www.postgresql.org/docs/8.4/interactive/datatype-binary.html

    There is also bit string data types: http://www.postgresql.org/docs/8.4/interactive/datatype-bit.html

提交回复
热议问题