summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/html/pgsurgery.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
commit293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch)
treefc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /doc/src/sgml/html/pgsurgery.html
parentInitial commit. (diff)
downloadpostgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz
postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/src/sgml/html/pgsurgery.html')
-rw-r--r--doc/src/sgml/html/pgsurgery.html69
1 files changed, 69 insertions, 0 deletions
diff --git a/doc/src/sgml/html/pgsurgery.html b/doc/src/sgml/html/pgsurgery.html
new file mode 100644
index 0000000..1fc89a8
--- /dev/null
+++ b/doc/src/sgml/html/pgsurgery.html
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>F.34. pg_surgery — perform low-level surgery on relation data</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="pgstattuple.html" title="F.33. pgstattuple — obtain tuple-level statistics" /><link rel="next" href="pgtrgm.html" title="F.35. pg_trgm — support for similarity of text using trigram matching" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">F.34. pg_surgery — perform low-level surgery on relation data</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="pgstattuple.html" title="F.33. pgstattuple — obtain tuple-level statistics">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules and Extensions">Up</a></td><th width="60%" align="center">Appendix F. Additional Supplied Modules and Extensions</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.2 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="pgtrgm.html" title="F.35. pg_trgm —&#10; support for similarity of text using trigram matching">Next</a></td></tr></table><hr /></div><div class="sect1" id="PGSURGERY"><div class="titlepage"><div><div><h2 class="title" style="clear: both">F.34. pg_surgery — perform low-level surgery on relation data <a href="#PGSURGERY" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="pgsurgery.html#PGSURGERY-FUNCS">F.34.1. Functions</a></span></dt><dt><span class="sect2"><a href="pgsurgery.html#PGSURGERY-AUTHORS">F.34.2. Authors</a></span></dt></dl></div><a id="id-1.11.7.44.2" class="indexterm"></a><p>
+ The <code class="filename">pg_surgery</code> module provides various functions to
+ perform surgery on a damaged relation. These functions are unsafe by design
+ and using them may corrupt (or further corrupt) your database. For example,
+ these functions can easily be used to make a table inconsistent with its
+ own indexes, to cause <code class="literal">UNIQUE</code> or
+ <code class="literal">FOREIGN KEY</code> constraint violations, or even to make
+ tuples visible which, when read, will cause a database server crash.
+ They should be used with great caution and only as a last resort.
+ </p><div class="sect2" id="PGSURGERY-FUNCS"><div class="titlepage"><div><div><h3 class="title">F.34.1. Functions <a href="#PGSURGERY-FUNCS" class="id_link">#</a></h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">
+ <code class="function">heap_force_kill(regclass, tid[]) returns void</code>
+ </span></dt><dd><p>
+ <code class="function">heap_force_kill</code> marks <span class="quote">“<span class="quote">used</span>”</span> line
+ pointers as <span class="quote">“<span class="quote">dead</span>”</span> without examining the tuples. The
+ intended use of this function is to forcibly remove tuples that are not
+ otherwise accessible. For example:
+</p><pre class="programlisting">
+test=&gt; select * from t1 where ctid = '(0, 1)';
+ERROR: could not access status of transaction 4007513275
+DETAIL: Could not open file "pg_xact/0EED": No such file or directory.
+
+test=# select heap_force_kill('t1'::regclass, ARRAY['(0, 1)']::tid[]);
+ heap_force_kill
+-----------------
+
+(1 row)
+
+test=# select * from t1 where ctid = '(0, 1)';
+(0 rows)
+
+</pre><p>
+ </p></dd><dt><span class="term">
+ <code class="function">heap_force_freeze(regclass, tid[]) returns void</code>
+ </span></dt><dd><p>
+ <code class="function">heap_force_freeze</code> marks tuples as frozen without
+ examining the tuple data. The intended use of this function is to
+ make accessible tuples which are inaccessible due to corrupted
+ visibility information, or which prevent the table from being
+ successfully vacuumed due to corrupted visibility information.
+ For example:
+</p><pre class="programlisting">
+test=&gt; vacuum t1;
+ERROR: found xmin 507 from before relfrozenxid 515
+CONTEXT: while scanning block 0 of relation "public.t1"
+
+test=# select ctid from t1 where xmin = 507;
+ ctid
+-------
+ (0,3)
+(1 row)
+
+test=# select heap_force_freeze('t1'::regclass, ARRAY['(0, 3)']::tid[]);
+ heap_force_freeze
+-------------------
+
+(1 row)
+
+test=# select ctid from t1 where xmin = 2;
+ ctid
+-------
+ (0,3)
+(1 row)
+
+</pre><p>
+ </p></dd></dl></div></div><div class="sect2" id="PGSURGERY-AUTHORS"><div class="titlepage"><div><div><h3 class="title">F.34.2. Authors <a href="#PGSURGERY-AUTHORS" class="id_link">#</a></h3></div></div></div><p>
+ Ashutosh Sharma <code class="email">&lt;<a class="email" href="mailto:ashu.coek88@gmail.com">ashu.coek88@gmail.com</a>&gt;</code>
+ </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pgstattuple.html" title="F.33. pgstattuple — obtain tuple-level statistics">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules and Extensions">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="pgtrgm.html" title="F.35. pg_trgm —&#10; support for similarity of text using trigram matching">Next</a></td></tr><tr><td width="40%" align="left" valign="top">F.33. pgstattuple — obtain tuple-level statistics </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.2 Documentation">Home</a></td><td width="40%" align="right" valign="top"> F.35. pg_trgm —
+ support for similarity of text using trigram matching</td></tr></table></div></body></html> \ No newline at end of file