PostgreSQL Alter table add column to existing table
Add column to existing table
How to add column to existing table. Alter syntax and example
Syntax
ALTER TABLE table_name ADD COLUMN column_name data_type;
Create table
CREATE SEQUENCE seq_users
INCREMENT 1 MINVALUE 1
MAXVALUE 9999999999999999
START 1 CACHE 1;
CREATE TABLE users(
userid numeric not null
default nextval('seq_users'::regclass),
username varchar(100),
userpass varchar(250),
usermail varchar(50)
);
Example Add column
ALTER TABLE users ADD COLUMN address varchar(1000);