I'm working with PostgreSQL 9.3.
I have a table with a varchar
column that I always want to be filled with lowercase strings.
I could use the Postgres lower
function before saving my values, but is there instead a way to define this column as a lowercase column?
You can accomplish this with a simple check in the column:
create table lower_field (
field1 varchar check (field1 = lower(field1))
);