psql-crashoutput-v1.patch

text/plain

Filename: psql-crashoutput-v1.patch
Type: text/plain
Part: 0
Message: Re: psql COPY vs. ON_ERROR_ROLLBACK, multi-command strings

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
Series: patch v1
File+
src/bin/psql/common.c 0 0
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 5c9bd96..715e231 100644
*** a/src/bin/psql/common.c
--- b/src/bin/psql/common.c
***************
*** 740,746 **** ProcessResult(PGresult **results)
  	} while (next_result);
  
  	/* may need this to recover from conn loss during COPY */
! 	if (!CheckConnection())
  		return false;
  
  	return success;
--- 740,746 ----
  	} while (next_result);
  
  	/* may need this to recover from conn loss during COPY */
! 	if (!first_cycle && !CheckConnection())
  		return false;
  
  	return success;
***************
*** 1015,1022 **** SendQuery(const char *query)
  			case PQTRANS_UNKNOWN:
  			default:
  				OK = false;
! 				psql_error("unexpected transaction status (%d)\n",
! 						   transaction_status);
  				break;
  		}
  
--- 1015,1024 ----
  			case PQTRANS_UNKNOWN:
  			default:
  				OK = false;
! 				/* PQTRANS_UNKNOWN is expected given a broken connection. */
! 				if (transaction_status != PQTRANS_UNKNOWN || ConnectionUp())
! 					psql_error("unexpected transaction status (%d)\n",
! 							   transaction_status);
  				break;
  		}