![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Description: Feature request: tinyint and unsigned types |
#3
| |||
| |||
|
|
You can already use "char" to store 1 byte values, though unless there are several of these in a row, you won't save any space because of alignment. |
#4
| |||
| |||
|
|
Is there any technical reason why we don't support unsigned ints or tinyint? Just a matter of no one feeling the itch? |
#5
| |||
| |||
|
|
Jim Nasby <decibel (AT) decibel (DOT) org> writes: Is there any technical reason why we don't support unsigned ints or tinyint? Just a matter of no one feeling the itch? The question is whether it's worth complicating the numeric-type promotion hierarchy even more. A variant int type probably isn't worth much if it doesn't interact naturally with arithmetic & comparisons with other int types, but we've found out the hard way that you can't have a huge number of possible interpretations, or you get too many "can't resolve which operator to use" errors. (See the archives for details.) My private suspicion is that 90% of the people who say they want tinyint are really looking for a enum type, and thus that Tom Dunstan's recent patch for enum support might solve their problem. (Did Tom's patch allow for the storage size to vary depending on the number of values? Those folk won't be satisfied if not, even though we all know that alignment issues frequently negate any savings...) |
|
As for unsigned, you can use OID as uint4 if you must. |
#6
| |||
| |||
|
|
Agreed. Some variables I had wanted to make tinyints could be expressed as enumerated values. Other variables I wanted to express as unsigned ints or tinyints or unsigned tinyints to model the possible values from the problem domain as succinctly as possible. |
#7
| |||
| |||
|
|
Albert Strasheim wrote: Agreed. Some variables I had wanted to make tinyints could be expressed as enumerated values. Other variables I wanted to express as unsigned ints or tinyints or unsigned tinyints to model the possible values from the problem domain as succinctly as possible. =20 Then use domains. |
![]() |
| Thread Tools | |
| Display Modes | |
| |