![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I see PostgreSQL doesn't have a real one-byte integral type, like TINYINT. What do you use instead? |
#3
| |||
| |||
|
|
Karsten Wutzke wrote: I see PostgreSQL doesn't have a real one-byte integral type, like TINYINT. What do you use instead? That's right. You could use "smallint" instead which only uses 2 bytes. If you want to prevent larger values to be inserted, you could use a check constraint. Yours, Laurenz Albe |
#4
| |||
| |||
|
|
Generally, I get the feeling the mainstream DBMS' around (PostgreSQL, MySQL, Oracle, ...) don't like byte-wise types. Could it have to do with two-byte memory alignment issues? |
#5
| |||
| |||
|
|
I see PostgreSQL doesn't have a real one-byte integral type, like TINYINT. What do you use instead? That's right. You could use "smallint" instead which only uses 2 bytes. If you want to prevent larger values to be inserted, you could use a check constraint. How do you ensure that a one-byte range type only occupies one byte? |
|
Is it because of the SQL standard, that PostgreSQL doesn't have a one- byte type, too? |
|
Generally, I get the feeling the mainstream DBMS' around (PostgreSQL, MySQL, Oracle, ...) don't like byte-wise types. Could it have to do with two-byte memory alignment issues? |
#6
| |||
| |||
|
|
Karsten Wutzke wrote: I see PostgreSQL doesn't have a real one-byte integral type, like TINYINT. What do you use instead? That's right. You could use "smallint" instead which only uses 2 bytes. If you want to prevent larger values to be inserted, you could use a check constraint. How do you ensure that a one-byte range type only occupies one byte? If you use a smallint, it will use two bytes. Is it because of the SQL standard, that PostgreSQL doesn't have a one- byte type, too? I didn't check, but I don't think so. That would be surprising. |
|
Generally, I get the feeling the mainstream DBMS' around (PostgreSQL, MySQL, Oracle, ...) don't like byte-wise types. Could it have to do with two-byte memory alignment issues? Maybe, but I guess that there is no hige demand for it. Yours, Laurenz Albe |
#7
| |||
| |||
|
|
Karsten Wutzke, 07.09.2009 13:06: Generally, I get the feeling the mainstream DBMS' around (PostgreSQL, MySQL, Oracle, ...) don't like byte-wise types. Could it have to do with two-byte memory alignment issues? What's the use for a single-byte datatype? Space consideration should not matter nowadays. |
#8
| |||
| |||
|
|
Hmmm strange. I thought it might be the ideal size to store booleans as well. |

#9
| |||
| |||
|
|
Is it because of the SQL standard, that PostgreSQL doesn't have a one- byte type, too? I didn't check, but I don't think so. That would be surprising. It really doesn't contain one... |
#10
| |||
| |||
|
|
Karsten Wutzke, 07.09.2009 18:16: Hmmm strange. I thought it might be the ideal size to store booleans as well. That's what the boolean type is for ![]() Thomas |
![]() |
| Thread Tools | |
| Display Modes | |
| |