ROW is the SQL row-value constructor defined in the SQL standard and fully implemented in PostgreSQL. It groups one or more scalar expressions into a single composite value that behaves like a record. A ROW constructor can appear anywhere an expression is allowed, including SELECT lists, INSERT ... VALUES lists, WHERE comparisons, function arguments, and RETURN statements in stored procedures. When used inside VALUES, the ROW keyword is optional in PostgreSQL but clarifies intent. The number and order of items in the constructor must match the target record structure when assigning or inserting. A ROW value supports =, <>, IS DISTINCT FROM, and other tuple comparison operators in PostgreSQL. Other dialects offer limited or no support for the ROW keyword, although parenthesized row constructors (expr1, expr2) may be accepted. Always check dialect documentation before relying on ROW.
SQL-92 (row value constructor); fully supported in PostgreSQL 8.0
A parenthesized list like (1, 2) is treated as a row value in many dialects, but adding the ROW keyword makes the intent explicit and avoids ambiguity when mixing with arrays.
Yes. In PostgreSQL, `INSERT INTO t VALUES (1, 'a');` and `INSERT INTO t VALUES ROW (1, 'a');` are equivalent. The keyword is optional.
No. A ROW constructor returns one column whose data type is record or a named composite type. Use `SELECT (ROW (1,2)).*;` to expand it into separate columns.
Tuple comparison works: `WHERE (col1, col2) = ROW (val1, val2);` evaluates to true only when both column values match the corresponding row values.