I'm working with PostgreSQL. I have to set the NOT NULL property on a column that exists in all the tables of my database.
I know how to set in one table, using:
ALTER TABLE table_name ALTER COLUMN column_name SET NOT NULL;
But I have about 400 tables in my database, so I need something to do it at once, does anybody the way?
Thank you in advance!
As laurenz stated, you can achieve it by executing the ALTER commands in the
DOstatement like below,