at1.2-doc-set-data-type.patch

text/plain

Filename: at1.2-doc-set-data-type.patch
Type: text/plain
Part: 1
Message: Re: ALTER TYPE 2: skip already-provable no-work rewrites

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
doc/src/sgml/ref/alter_foreign_table.sgml 0 0
diff --git a/doc/src/sgml/ref/alter_foreign_table.sgml b/doc/src/sgml/ref/alter_foreign_table.sgml
index 9d14b19..c2ebdac 100644
*** a/doc/src/sgml/ref/alter_foreign_table.sgml
--- b/doc/src/sgml/ref/alter_foreign_table.sgml
***************
*** 264,270 **** ALTER FOREIGN TABLE <replaceable class="PARAMETER">name</replaceable>
      added or removed with <literal>ADD COLUMN</literal> or
      <literal>DROP COLUMN</literal>, a system <literal>oid</> column is added
      or removed, a <literal>CHECK</> or <literal>NOT NULL</> constraint is
!     added, or column type is changed with <literal>ALTER TYPE</>.  It is the
      user's responsibility to ensure that the table definition matches the
      remote side.
     </para>
--- 264,270 ----
      added or removed with <literal>ADD COLUMN</literal> or
      <literal>DROP COLUMN</literal>, a system <literal>oid</> column is added
      or removed, a <literal>CHECK</> or <literal>NOT NULL</> constraint is
!     added, or column type is changed with <literal>SET DATA TYPE</>.  It is the
      user's responsibility to ensure that the table definition matches the
      remote side.
     </para>
diff --git a/doc/src/sgml/ref/alter_table.sgml bindex 17a1d34..5c94a9f 100644
*** a/doc/src/sgml/ref/alter_table.sgml
--- b/doc/src/sgml/ref/alter_table.sgml
***************
*** 719,725 **** ALTER TABLE <replaceable class="PARAMETER">name</replaceable>
     </para>
  
     <para>
!     The fact that <literal>ALTER TYPE</> requires rewriting the whole table
      is sometimes an advantage, because the rewriting process eliminates
      any dead space in the table.  For example, to reclaim the space occupied
      by a dropped column immediately, the fastest way is:
--- 719,725 ----
     </para>
  
     <para>
!     The fact that <literal>SET DATA TYPE</> requires rewriting the whole table
      is sometimes an advantage, because the rewriting process eliminates
      any dead space in the table.  For example, to reclaim the space occupied
      by a dropped column immediately, the fastest way is:
***************
*** 734,748 **** ALTER TABLE table ALTER COLUMN anycol TYPE anytype;
     </para>
  
     <para>
!     The <literal>USING</literal> option of <literal>ALTER TYPE</> can actually
      specify any expression involving the old values of the row; that is, it
      can refer to other columns as well as the one being converted.  This allows
!     very general conversions to be done with the <literal>ALTER TYPE</>
      syntax.  Because of this flexibility, the <literal>USING</literal>
      expression is not applied to the column's default value (if any); the
      result might not be a constant expression as required for a default.
      This means that when there is no implicit or assignment cast from old to
!     new type, <literal>ALTER TYPE</> might fail to convert the default even
      though a <literal>USING</literal> clause is supplied.  In such cases,
      drop the default with <literal>DROP DEFAULT</>, perform the <literal>ALTER
      TYPE</>, and then use <literal>SET DEFAULT</> to add a suitable new
--- 734,748 ----
     </para>
  
     <para>
!     The <literal>USING</literal> option of <literal>SET DATA TYPE</> can actually
      specify any expression involving the old values of the row; that is, it
      can refer to other columns as well as the one being converted.  This allows
!     very general conversions to be done with the <literal>SET DATA TYPE</>
      syntax.  Because of this flexibility, the <literal>USING</literal>
      expression is not applied to the column's default value (if any); the
      result might not be a constant expression as required for a default.
      This means that when there is no implicit or assignment cast from old to
!     new type, <literal>SET DATA TYPE</> might fail to convert the default even
      though a <literal>USING</literal> clause is supplied.  In such cases,
      drop the default with <literal>DROP DEFAULT</>, perform the <literal>ALTER
      TYPE</>, and then use <literal>SET DEFAULT</> to add a suitable new