When doing administration on big production postgres database, it seems that even such ALTER TABLE -ddl queries cannot be safely run, that should be no-operations?
Has anyone looked into Postgres source codes or have previous knowledge on what happens in such case?
Looking back at what just happened it seems that on query like:
ALTER TABLE table ALTER COLUMN column TYPE int8;
- Table statistics disappeared on that column?
- pages were thrown out of cache?
Even though the column type was already in correct type.
What I learned from this is, that all such queries, even if no operation, should be wrapped inside a function that checks, if anything needs to be done.