In Postrges, I know how to create a table with a column that has a serial (number) id:
CREATE TABLE Tag (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL
);
I prefer to have my ids have a human readable aspect to them though. I usually do something like tag_1, tag_2, tag_3
usr_1, usr_2, usr_3
.
I've seen instructions on how to generate uuids (Generating a UUID in Postgres for Insert statement?), but I don't really need that. The basic serial number is more than enough, I just want to prefix tag_
to the beginning.
How can I create a Serial ID with as a string with common prefix?