doc: Clarify that pg_attrdef also stores generation expressions
authorPeter Eisentraut <[email protected]>
Mon, 1 Jul 2024 06:39:07 +0000 (08:39 +0200)
committerPeter Eisentraut <[email protected]>
Mon, 1 Jul 2024 06:39:07 +0000 (08:39 +0200)
This was documented with pg_attribute but not with pg_attrdef.

Reported-by: jian he <[email protected]>
Discussion: https://www.postgresql.org/message-id/CACJufxE+E-iYmBnZVZHiYA+WpyZZVv7BfiBLpo=T70EZHDU9rw@mail.gmail.com

doc/src/sgml/catalogs.sgml

index dd61e057b21b27e3cf68e08da6a4a804f3e359a4..b654fae1b2f60389929a01519a7c3273047cc15e 100644 (file)
 
   <para>
    The catalog <structname>pg_attrdef</structname> stores column default
-   values.  The main information about columns is stored in
-   <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.
-   Only columns for which a default value has been explicitly set will have
-   an entry here.
+   expressions and generation expressions.  The main information about columns
+   is stored in <link
+   linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.
+   Only columns for which a default expression or generation expression has
+   been explicitly set will have an entry here.
   </para>
 
   <table>
        <structfield>adbin</structfield> <type>pg_node_tree</type>
       </para>
       <para>
-       The column default value, in <function>nodeToString()</function>
+       The column default or generation expression, in <function>nodeToString()</function>
        representation.  Use <literal>pg_get_expr(adbin, adrelid)</literal> to
        convert it to an SQL expression.
       </para></entry>