Versions:
saturating_sub_pos() ToolkitTimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.ExperimentalExperimental TimescaleDB Toolkit functions are not suitable for production environments. They may have bugs and may cause data loss. Click to learn more.
Toolkit
TimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.
Experimental
Experimental TimescaleDB Toolkit functions are not suitable for production environments. They may have bugs and may cause data loss. Click to learn more.
The saturating_sub_pos
subtracts the second number from the first, saturating at 0 and 2147483647 instead of overflowing.
For more information about saturating math functions, see the saturating math docs.
Required arguments
Name | Type | Description |
---|---|---|
x | INT | An integer for y to subtract from |
y | INT | An integer to subtract from x |
Returns
Column | Type | Description |
---|---|---|
saturating_sub_pos | `INT | The result of x-y`, saturating at 0 for the minimum bound |
Found an issue on this page?
Report an issue!