WEEKS_BETWEEN CREATE OR REPLACE FUNCTION weeks_between(start_date date, end_date date) RETURNS integer AS $$ BEGIN RETURN EXTRACT(WEEK FROM end_date) - EXTRACT(WEEK FROM start_date); END; $$ LANGU
CREATE OR REPLACE FUNCTION weekday(date_val date) RETURNS integer AS $$ BEGIN RETURN EXTRACT(ISODOW FROM date_val); END; $$ LANGUAGE plpgsql IMMUTABLE;
问题描述 备库意外宕机,从集群日志只看出发生了主备切换,备库一直持续恢复备库没有成功,从数据库日志看到如下报错: terminating connection because of crash of another server processDETAIL: The kingbase has commanded this server process to roll back the cur