mirror of
https://github.com/postgres/postgres.git
synced 2025-08-09 17:03:00 +03:00
Perform line wrapping and indenting by default in ruleutils.c.
This patch changes pg_get_viewdef() and allied functions so that PRETTY_INDENT processing is always enabled. Per discussion, only the PRETTY_PAREN processing (that is, stripping of "unnecessary" parentheses) poses any real forward-compatibility risk, so we may as well make dump output look as nice as we safely can. Also, set the default wrap length to zero (i.e, wrap after each SELECT or FROM list item), since there's no very principled argument for the former default of 80-column wrapping, and most people seem to agree this way looks better. Marko Tiikkaja, reviewed by Jeevan Chalke, further hacking by Tom Lane
This commit is contained in:
@@ -13872,8 +13872,7 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
||||
<row>
|
||||
<entry><literal><function>pg_get_viewdef(<parameter>view_name</parameter>, <parameter>pretty_bool</>)</function></literal></entry>
|
||||
<entry><type>text</type></entry>
|
||||
<entry>get underlying <command>SELECT</command> command for view;
|
||||
lines with fields are wrapped to 80 columns if <parameter>pretty_bool</parameter> is true (<emphasis>deprecated</emphasis>)</entry>
|
||||
<entry>get underlying <command>SELECT</command> command for view (<emphasis>deprecated</emphasis>)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal><function>pg_get_viewdef(<parameter>view_oid</parameter>)</function></literal></entry>
|
||||
@@ -13883,15 +13882,14 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
||||
<row>
|
||||
<entry><literal><function>pg_get_viewdef(<parameter>view_oid</parameter>, <parameter>pretty_bool</>)</function></literal></entry>
|
||||
<entry><type>text</type></entry>
|
||||
<entry>get underlying <command>SELECT</command> command for view;
|
||||
lines with fields are wrapped to 80 columns if <parameter>pretty_bool</parameter> is true</entry>
|
||||
<entry>get underlying <command>SELECT</command> command for view</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal><function>pg_get_viewdef(<parameter>view_oid</parameter>, <parameter>wrap_column_int</>)</function></literal></entry>
|
||||
<entry><type>text</type></entry>
|
||||
<entry>get underlying <command>SELECT</command> command for view;
|
||||
lines with fields are wrapped to specified number of columns,
|
||||
pretty printing is implied</entry>
|
||||
pretty-printing is implied</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal><function>pg_options_to_table(<parameter>reloptions</parameter>)</function></literal></entry>
|
||||
|
Reference in New Issue
Block a user