SELECT * REPLACE keeps every column in a relation while substituting selected columns with new expressions. It is useful when a wide table or view needs one focused transformation without rewriting the entire projection. section 1.2 section 3.5.1
Write one or more replacement pairs as an expression followed by AS and the existing column name. The remaining columns stay selected, preserving the convenience of the star while making the changed field explicit. section 3.5.1
Round one column in a view
A power view exposes fractional kWh values. Replace only that presentation with an integer while retaining system_id and day: SELECT * REPLACE (round(kWh)::int AS kWh) FROM v_power_per_day; The result contains system_id, day, and integer kWh values, with 1,587 rows shown in the example output. section 3.5.1
