Clarification of when it's not appropriate to use this option.

-- 
  Simon Riggs             
  EnterpriseDB   http://www.enterprisedb.com

Index: doc/src/sgml/ref/psql-ref.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v
retrieving revision 1.172
diff -c -r1.172 psql-ref.sgml
*** doc/src/sgml/ref/psql-ref.sgml	23 Oct 2006 18:10:32 -0000	1.172
--- doc/src/sgml/ref/psql-ref.sgml	30 Oct 2006 22:07:39 -0000
***************
*** 472,480 ****
          <option>-f</> option, adding this option wraps
          <command>BEGIN</>/<command>COMMIT</> around the script to execute it
          as a single transaction.  This ensures that either all the commands
!         complete successfully, or no changes are applied.  (However, if the
!         script itself uses <command>BEGIN</> or <command>COMMIT</>, this
!         option will not have the desired effect!)
         </para>
        </listitem>
       </varlistentry>
--- 472,492 ----
          <option>-f</> option, adding this option wraps
          <command>BEGIN</>/<command>COMMIT</> around the script to execute it
          as a single transaction.  This ensures that either all the commands
!         complete successfully, or no changes are applied.  
!        </para>
!        <para>
!         However, if the script itself uses <command>BEGIN</> or <command>COMMIT</>, or if 
!         any of the following commands occur in the script, then this option will simply
!         cause all changes to fail: <command>CREATE/DROP DATABASE</>, 
!         <command>CREATE/DROP TABLESPACE</>, <command>CLUSTER</> of multiple tables, 
!         <command>REINDEX DATABASE</>, <command>VACUUM</>, <command>COMMIT PREPARED</>
!         or <command>ROLLBACK PREPARED</>.
!        </para>
!        <para>
!         You are advised to set the following variable when using this option:
! <programlisting>
! \set ON_ERROR_STOP
! </programlisting>
         </para>
        </listitem>
       </varlistentry>
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to