Catalyzes the NAD(P)(+)-dependent oxidation of alpha-ketoglutaric semialdehyde (alphaKGSA) to alpha-ketoglutarate. Prefers NADP(+) to NAD(+) as a cosubstrate. In vitro, can also use various aldehydes. 2,5-dioxopentanoate + H2O + NADP(+) = 2-oxoglutarate + 2 H(+) + NADPH 2,5-dioxopentanoate + H2O + NAD(+) = 2-oxoglutarate + 2 H(+) + NADH kcat is 2.75 sec(-1) with alpha-ketoglutaric semialdehyde as substrate (in the presence of NAD(+)). kcat is 1.12 sec(-1) with alpha-ketoglutaric semialdehyde as substrate (in the presence of NADP(+)). kcat is 1.29 sec(-1) with propionaldehyde as substrate (in the presence of NADP(+)). kcat is 1.35 sec(-1) with butylaldehyde as substrate (in the presence of NADP(+)). kcat is 2.10 sec(-1) with valeraldehyde as substrate (in the presence of NADP(+)). kcat is 1.47 sec(-1) with hexylaldehyde as substrate (in the presence of NADP(+)). kcat is 0.87 sec(-1) with heptalaldehyde as substrate (in the presence of NADP(+)). kcat is 0.97 sec(-1) with octylaldehyde as substrate (in the presence of NADP(+)). Homotetramer. No effect on vanillin degradation. Belongs to the aldehyde dehydrogenase family.