doc: Clarify that pg_attrdef also stores generation expressions

This was documented with pg_attribute but not with pg_attrdef.

Reported-by: jian he <jian.universality@gmail.com>
Discussion: https://www.postgresql.org/message-id/CACJufxE+E-iYmBnZVZHiYA+WpyZZVv7BfiBLpo=T70EZHDU9rw@mail.gmail.com
This commit is contained in:
Peter Eisentraut 2024-07-01 08:39:07 +02:00
parent 2357c9223b
commit da486d3601

View File

@ -1032,10 +1032,11 @@
<para> <para>
The catalog <structname>pg_attrdef</structname> stores column default The catalog <structname>pg_attrdef</structname> stores column default
values. The main information about columns is stored in expressions and generation expressions. The main information about columns
<link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>. is stored in <link
Only columns for which a default value has been explicitly set will have linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.
an entry here. Only columns for which a default expression or generation expression has
been explicitly set will have an entry here.
</para> </para>
<table> <table>
@ -1087,7 +1088,7 @@
<structfield>adbin</structfield> <type>pg_node_tree</type> <structfield>adbin</structfield> <type>pg_node_tree</type>
</para> </para>
<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 representation. Use <literal>pg_get_expr(adbin, adrelid)</literal> to
convert it to an SQL expression. convert it to an SQL expression.
</para></entry> </para></entry>