Catalyzes the oxidation of erythronate-4-phosphate to 3-hydroxy-2-oxo-4-phosphonooxybutanoate. 4-phospho-D-erythronate + NAD(+) = (R)-3-hydroxy-2-oxo-4-phosphooxybutanoate + H(+) + NADH Cofactor biosynthesis; pyridoxine 5'-phosphate biosynthesis; pyridoxine 5'-phosphate from D-erythrose 4-phosphate: step 2/5. Homodimer. Belongs to the D-isomer specific 2-hydroxyacid dehydrogenase family. PdxB subfamily.