<div dir="ltr"><div dir="ltr">On Mon, 7 Oct 2019 at 13:17, Christopher Browne &lt;<a href="mailto:cbbrowne@gmail.com">cbbrowne@gmail.com</a>&gt; wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">The way I&#39;d be inclined to adopt it would be as follows...<div class="gmail_quote"><div><br></div><div>-  slon should check to see if lock_timeout is available (looking in pg_catalog.pg_settings where name=&#39;lock_timeout&#39;)&#39;</div><div>   - this is probably mostly localized to the function logswitch_finish()<br></div><div>-  if not, then stay with the current NOWAIT behaviour<br></div><div>-  if available, then set lock_timeout and attempt without NOWAIT</div><div>   - open question: what&#39;s the apropos lock_timeout time?  Probably configurable, perhaps that points to a new config parameter to add to confoptions.h and confoptions.c<br></div><div><br></div><div>It doesn&#39;t seem like either an enormous change or an awfully risky one.</div></div></div></blockquote><div><br></div><div>It&#39;s *somewhat* worse than that; setting lock_timeout to a low-ish value would risk letting other activities timeout, so we&#39;d only want want the timeout shortened for this query.  Definitely more fiddly than I was first thinking.<br></div></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">When confronted by a difficult problem, solve it by reducing it to the<br>question, &quot;How would the Lone Ranger handle this?&quot;<br></div></div>