read-only-3a.patch

text/plain

Filename: read-only-3a.patch
Type: text/plain
Part: 0
Message: Re: serializable read only deferrable

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: context
File+
src/backend/commands/variable.c 4 0
*** a/src/backend/commands/variable.c
--- b/src/backend/commands/variable.c
***************
*** 564,570 **** assign_transaction_read_only(bool newval, bool doit, GucSource source)
  			return false;
  		}
  		/* Top level transaction can't change this after first snapshot. */
! 		else if (FirstSnapshotSet && !IsSubTransaction())
  		{
  			ereport(GUC_complaint_elevel(source),
  					(errcode(ERRCODE_ACTIVE_SQL_TRANSACTION),
--- 564,570 ----
  			return false;
  		}
  		/* Top level transaction can't change this after first snapshot. */
! 		if (FirstSnapshotSet && !IsSubTransaction())
  		{
  			ereport(GUC_complaint_elevel(source),
  					(errcode(ERRCODE_ACTIVE_SQL_TRANSACTION),
***************
*** 572,578 **** assign_transaction_read_only(bool newval, bool doit, GucSource source)
  			return false;
  		}
  		/* Can't go to r/w mode while recovery is still active */
! 		else if (newval == false && XactReadOnly && RecoveryInProgress())
  		{
  			ereport(GUC_complaint_elevel(source),
  					(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
--- 572,578 ----
  			return false;
  		}
  		/* Can't go to r/w mode while recovery is still active */
! 		if (newval == false && XactReadOnly && RecoveryInProgress())
  		{
  			ereport(GUC_complaint_elevel(source),
  					(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
***************
*** 602,609 **** assign_XactIsoLevel(const char *value, bool doit, GucSource source)
  					 errmsg("SET TRANSACTION ISOLATION LEVEL must be called before any query")));
  			return NULL;
  		}
! 		else if (IsSubTransaction()
! 				 && strcmp(value, XactIsoLevel_string) != 0)
  		{
  			ereport(GUC_complaint_elevel(source),
  					(errcode(ERRCODE_ACTIVE_SQL_TRANSACTION),
--- 602,609 ----
  					 errmsg("SET TRANSACTION ISOLATION LEVEL must be called before any query")));
  			return NULL;
  		}
! 		/* We ignore a subtransaction setting it to the existing value. */
! 		if (IsSubTransaction() && strcmp(value, XactIsoLevel_string) != 0)
  		{
  			ereport(GUC_complaint_elevel(source),
  					(errcode(ERRCODE_ACTIVE_SQL_TRANSACTION),