How can I set all columns' default value equal to null in PostgreSQL?

You need to run an ALTER TABLE statement for each column. Never ever try to do something like that by manipulating system tables (even if you find the correct one - INFORMATION_SCHEMA only contains view to the real system tables) But you can generate all needed ALTER TABLE statements based on the data in the information_schema views: SELECT 'ALTER TABLE '||table_name||' ALTER COLUMN '||column_name||' SET DEFAULT NULL;' FROM information_schema. Columns WHERE table_name = 'foo Save the output as a SQL script and then run that script (don't forget to commit the changes).

You need to run an ALTER TABLE statement for each column. Never ever try to do something like that by manipulating system tables (even if you find the correct one - INFORMATION_SCHEMA only contains view to the real system tables) But you can generate all needed ALTER TABLE statements based on the data in the information_schema views: SELECT 'ALTER TABLE '||table_name||' ALTER COLUMN '||column_name||' SET DEFAULT NULL;' FROM information_schema. Columns WHERE table_name = 'foo'; Save the output as a SQL script and then run that script (don't forget to commit the changes).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions