From d6542f8dfc6c7db9b491a4f0b1ea082cfa4537eb Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 31 Dec 2025 13:19:27 -0500 Subject: [PATCH] Doc: remove obsolete, confused about rowtype I/O syntax. This was originally written to describe the double levels of de-backslashing encountered when a backslash-aware string literal is used to hold the text representation of a composite value. It still made sense when we switched to mostly using E'...' syntax for that type of literal. However, commit f77de4b0c mangled it completely by changing the example literal to be SQL-standard. The extra pass of de-backslashing described in the text doesn't actually occur with the example as written, unless you happen to be using standard_conforming_strings = off. We could restore this to self-consistency by reverting the change from f77de4b0c, but on the whole I judge that its time has passed. standard_conforming_strings = off is nearly obsolete, and may soon be fully so. But without that, the behavior isn't so complicated as to justify a discursive note. I observe that the nearby section about array I/O syntax has no equivalent text, although that syntax is equally subject to this issue. Author: Tom Lane Discussion: https://postgr.es/m/2998401.1767038920@sss.pgh.pa.us Discussion: https://postgr.es/m/3279216.1767072538@sss.pgh.pa.us --- doc/src/sgml/rowtypes.sgml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/doc/src/sgml/rowtypes.sgml b/doc/src/sgml/rowtypes.sgml index bbeac84d46a..0d2c1721ff3 100644 --- a/doc/src/sgml/rowtypes.sgml +++ b/doc/src/sgml/rowtypes.sgml @@ -502,30 +502,6 @@ SELECT c.somefunc FROM inventory_item c; embedded in field values will be doubled. - - - Remember that what you write in an SQL command will first be interpreted - as a string literal, and then as a composite. This doubles the number of - backslashes you need (assuming escape string syntax is used). - For example, to insert a text field - containing a double quote and a backslash in a composite - value, you'd need to write: - -INSERT ... VALUES ('("\"\\")'); - - The string-literal processor removes one level of backslashes, so that - what arrives at the composite-value parser looks like - ("\"\\"). In turn, the string - fed to the text data type's input routine - becomes "\. (If we were working - with a data type whose input routine also treated backslashes specially, - bytea for example, we might need as many as eight backslashes - in the command to get one backslash into the stored composite field.) - Dollar quoting (see ) can be - used to avoid the need to double backslashes. - - - The ROW constructor syntax is usually easier to work with