PostgreSQL Maestro online Help
Prev | Return to chapter overview | Next |
Range Types
Range types are data types representing a range of values of some element type (called the range's subtype). For instance, ranges of timestamp might be used to represent the ranges of time that a meeting room is reserved. In this case the data type is tsrange (short for "timestamp range"), and timestamp is the subtype. The subtype must have a total order so that it is well-defined whether element values are within, before, or after a range of values.
Range types are useful because they represent many element values in a single range value, and because concepts such as overlapping ranges can be expressed clearly. The use of time and date ranges for scheduling purposes is the clearest example; but price ranges, measurement ranges from an instrument, and so forth can also be useful.
New range types are created within Create Range Type Wizard. In order to run the wizard you should either
or
To create a new range type with the same properties as one of the existing one has:
|
Range data types can be edited within Range Type Editor. In order to run the editor you should either
|
To drop a range data type:
and confirm dropping in the dialog window.
|