0001-Rename-pgstatapprox-to-pgstattuple_approx.patch
text/x-diff
Filename: 0001-Rename-pgstatapprox-to-pgstattuple_approx.patch
Type: text/x-diff
Part: 0
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 0001
| File | + | − |
|---|---|---|
| contrib/pgstattuple/pgstatapprox.c | 2 | 2 |
| contrib/pgstattuple/pgstattuple--1.2--1.3.sql | 2 | 2 |
| contrib/pgstattuple/pgstattuple--1.3.sql | 2 | 2 |
| doc/src/sgml/pgstattuple.sgml | 6 | 6 |
>From 57d597f176294ebfe30efa6d73569505cbb41e31 Mon Sep 17 00:00:00 2001
From: Abhijit Menon-Sen <ams@2ndQuadrant.com>
Date: Wed, 13 May 2015 09:19:07 +0530
Subject: Rename pgstatapprox to pgstattuple_approx
---
contrib/pgstattuple/pgstatapprox.c | 4 ++--
contrib/pgstattuple/pgstattuple--1.2--1.3.sql | 4 ++--
contrib/pgstattuple/pgstattuple--1.3.sql | 4 ++--
doc/src/sgml/pgstattuple.sgml | 12 ++++++------
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/contrib/pgstattuple/pgstatapprox.c b/contrib/pgstattuple/pgstatapprox.c
index 46f5bc0..f3b5671 100644
--- a/contrib/pgstattuple/pgstatapprox.c
+++ b/contrib/pgstattuple/pgstatapprox.c
@@ -21,7 +21,7 @@
#include "utils/tqual.h"
#include "commands/vacuum.h"
-PG_FUNCTION_INFO_V1(pgstatapprox);
+PG_FUNCTION_INFO_V1(pgstattuple_approx);
typedef struct output_type
{
@@ -234,7 +234,7 @@ build_tuple(output_type *stat, FunctionCallInfo fcinfo)
*/
Datum
-pgstatapprox(PG_FUNCTION_ARGS)
+pgstattuple_approx(PG_FUNCTION_ARGS)
{
Oid relid = PG_GETARG_OID(0);
Relation rel;
diff --git a/contrib/pgstattuple/pgstattuple--1.2--1.3.sql b/contrib/pgstattuple/pgstattuple--1.2--1.3.sql
index bfcf464..99301a2 100644
--- a/contrib/pgstattuple/pgstattuple--1.2--1.3.sql
+++ b/contrib/pgstattuple/pgstattuple--1.2--1.3.sql
@@ -3,7 +3,7 @@
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION pgstattuple UPDATE TO '1.3'" to load this file. \quit
-CREATE FUNCTION pgstatapprox(IN reloid regclass,
+CREATE FUNCTION pgstattuple_approx(IN reloid regclass,
OUT table_len BIGINT, -- physical table length in bytes
OUT scanned_percent FLOAT8, -- what percentage of the table's pages was scanned
OUT approx_tuple_count BIGINT, -- estimated number of live tuples
@@ -14,5 +14,5 @@ CREATE FUNCTION pgstatapprox(IN reloid regclass,
OUT dead_tuple_percent FLOAT8, -- dead tuples in % (based on estimate)
OUT approx_free_space BIGINT, -- estimated free space in bytes
OUT approx_free_percent FLOAT8) -- free space in % (based on estimate)
-AS 'MODULE_PATHNAME', 'pgstatapprox'
+AS 'MODULE_PATHNAME', 'pgstattuple_approx'
LANGUAGE C STRICT;
diff --git a/contrib/pgstattuple/pgstattuple--1.3.sql b/contrib/pgstattuple/pgstattuple--1.3.sql
index f69b619..f3996e7 100644
--- a/contrib/pgstattuple/pgstattuple--1.3.sql
+++ b/contrib/pgstattuple/pgstattuple--1.3.sql
@@ -80,7 +80,7 @@ LANGUAGE C STRICT;
/* New stuff in 1.3 begins here */
-CREATE FUNCTION pgstatapprox(IN reloid regclass,
+CREATE FUNCTION pgstattuple_approx(IN reloid regclass,
OUT table_len BIGINT, -- physical table length in bytes
OUT scanned_percent FLOAT8, -- what percentage of the table's pages was scanned
OUT approx_tuple_count BIGINT, -- estimated number of live tuples
@@ -91,5 +91,5 @@ CREATE FUNCTION pgstatapprox(IN reloid regclass,
OUT dead_tuple_percent FLOAT8, -- dead tuples in % (based on estimate)
OUT approx_free_space BIGINT, -- estimated free space in bytes
OUT approx_free_percent FLOAT8) -- free space in % (based on estimate)
-AS 'MODULE_PATHNAME', 'pgstatapprox'
+AS 'MODULE_PATHNAME', 'pgstattuple_approx'
LANGUAGE C STRICT;
diff --git a/doc/src/sgml/pgstattuple.sgml b/doc/src/sgml/pgstattuple.sgml
index 4cba006..cca6dc9 100644
--- a/doc/src/sgml/pgstattuple.sgml
+++ b/doc/src/sgml/pgstattuple.sgml
@@ -361,19 +361,19 @@ pending_tuples | 0
<varlistentry>
<term>
<indexterm>
- <primary>pgstatapprox</primary>
+ <primary>pgstattuple_approx</primary>
</indexterm>
- <function>pgstatapprox(regclass) returns record</>
+ <function>pgstattuple_approx(regclass) returns record</>
</term>
<listitem>
<para>
- <function>pgstatapprox</function> is a faster alternative to
+ <function>pgstattuple_approx</function> is a faster alternative to
<function>pgstattuple</function> that returns approximate results.
The argument is the target relation's OID.
For example:
<programlisting>
-test=> SELECT * FROM pgstatapprox('pg_catalog.pg_proc'::regclass);
+test=> SELECT * FROM pgstattuple_approx('pg_catalog.pg_proc'::regclass);
-[ RECORD 1 ]--------+-------
table_len | 573440
scanned_percent | 2
@@ -392,7 +392,7 @@ approx_free_percent | 2.09
<para>
Whereas <function>pgstattuple</function> always performs a
full-table scan and returns an exact count of live and dead tuples
- (and their sizes) and free space, <function>pgstatapprox</function>
+ (and their sizes) and free space, <function>pgstattuple_approx</function>
tries to avoid the full-table scan and returns exact dead tuple
statistics along with an approximation of the number and
size of live tuples and free space.
@@ -416,7 +416,7 @@ approx_free_percent | 2.09
</para>
<table id="pgstatapprox-columns">
- <title><function>pgstatapprox</function> Output Columns</title>
+ <title><function>pgstattuple_approx</function> Output Columns</title>
<tgroup cols="3">
<thead>
<row>
--
1.9.1