From 3187d6de0e5a9e805b27c48437897e8c39071d45 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Fri, 18 Mar 2016 18:16:14 +0300 Subject: Introduce parse_ident() SQL-layer function to split qualified identifier into array parts. Author: Pavel Stehule with minor editorization by me and Jim Nasby --- doc/src/sgml/func.sgml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 000489d961b..918356c075d 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1818,6 +1818,32 @@ 900150983cd24fb0 d6963f7d28e17f72 + + + + parse_ident + + parse_ident(str text, + [ strictmode boolean DEFAULT true ] ) + + text[] + Split qualified identifier into array + parts. When strictmode 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 second parameter is false, + then chararacters after 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[]. A non-printable + chararacters (like 0 to 31) are displayed as hexadecimal codes always, + what can be different from PostgreSQL internal SQL identifiers + processing, when the original escaped value is displayed. + + parse_ident('"SomeSchema".someTable') + "SomeSchema,sometable" + + -- cgit v1.2.3