Postgresql insert trigger to set value
You are correct that you need a trigger, because setting a default value for the column won’t work for you – default values only work for null values and don’t help you in preventing blank values. In postgres there are a couple of steps to creating a trigger: Step 1: Create a function that returns … Read more