@ -3,7 +3,7 @@
*
*
* Copyright ( c ) 2000 - 2009 , PostgreSQL Global Development Group
* Copyright ( c ) 2000 - 2009 , PostgreSQL Global Development Group
*
*
* $ PostgreSQL : pgsql / src / bin / psql / command . c , v 1.206 2009 / 06 / 11 14 : 49 : 07 momjian Exp $
* $ PostgreSQL : pgsql / src / bin / psql / command . c , v 1.206 .2 .1 2010 / 03 / 09 01 : 10 : 23 momjian Exp $
*/
*/
# include "postgres_fe.h"
# include "postgres_fe.h"
# include "command.h"
# include "command.h"
@ -1688,10 +1688,28 @@ process_file(char *filename, bool single_txn)
pset . inputfile = filename ;
pset . inputfile = filename ;
if ( single_txn )
if ( single_txn )
res = PSQLexec ( " BEGIN " , false ) ;
{
if ( ( res = PSQLexec ( " BEGIN " , false ) ) = = NULL )
{
if ( pset . on_error_stop )
return EXIT_USER ;
}
else
PQclear ( res ) ;
}
result = MainLoop ( fd ) ;
result = MainLoop ( fd ) ;
if ( single_txn )
if ( single_txn )
res = PSQLexec ( " COMMIT " , false ) ;
{
if ( ( res = PSQLexec ( " COMMIT " , false ) ) = = NULL )
{
if ( pset . on_error_stop )
return EXIT_USER ;
}
else
PQclear ( res ) ;
}
fclose ( fd ) ;
fclose ( fd ) ;
pset . inputfile = oldfilename ;
pset . inputfile = oldfilename ;