Small doc tweak for array/string functions

Started by Ian Barwickabout 7 years ago2 messages
#1Ian Barwick
ian.barwick@2ndquadrant.com
1 attachment(s)

Hi

On these pages:

- https://www.postgresql.org/docs/current/functions-array.html
- https://www.postgresql.org/docs/current/functions-string.html

we point out via "See also" the existence of aggregate array and string
functions, but I think it would be useful to also mention the existence
of string-related array functions and array-related string (regexp) functions
respectively.

(Background: due to brain fade I was looking on the array functions page
for the array-related function whose name was escaping me which does something
with regexes to make an array, and was puzzled to find no reference on that page).

Regards

Ian Barwick

--
Ian Barwick http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachments:

doc-array-string-funcs-see-also-v1.patchtext/x-patch; name=doc-array-string-funcs-see-also-v1.patchDownload
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
new file mode 100644
index 3786099..1684189
*** a/doc/src/sgml/func.sgml
--- b/doc/src/sgml/func.sgml
***************
*** 2363,2369 ****
  
     <para>
     See also the aggregate function <function>string_agg</function> in
!    <xref linkend="functions-aggregate"/>.
     </para>
  
     <table id="conversion-names">
--- 2363,2371 ----
  
     <para>
     See also the aggregate function <function>string_agg</function> in
!    <xref linkend="functions-aggregate"/>, and the array functions
!    <function>array_to_string</function> and <function>string_to_array</function>
!    in <xref linkend="functions-array"/>.
     </para>
  
     <table id="conversion-names">
*************** NULL baz</literallayout>(3 rows)</entry>
*** 13163,13169 ****
  
     <para>
      See also <xref linkend="functions-aggregate"/> about the aggregate
!     function <function>array_agg</function> for use with arrays.
     </para>
    </sect1>
  
--- 13165,13173 ----
  
     <para>
      See also <xref linkend="functions-aggregate"/> about the aggregate
!     function <function>array_agg</function> for use with arrays, and
!     <xref linkend="functions-string"/> about the regular expression function
!     <function>regexp_split_to_array</function>.
     </para>
    </sect1>
  
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ian Barwick (#1)
Re: Small doc tweak for array/string functions

Ian Barwick <ian.barwick@2ndquadrant.com> writes:

On these pages:
- https://www.postgresql.org/docs/current/functions-array.html
- https://www.postgresql.org/docs/current/functions-string.html
we point out via "See also" the existence of aggregate array and string
functions, but I think it would be useful to also mention the existence
of string-related array functions and array-related string (regexp) functions
respectively.

Hmm. The existing cross-references there feel a bit ad-hoc to me already,
and the proposed additions even more so. Surely we don't want to conclude
that every function that takes or returns an array needs to be cited on
the functions-array page; and that idea would be even sillier if applied
to strings. How can we define a less spur-of-the-moment approach to
deciding what to list?

The patch as shown might be just fine, but I'd like to have some rationale
for which things we're listing or not listing.

regards, tom lane