Question : Suppose I want to ensure that, for any expected height in feet, I have a single, unambiguous classification. […]
Tag: exclusion-constraint
How to find out what operator class and access method should be used for an exclusion constraint?
Question : Original goal: create a constraint to ensure that only non-overlapping subnets exist in a particular Postgres table. From […]
Unique constraint to enforce max one null per item
Question : I am using PostgreSQL 9.3. Suppose we are manufacturing some items of certain types, at any moment we […]
Create a PostgreSQL constraint to prevent unique combination rows
Question : Imagine you have a simple table: name | is_active —————- A | 0 A | 0 B | […]
Constraint on row value based on values in other rows
Question : Is it possible to have a table with four columns: CREATE TABLE accrual ( add_date date NOT NULL, […]
Using postgresql, how to prevent new inserts on varchar column using ^@ / starts_with operator / function?
Question : I’m trying to create a table with a path column. This table should only allow inserting a new […]
How to find out what operator class and access method should be used for an exclusion constraint?
Question : Original goal: create a constraint to ensure that only non-overlapping subnets exist in a particular Postgres table. From […]
Unique constraint to enforce max one null per item
Question : I am using PostgreSQL 9.3. Suppose we are manufacturing some items of certain types, at any moment we […]
Include constraint for daterange type
Question : Here is the table CREATE TABLE date_ranges ( id SERIAL PRIMARY KEY, user_id INTEGER, start_at DATE, end_at DATE, […]