What I'd like to do is this
psql -d xxx -c "select user_id from res_partner;" > backup.txt
Then
psql -d xxx -c "update res_partner set user_id = null";
The big problem remain in inserting the data back into the table... Is there a way to dump a particular column of a particular table in postgresql and then to insert everything back?
To add a bit more context, the real problem is that I'm upgrading modules from a webservice called Odoo. Each module might insert/update constraints... In my case, I changed a constraint on the same column to reference an other column. It works good, but when we upgrade the server, it tries to insert back the old foreign key then when my module gets loaded it would add my foreign key... yet since it points to a different column, the old foreign key failed with a constraint error... I'd like to either supress the constraint check during the upgrade or backup restore the datas. Having null value shouldn't raise a constraint error.