public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH 2/2] fixup: rename defined to requested
22+ messages / 2 participants
[nested] [flat]

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* [PATCH 2/2] fixup: rename defined to requested
@ 2021-01-08 23:56  Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tomas Vondra @ 2021-01-08 23:56 UTC (permalink / raw)

---
 src/bin/psql/describe.c                 | 10 +--
 src/test/regress/expected/stats_ext.out | 90 ++++++++++++-------------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 46f54199fb..83084f79d0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4440,10 +4440,10 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN es.stxndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN es.stxdependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"));
@@ -4452,13 +4452,13 @@ listExtendedStats(const char *pattern, bool verbose)
 	{
 		appendPQExpBuffer(&buf,
 						  ",\nCASE WHEN esd.stxdndistinct IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'd' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxddependencies IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'f' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\", \n"
 						  "CASE WHEN esd.stxdmcv IS NOT NULL THEN 'built' \n"
-						  "     WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
+						  "     WHEN 'm' = any(es.stxkind) THEN 'requested' \n"
 						  "END AS \"%s\"",
 						  gettext_noop("Ndistinct"),
 						  gettext_noop("Dependencies"),
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 8c8a0afcf6..b3ae4de185 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -1741,9 +1741,9 @@ create statistics stts_s2.stts_yama (dependencies, mcv) on col1, col3 from stts_
 insert into stts_t1 select i,i from generate_series(1,100) i;
 analyze stts_t1;
 \dX
-                                          List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   
-----------+------------------------+--------------------------------------+-----------+--------------+---------
+                                           List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    
+----------+------------------------+--------------------------------------+-----------+--------------+-----------
  public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        | 
  public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built
  public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built
@@ -1751,70 +1751,70 @@ analyze stts_t1;
  public   | stts_1                 | a, b FROM stts_t1                    | built     |              | 
  public   | stts_2                 | a, b FROM stts_t1                    | built     | built        | 
  public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested
  tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built
 (12 rows)
 
 \dX stts_?
-                       List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   
---------+--------+-------------------+-----------+--------------+---------
+                        List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    
+--------+--------+-------------------+-----------+--------------+-----------
  public | stts_1 | a, b FROM stts_t1 | built     |              | 
  public | stts_2 | a, b FROM stts_t1 | built     | built        | 
  public | stts_3 | a, b FROM stts_t1 | built     | built        | built
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested
 (4 rows)
 
 \dX *stts_hoge
-                               List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   
---------+-----------+-------------------------------+-----------+--------------+---------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined
+                                List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    
+--------+-----------+-------------------------------+-----------+--------------+-----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested
 (1 row)
 
 \dX+
-                                                                   List of extended statistics
-  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
-----------+------------------------+--------------------------------------+-----------+--------------+---------+----------------+-------------------+------------
- public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |         |                | 106 bytes         | 
- public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built   |                |                   | 24 kB
- public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built   |                |                   | 386 bytes
- public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built   |                |                   | 294 bytes
- public   | stts_1                 | a, b FROM stts_t1                    | built     |              |         | 13 bytes       |                   | 
- public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |         | 13 bytes       | 40 bytes          | 
- public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public   | stts_4                 | b, c FROM stts_t2                    | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
- stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | defined      | defined |                | 0 bytes           | 0 bytes
- tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built   |                |                   | 686 bytes
+                                                                    List of extended statistics
+  Schema  |          Name          |              Definition              | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+----------+------------------------+--------------------------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public   | func_deps_stat         | a, b, c FROM functional_dependencies |           | built        |           |                | 106 bytes         | 
+ public   | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays        |           |              | built     |                |                   | 24 kB
+ public   | mcv_lists_bool_stats   | a, b, c FROM mcv_lists_bool          |           |              | built     |                |                   | 386 bytes
+ public   | mcv_lists_stats        | a, b, d FROM mcv_lists               |           |              | built     |                |                   | 294 bytes
+ public   | stts_1                 | a, b FROM stts_t1                    | built     |              |           | 13 bytes       |                   | 
+ public   | stts_2                 | a, b FROM stts_t1                    | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public   | stts_3                 | a, b FROM stts_t1                    | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public   | stts_4                 | b, c FROM stts_t2                    | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ public   | stts_hoge              | col1, col2, col3 FROM stts_t3        | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s1  | stts_foo               | col1, col2 FROM stts_t3              | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
+ stts_s2  | stts_yama              | col1, col3 FROM stts_t3              |           | requested    | requested |                | 0 bytes           | 0 bytes
+ tststats | priv_test_stats        | a, b FROM tststats.priv_test_tbl     |           |              | built     |                |                   | 686 bytes
 (12 rows)
 
 \dX+ stts_?
-                                                List of extended statistics
- Schema |  Name  |    Definition     | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size |  MCV_size  
---------+--------+-------------------+-----------+--------------+---------+----------------+-------------------+------------
- public | stts_1 | a, b FROM stts_t1 | built     |              |         | 13 bytes       |                   | 
- public | stts_2 | a, b FROM stts_t1 | built     | built        |         | 13 bytes       | 40 bytes          | 
- public | stts_3 | a, b FROM stts_t1 | built     | built        | built   | 13 bytes       | 40 bytes          | 6126 bytes
- public | stts_4 | b, c FROM stts_t2 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                 List of extended statistics
+ Schema |  Name  |    Definition     | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size |  MCV_size  
+--------+--------+-------------------+-----------+--------------+-----------+----------------+-------------------+------------
+ public | stts_1 | a, b FROM stts_t1 | built     |              |           | 13 bytes       |                   | 
+ public | stts_2 | a, b FROM stts_t1 | built     | built        |           | 13 bytes       | 40 bytes          | 
+ public | stts_3 | a, b FROM stts_t1 | built     | built        | built     | 13 bytes       | 40 bytes          | 6126 bytes
+ public | stts_4 | b, c FROM stts_t2 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (4 rows)
 
 \dX+ *stts_hoge
-                                                       List of extended statistics
- Schema |   Name    |          Definition           | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
---------+-----------+-------------------------------+-----------+--------------+---------+----------------+-------------------+----------
- public | stts_hoge | col1, col2, col3 FROM stts_t3 | defined   | defined      | defined | 0 bytes        | 0 bytes           | 0 bytes
+                                                        List of extended statistics
+ Schema |   Name    |          Definition           | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+--------+-----------+-------------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ public | stts_hoge | col1, col2, col3 FROM stts_t3 | requested | requested    | requested | 0 bytes        | 0 bytes           | 0 bytes
 (1 row)
 
 \dX+ stts_s2.stts_yama
-                                                    List of extended statistics
- Schema  |   Name    |       Definition        | Ndistinct | Dependencies |   MCV   | Ndistinct_size | Dependencies_size | MCV_size 
----------+-----------+-------------------------+-----------+--------------+---------+----------------+-------------------+----------
- stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | defined      | defined |                | 0 bytes           | 0 bytes
+                                                     List of extended statistics
+ Schema  |   Name    |       Definition        | Ndistinct | Dependencies |    MCV    | Ndistinct_size | Dependencies_size | MCV_size 
+---------+-----------+-------------------------+-----------+--------------+-----------+----------------+-------------------+----------
+ stts_s2 | stts_yama | col1, col3 FROM stts_t3 |           | requested    | requested |                | 0 bytes           | 0 bytes
 (1 row)
 
 drop table stts_t1, stts_t2, stts_t3;
-- 
2.26.2


--------------B0278A9E952F6668D2DBEBA1--





^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: plpgsql: variables of domain of composite types are not correctly initialized
@ 2026-02-11 21:10  Tom Lane <[email protected]>
  0 siblings, 0 replies; 22+ messages in thread

From: Tom Lane @ 2026-02-11 21:10 UTC (permalink / raw)
  To: Pavel Stehule <[email protected]>; +Cc: pgsql-hackers

Pavel Stehule <[email protected]> writes:
> I got a bug report for plpgsql_check related to domains of composite types.
> While I played with code, maybe I found a bug:

Indeed.  Looks like exec_stmt_return's special case for a simple
variable reference forgets to fill estate->rettype when the variable
is a null record.  This is an old bug, but I think we'd managed not
to notice because that value isn't consulted unless we have to cast
to a domain.

The behavior we want is what exec_eval_datum does, and after looking
at it for a minute I wondered why we don't just use exec_eval_datum
instead of duplicating logic.  The ROW case already does that, so
we can fix the bug with strictly less code.

			regards, tom lane



Attachments:

  [text/x-diff] fix-return-of-null-row.patch (1.1K, ../../[email protected]/2-fix-return-of-null-row.patch)
  download | inline diff:
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index f80264e184e..723048ab833 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -3255,28 +3255,14 @@ exec_stmt_return(PLpgSQL_execstate *estate, PLpgSQL_stmt_return *stmt)
 				}
 				break;
 
-			case PLPGSQL_DTYPE_REC:
-				{
-					PLpgSQL_rec *rec = (PLpgSQL_rec *) retvar;
-
-					/* If record is empty, we return NULL not a row of nulls */
-					if (rec->erh && !ExpandedRecordIsEmpty(rec->erh))
-					{
-						estate->retval = ExpandedRecordGetDatum(rec->erh);
-						estate->retisnull = false;
-						estate->rettype = rec->rectypeid;
-					}
-				}
-				break;
-
 			case PLPGSQL_DTYPE_ROW:
+			case PLPGSQL_DTYPE_REC:
 				{
-					PLpgSQL_row *row = (PLpgSQL_row *) retvar;
+					/* exec_eval_datum can handle these cases */
 					int32		rettypmod;
 
-					/* We get here if there are multiple OUT parameters */
 					exec_eval_datum(estate,
-									(PLpgSQL_datum *) row,
+									retvar,
 									&estate->rettype,
 									&rettypmod,
 									&estate->retval,


^ permalink  raw  reply  [nested|flat] 22+ messages in thread


end of thread, other threads:[~2026-02-11 21:10 UTC | newest]

Thread overview: 22+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2021-01-08 23:56 [PATCH 2/2] fixup: rename defined to requested Tomas Vondra <[email protected]>
2026-02-11 21:10 Re: plpgsql: variables of domain of composite types are not correctly initialized Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox