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?
Just in case Milen A. Radev doesn't get around to posting his solution, this is it:
CREATE TABLE foo ( key int PRIMARY KEY, foo text NOT NULL DEFAULT TO_CHAR(CURRENT_TIMESTAMP,'YYYYMM') );