[DOCS] Backslash Escape Sequences

2008-04-30 Thread Andy Anderson

On the list pgsql-general, I had this exchange:


Andy Anderson <[EMAIL PROTECTED]> writes:
In a test I just did, the sequence \" (backslash double-quote) is  
interpreted as just a " inside of the E'...' string constant  
expression. This is great, since PHP's addslashes() sticks them  
in along with the other stuff I really need to quote like ' and  
\. But I see that \" isn't documented in the manual in section  
4.1.2.1.  I assume this is, in fact, standard behavior for  
Postgres? (Perhaps a comprehensive table might be a good idea at  
this point in the manual.)


Tom Lane wrote:

Huh?  It says

  Any other character following a backslash is taken literally.




 Andy Anderson wrote:
Ah, slight ambiguity here. Perhaps this might best say "Any other  
character following a backslash is taken literally, and the  
backslash is removed."


In any case, here's a contribution to the manual, a short table with  
this information, in a format that might help make the subject  
clearer. Modify at will!


-- Andy




--
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


Re: [DOCS] Backslash Escape Sequences

2008-05-01 Thread Andy Anderson

Andy Anderson wrote:


In any case, here's a contribution to the manual, a short table with
this information, in a format that might help make the subject  
clearer.

Modify at will!



On Apr 30, 2008, at 6:04 PM, Alvaro Herrera wrote:
FWIW if you really want to make a contribution to the docs, please  
see
the SGML sources instead of the HTML output (which is machine- 
generated).


OK, then, I hope the following is accurate enough SGML to be more  
useful. Submitted here per the instructions on <http://www.postgresql.org/docs/8.3/interactive/bug-reporting.html 
>.


-- Andy




Backslash Escape Sequences



Backslash Escape Sequence
Interpretation




\b
backspace


\f
form feed


\n
newline


\r
carriage return


\t
tab





\o

\oo

\ooo
(o = 
0 - 7)


octal byte value





\xh

\xhh
(h = 
0 - F)


hexadecimal byte value





\a
		(a = any other character than the  
above,

e.g. \ and 
'.)


a





--
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs