I have this table.
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name TEXT
);
I'm looking for a way to enforce lowercase for the name
values.
For example, when I save a record using this command:
INSERT INTO users (name) VALUES ('JOHN');
or:
INSERT INTO users (name) VALUES ('John');
I want it to be saved as john
without converting the case beforehand using my programming language i.e. JavaScript, Ruby and etc.
Is it possible to make use of LOWER()
function inside this CREATE TABLE
command?