I\'m adding a new, \"NOT NULL\" column to my Postgresql database using the following query (sanitized for the Internet):
ALTER TABLE mytable ADD COLUMN mycol
You have to set a default value.
ALTER TABLE mytable ADD COLUMN mycolumn character varying(50) NOT NULL DEFAULT 'foo'; ... some work (set real values as you want)... ALTER TABLE mytable ALTER COLUMN mycolumn DROP DEFAULT;