As title, how can I set a table\'s column to have the default value the current year and month, in format \'YYYYMM\', like 200905 for today?
It's a common misconception that you can denormalise like this for performance. Use date_trunc('month', date) for your queries and add an index expression for this if you find it running slow.
date_trunc('month', date)