summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-03-28 01:00:30 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-03-28 01:00:30 -0400
commitd12e5bb79bb535c2df13b76cd7d01f0bb8dc8e4d (patch)
treefffb6e2f681baf125f307fc8519175bc529ecb34 /doc/src
parent499a50571c72f41bb1365970d55dae5c8afcb6ba (diff)
Code and docs review for commit 3187d6de0e5a9e805b27c48437897e8c39071d45.
Fix up check for high-bit-set characters, which provoked "comparison is always true due to limited range of data type" warnings on some compilers, and was unlike the way we do it elsewhere anyway. Fix omission of "$" from the set of valid identifier continuation characters. Get rid of sanitize_text(), which was utterly inconsistent with any other error report anywhere in the system, and wasn't even well designed on its own terms (double-quoting the result string without escaping contained double quotes doesn't seem very well thought out). Fix up error messages, which didn't follow the message style guidelines very well, and were overly specific in situations where the actual mistake might not be what they said. Improve documentation. (I started out just intending to fix the compiler warning, but the more I looked at the patch the less I liked it.)
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/func.sgml27
1 files changed, 12 insertions, 15 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index ae93e69f0d2..e6c4ee52ee1 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1823,25 +1823,22 @@
<indexterm>
<primary>parse_ident</primary>
</indexterm>
- <literal><function>parse_ident(<parameter>str</parameter> <type>text</type>,
- [ <parameter>strictmode</parameter> <type>boolean</type> DEFAULT true ] )</function></literal>
+ <literal><function>parse_ident(<parameter>qualified_identifier</parameter> <type>text</type>
+ [, <parameter>strictmode</parameter> <type>boolean</type> DEFAULT true ] )</function></literal>
</entry>
<entry><type>text[]</type></entry>
- <entry>Split <parameter>qualified identifier</parameter> into array
- <parameter>parts</parameter>. When <parameter>strictmode</parameter> is
- false, extra characters after the identifier are ignored. This is useful
- for parsing identifiers for objects like functions and arrays that may
- have trailing characters. By default, extra characters after the last
- identifier are considered an error, but if the second parameter is false,
- then the characters after the last identifier are ignored. Note that this
- function does not truncate quoted identifiers. If you care about that
- you should cast the result of this function to name[]. Non-printable
- characters (like 0 to 31) are always displayed as hexadecimal codes,
- which can be different from PostgreSQL internal SQL identifiers
- processing, when the original escaped value is displayed.
+ <entry>
+ Split <parameter>qualified_identifier</parameter> into an array of
+ identifiers, removing any quoting of individual identifiers. By
+ default, extra characters after the last identifier are considered an
+ error; but if the second parameter is <literal>false</>, then such
+ extra characters are ignored. (This behavior is useful for parsing
+ names for objects like functions.) Note that this function does not
+ truncate over-length identifiers. If you want truncation you can cast
+ the result to <type>name[]</>.
</entry>
<entry><literal>parse_ident('"SomeSchema".someTable')</literal></entry>
- <entry><literal>"SomeSchema,sometable"</literal></entry>
+ <entry><literal>{SomeSchema,sometable}</literal></entry>
</row>
<row>