PROD [postgres@whdcpsql005 ~]# psql psql (15.4) Type "help" for help. postgres=# show shared_preload_libraries; shared_preload_libraries -------------------------- pg_show_plans (1 row) postgres=# select * from pg_available_extensions where name='pg_show_plans'; name | default_version | installed_version | comment ---------------+-----------------+-------------------+---------------------------------------------------------- pg_show_plans | 2.0 | | show query plans of all currently running SQL statements (1 row) postgres=# select tc.table_schema, tc.table_name, postgres-# tc.constraint_type,tc.constraint_name, tc.is_deferrable, postgres-# tc2.table_name as child_table, postgres-# rc.unique_constraint_name as refer_key, postgres-# case when rc.unique_constraint_name is not null then postgres-# (select tc1.table_name postgres(# from information_schema.table_constraints tc1 postgres(# where tc1.constraint_name = rc.unique_constraint_name) postgres-# end as ref_table, postgres-# cc.check_clause, postgres-# kc.column_name, postgres-# kc.ordinal_position postgres-# from information_schema.table_constraints tc postgres-# left join information_schema.referential_constraints rc postgres-# on tc.constraint_name = rc.constraint_name postgres-# left join information_schema.check_constraints cc postgres-# on tc.constraint_name = cc.constraint_name postgres-# left join information_schema.key_column_usage kc postgres-# on tc.constraint_name = kc.constraint_name postgres-# left join LATERAL ( postgres(# select tc2.table_name, rc1.unique_constraint_name postgres(# from information_schema.referential_constraints rc1 postgres(# join information_schema.table_constraints tc2 postgres(# on rc1.constraint_name = tc2.constraint_name postgres(# where tc.constraint_name = rc1.unique_constraint_name postgres(# ) tc2 on true postgres-# where tc.table_name = 'a'; server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed. The connection to the server was lost. Attempting reset: Failed. !?> PG LOG: ... 2024-01-25 13:19:03.969 CST [23950] LOG: database system is ready to accept connections 2024-01-25 13:19:18.829 CST [23950] LOG: server process (PID 23961) was terminated by signal 11: Segmentation fault 2024-01-25 13:19:18.829 CST [23950] DETAIL: Failed process was running: select tc.table_schema, tc.table_name, tc.constraint_type,tc.constraint_name, tc.is_deferrable, tc2.table_name as child_table, rc.unique_constraint_name as refer_key, case when rc.unique_constraint_name is not null then (select tc1.table_name from information_schema.table_constraints tc1 where tc1.constraint_name = rc.unique_constraint_name) end as ref_table, cc.check_clause, kc.column_name, kc.ordinal_position from information_schema.table_constraints tc left join information_schema.referential_constraints rc on tc.constraint_name = rc.constraint_name left join information_schema.check_constraints cc on tc.constraint_name = cc.constraint_name left join information_schema.key_column_usage kc on tc.constraint_name = kc.constraint_name left join LATERAL ( select tc2.table_name, rc1.unique_constraint_name from information_schema.referential_constraints rc1 2024-01-25 13:19:18.829 CST [23950] LOG: terminating any other active server processes 2024-01-25 13:19:18.829 CST [23992] FATAL: the database system is in recovery mode 2024-01-25 13:19:18.830 CST [23950] LOG: all server processes terminated; reinitializing 2024-01-25 13:19:18.852 CST [23993] LOG: database system was interrupted; last known up at 2024-01-25 13:19:03 CST 2024-01-25 13:19:18.916 CST [23993] LOG: database system was not properly shut down; automatic recovery in progress 2024-01-25 13:19:18.917 CST [23993] LOG: invalid record length at 0/17A6708: wanted 24, got 0 2024-01-25 13:19:18.917 CST [23993] LOG: redo is not required 2024-01-25 13:19:18.918 CST [23994] LOG: checkpoint starting: end-of-recovery immediate wait 2024-01-25 13:19:18.922 CST [23994] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.002 s, total=0.005 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB 2024-01-25 13:19:18.924 CST [23950] LOG: database system is ready to accept connections 2024-01-25 13:44:01.874 CST [24524] ERROR: relation "pg_avaiable_extensions" does not exist at character 15 2024-01-25 13:44:01.874 CST [24524] STATEMENT: select * from pg_avaiable_extensions; 2024-01-25 13:52:53.395 CST [23950] LOG: received fast shutdown request 2024-01-25 13:52:53.396 CST [23950] LOG: aborting any active transactions 2024-01-25 13:52:53.397 CST [23950] LOG: background worker "logical replication launcher" (PID 24007) exited with exit code 1 2024-01-25 13:52:53.397 CST [23994] LOG: shutting down 2024-01-25 13:52:53.398 CST [23994] LOG: checkpoint starting: shutdown immediate 2024-01-25 13:52:53.401 CST [23994] LOG: checkpoint complete: wrote 0 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.001 s, total=0.004 s; sync files=0, longest=0.000 s, average=0.000 s; distance=0 kB, estimate=0 kB 2024-01-25 13:52:53.404 CST [23950] LOG: database system is shut down 2024-01-25 13:54:48.952 CST [32099] LOG: starting PostgreSQL 15.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), 64-bit 2024-01-25 13:54:48.953 CST [32099] LOG: listening on IPv6 address "::1", port 5432 2024-01-25 13:54:48.954 CST [32099] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2024-01-25 13:54:48.957 CST [32102] LOG: database system was shut down at 2024-01-25 13:54:21 CST 2024-01-25 13:54:48.960 CST [32099] LOG: database system is ready to accept connections 2024-01-25 13:56:22.922 CST [32099] LOG: server process (PID 32111) was terminated by signal 11: Segmentation fault 2024-01-25 13:56:22.922 CST [32099] LOG: terminating any other active server processes 2024-01-25 13:56:22.923 CST [32727] FATAL: the database system is in recovery mode 2024-01-25 13:56:22.923 CST [32099] LOG: all server processes terminated; reinitializing 2024-01-25 13:56:22.947 CST [32730] LOG: database system was interrupted; last known up at 2024-01-25 13:54:48 CST 2024-01-25 13:56:23.010 CST [32730] LOG: database system was not properly shut down; automatic recovery in progress 2024-01-25 13:56:23.011 CST [32730] LOG: redo starts at 0/17A6990 2024-01-25 13:56:23.011 CST [32730] LOG: invalid record length at 0/17A69C8: wanted 24, got 0 2024-01-25 13:56:23.011 CST [32730] LOG: redo done at 0/17A6990 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s 2024-01-25 13:56:23.013 CST [32731] LOG: checkpoint starting: end-of-recovery immediate wait 2024-01-25 13:56:23.016 CST [32731] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.001 s, total=0.005 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB 2024-01-25 13:56:23.019 CST [32099] LOG: database system is ready to accept connections OS /var/log/message: ... Jan 25 13:55:01 whdcpsql005 systemd: Started Session 422614 of user postgres. Jan 25 13:56:22 whdcpsql005 kernel: postgres[32111]: segfault at 2b11ffb ip 00007ff1e8c4e771 sp 00007ffdd07b2b58 error 4 in libc-2.17.so[7ff1e8af8000+1c4000] Jan 25 13:56:22 whdcpsql005 kernel: Code: ca 76 06 48 01 ca 48 31 c9 48 81 ea 80 00 00 00 48 81 ea 80 00 00 00 0f 18 8e 00 fe ff ff 0f 18 8e 00 fd ff ff f3 0f 6f 4e f0 0f 6f 56 e0 f3 0f 6f 5e d0 f3 0f 6f 66 c0 f3 0f 6f 6e b0 f3 0f Jan 25 13:56:22 whdcpsql005 abrt-hook-ccpp: Process 32111 (postgres) of user 1015 killed by SIGSEGV - dumping core Jan 25 13:56:22 whdcpsql005 abrt-server: Executable '/opt/pgsql-15test/bin/postgres' doesn't belong to any package and ProcessUnpackaged is set to 'no' Jan 25 13:56:22 whdcpsql005 abrt-server: 'post-create' on '/var/spool/abrt/ccpp-2024-01-25-13:56:22-32111' exited with 1 Jan 25 13:56:22 whdcpsql005 abrt-server: Deleting problem directory '/var/spool/abrt/ccpp-2024-01-25-13:56:22-32111' ########################## disable loading pg_show_plans extension from configuration file, restart PG server. postgres=# show shared_preload_libraries; shared_preload_libraries -------------------------- (1 row) postgres=# \x Expanded display is on. postgres=# select tc.table_schema, tc.table_name, postgres-# tc.constraint_type,tc.constraint_name, tc.is_deferrable, postgres-# tc2.table_name as child_table, postgres-# rc.unique_constraint_name as refer_key, postgres-# case when rc.unique_constraint_name is not null then postgres-# (select tc1.table_name postgres(# from information_schema.table_constraints tc1 postgres(# where tc1.constraint_name = rc.unique_constraint_name) postgres-# end as ref_table, postgres-# cc.check_clause, postgres-# kc.column_name, postgres-# kc.ordinal_position postgres-# from information_schema.table_constraints tc postgres-# left join information_schema.referential_constraints rc postgres-# on tc.constraint_name = rc.constraint_name postgres-# left join information_schema.check_constraints cc postgres-# on tc.constraint_name = cc.constraint_name postgres-# left join information_schema.key_column_usage kc postgres-# on tc.constraint_name = kc.constraint_name postgres-# left join LATERAL ( postgres(# select tc2.table_name, rc1.unique_constraint_name postgres(# from information_schema.referential_constraints rc1 postgres(# join information_schema.table_constraints tc2 postgres(# on rc1.constraint_name = tc2.constraint_name postgres(# where tc.constraint_name = rc1.unique_constraint_name postgres(# ) tc2 on true postgres-# where tc.table_name = 'a'; -[ RECORD 1 ]----+---------------------- table_schema | public table_name | a constraint_type | PRIMARY KEY constraint_name | a_pkey is_deferrable | NO child_table | b refer_key | ref_table | check_clause | column_name | id ordinal_position | 1 -[ RECORD 2 ]----+---------------------- table_schema | public table_name | a constraint_type | CHECK constraint_name | 2200_16384_1_not_null is_deferrable | NO child_table | refer_key | ref_table | check_clause | id IS NOT NULL column_name | ordinal_position | postgres=#