Locking a table read-only temporarilty

From: Digimer <lists(at)alteeve(dot)ca>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Locking a table read-only temporarilty
Date: 2022-03-31 19:20:13
Message-ID: 90ea94e3-7021-7d94-66ad-8b62b030a700@alteeve.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi all,</p>
<p>  I've been looking up locking, and perhaps I'm being dense, but
I'm struggling to figure out how to create a lock to make a table
read-only for a short period of time.</p>
<p>  I want to set a table to be read-only, so that any other
clients that try to UPDATE or INSERT will hold until the lock is
released. I've been reading;</p>
<p><a class="moz-txt-link-freetext" href="https://www.postgresql.org/docs/10/explicit-locking.html">https://www.postgresql.org/docs/10/explicit-locking.html</a></p>
<p>  But I'm not sure which lock would be what I want, and I don't
see how to release the lock when finished. Could someone hit me
with a clue-stick?</p>
<p>Thanks!</p>
<pre class="moz-signature" cols="72">--
Digimer
Papers and Projects: <a class="moz-txt-link-freetext" href="https://alteeve.com/w/">https://alteeve.com/w/</a>
"I am, somehow, less interested in the weight and convolutions of Einstein’s brain than in the near certainty that people of equal talent have lived and died in cotton fields and sweatshops." - Stephen Jay Gould</pre>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 1.2 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniele Varrazzo 2022-04-01 01:22:05 Does PGDG apt repository support ARM64?
Previous Message Stephen Frost 2022-03-31 16:59:44 Re: PG12: Any drawback of increasing wal_keep_segments