postgres script auto increment primary key code example
Example 1: postgresql auto increment
CREATE TABLE table_name(
id SERIAL
);Code language: SQL (Structured Query Language) (sql)
Example 2: auto increment psql not primary key
CREATE SEQUENCE cateogry_id_seq;
ALTER TABLE category ALTER COLUMN category_id SET DEFAULT nextval('cateogry_id_seq');