blob: 1948509e896b43bd5992c477ea5d6367f8e2984c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
--
-- Test assorted system views
--
-- This test is mainly meant to provide some code coverage for the
-- set-returning functions that underlie certain system views.
-- The output of most of these functions is very environment-dependent,
-- so our ability to test with fixed expected output is pretty limited;
-- but even a trivial check of count(*) will exercise the normal code path
-- through the SRF.
select count(*) >= 0 as ok from pg_available_extension_versions;
ok
----
t
(1 row)
select count(*) >= 0 as ok from pg_available_extensions;
ok
----
t
(1 row)
-- At introduction, pg_config had 23 entries; it may grow
select count(*) > 20 as ok from pg_config;
ok
----
t
(1 row)
-- We expect no cursors in this test; see also portals.sql
select count(*) = 0 as ok from pg_cursors;
ok
----
t
(1 row)
select count(*) >= 0 as ok from pg_file_settings;
ok
----
t
(1 row)
-- There will surely be at least one rule
select count(*) > 0 as ok from pg_hba_file_rules;
ok
----
t
(1 row)
-- There will surely be at least one active lock
select count(*) > 0 as ok from pg_locks;
ok
----
t
(1 row)
-- We expect no prepared statements in this test; see also prepare.sql
select count(*) = 0 as ok from pg_prepared_statements;
ok
----
t
(1 row)
-- See also prepared_xacts.sql
select count(*) >= 0 as ok from pg_prepared_xacts;
ok
----
t
(1 row)
-- This is to record the prevailing planner enable_foo settings during
-- a regression test run.
select name, setting from pg_settings where name like 'enable%';
name | setting
------------------------------+---------
enable_bitmapscan | on
enable_datanode_row_triggers | off
enable_fast_query_shipping | on
enable_gathermerge | on
enable_hashagg | on
enable_hashjoin | on
enable_indexonlyscan | on
enable_indexscan | on
enable_material | on
enable_mergejoin | on
enable_nestloop | on
enable_seqscan | on
enable_sort | on
enable_tidscan | on
(14 rows)
-- Test that the pg_timezone_names and pg_timezone_abbrevs views are
-- more-or-less working. We can't test their contents in any great detail
-- without the outputs changing anytime IANA updates the underlying data,
-- but it seems reasonable to expect at least one entry per major meridian.
-- (At the time of writing, the actual counts are around 38 because of
-- zones using fractional GMT offsets, so this is a pretty loose test.)
select count(distinct utc_offset) >= 24 as ok from pg_timezone_names;
ok
----
t
(1 row)
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
ok
----
t
(1 row)
-- Let's check the non-default timezone abbreviation sets, too
set timezone_abbreviations = 'Australia';
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
ok
----
t
(1 row)
set timezone_abbreviations = 'India';
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
ok
----
t
(1 row)
|