I want to add a column to an existing legacy database and write a procedure by which I can assign each record a different value. Something like ad
And the Postgres equivalent (second line is mandatory only if you want "id" to be a key):
ALTER TABLE tableName ADD id SERIAL; ALTER TABLE tableName ADD PRIMARY KEY (id);