|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.122 2008/03/20 21:42:47 tgl Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.123 2008/06/26 22:24:42 momjian Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="sql-syntax">
|
4 | 4 | <title>SQL Syntax</title>
|
@@ -286,19 +286,63 @@ SELECT 'foo' 'bar';
|
286 | 286 | quote.)
|
287 | 287 | Within an escape string, a backslash character (<literal>\</>) begins a
|
288 | 288 | C-like <firstterm>backslash escape</> sequence, in which the combination
|
289 |
| - of backslash and following character(s) represents a special byte value. |
290 |
| - <literal>\b</literal> is a backspace, |
291 |
| - <literal>\f</literal> is a form feed, |
292 |
| - <literal>\n</literal> is a newline, |
293 |
| - <literal>\r</literal> is a carriage return, |
294 |
| - <literal>\t</literal> is a tab. |
295 |
| - Also supported are |
296 |
| - <literal>\<replaceable>digits</replaceable></literal>, where |
297 |
| - <replaceable>digits</replaceable> represents an octal byte value, and |
298 |
| - <literal>\x<replaceable>hexdigits</replaceable></literal>, where |
299 |
| - <replaceable>hexdigits</replaceable> represents a hexadecimal byte value. |
300 |
| - (It is your responsibility that the byte sequences you create are |
301 |
| - valid characters in the server character set encoding.) Any other |
| 289 | + of backslash and following character(s) represent a special byte |
| 290 | + value: |
| 291 | + |
| 292 | + <table id="sql-backslash-table"> |
| 293 | + <title>Backslash Escape Sequences</title> |
| 294 | + <tgroup cols="2"> |
| 295 | + <thead> |
| 296 | + <row> |
| 297 | + <entry>Backslash Escape Sequence</> |
| 298 | + <entry>Interpretation</entry> |
| 299 | + </row> |
| 300 | + </thead> |
| 301 | + |
| 302 | + <tbody> |
| 303 | + <row> |
| 304 | + <entry><literal>\b</literal></entry> |
| 305 | + <entry>backspace</entry> |
| 306 | + </row> |
| 307 | + <row> |
| 308 | + <entry><literal>\f</literal></entry> |
| 309 | + <entry>form feed</entry> |
| 310 | + </row> |
| 311 | + <row> |
| 312 | + <entry><literal>\n</literal></entry> |
| 313 | + <entry>newline</entry> |
| 314 | + </row> |
| 315 | + <row> |
| 316 | + <entry><literal>\r</literal></entry> |
| 317 | + <entry>carriage return</entry> |
| 318 | + </row> |
| 319 | + <row> |
| 320 | + <entry><literal>\t</literal></entry> |
| 321 | + <entry>tab</entry> |
| 322 | + </row> |
| 323 | + <row> |
| 324 | + <entry> |
| 325 | + <literal>\<replaceable>o</replaceable></literal>, |
| 326 | + <literal>\<replaceable>oo</replaceable></literal>, |
| 327 | + <literal>\<replaceable>ooo</replaceable></literal> |
| 328 | + (<replaceable>o</replaceable> = 0 - 7) |
| 329 | + </entry> |
| 330 | + <entry>octal byte value</entry> |
| 331 | + </row> |
| 332 | + <row> |
| 333 | + <entry> |
| 334 | + <literal>\x<replaceable>h</replaceable></literal>, |
| 335 | + <literal>\x<replaceable>hh</replaceable></literal> |
| 336 | + (<replaceable>h</replaceable> = 0 - 9, A - F) |
| 337 | + </entry> |
| 338 | + <entry>hexadecimal byte value</entry> |
| 339 | + </row> |
| 340 | + </tbody> |
| 341 | + </tgroup> |
| 342 | + </table> |
| 343 | + |
| 344 | + It is your responsibility that the byte sequences you create are |
| 345 | + valid characters in the server character set encoding. Any other |
302 | 346 | character following a backslash is taken literally. Thus, to
|
303 | 347 | include a backslash character, write two backslashes (<literal>\\</>).
|
304 | 348 | Also, a single quote can be included in an escape string by writing
|
|
0 commit comments