From 5be9f4e02ff494ce973fd8ddae076312378fc097 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 13 May 2026 23:53:14 +0000 Subject: [PATCH] New macro: positive_check() Checks a column is a positive number --- db/include/tablemacros.m4 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/db/include/tablemacros.m4 b/db/include/tablemacros.m4 index 32e7d10..d623edf 100644 --- a/db/include/tablemacros.m4 +++ b/db/include/tablemacros.m4 @@ -238,6 +238,18 @@ define([nonnegative_check], [ CONSTRAINT "$1: must be bigger than o CHECK ($1 >= 0)])dnl changequote(`,')dnl See above +-- A column must be positive +-- +-- Syntax: positive_check(col) +-- +-- Input: +-- col Name of the column to check. +-- +changequote([,]) +define([positive_check], [ CONSTRAINT "$1: must be bigger than 0" + CHECK ($1 > 0)])dnl +changequote(`,')dnl See above + -- A pair of columns must both be either NULL or non-NULL. -- -- Syntax: null_iff_null(col1, col2) -- 2.34.1