F.17. lt_patch

F.17.1. The lt_patch table
F.17.2. Functions
F.17.3. Sample Output

The lt_patch module provides a means for tracking the information of all patches executed by a server.

Before creating lt_patch you must first create file_fdw extension and set LTHOME environment variable.

When lt_patch is loaded, it tracks patches across all databases of the server. To access and manipulate these patch information, the module provides a table, lt_patch, and the utility functions lt_patch. These are not available globally but can be enabled for a specific database with CREATE EXTENSION lt_patch.

F.17.1. The lt_patch table

The information gathered by the module are made available via a table named lt_patch. This table contains one row for each distinct path. The columns of the table are shown in Table F.3.

Table F.3. lt_patch Columns

Column Type

Description

name varchar

patch name

dependency varchar

dependency patch

component_type varchar

component type : PATCH BUGFIX

apply_type varchar

apply type : INSTANCE APP BOTH

apply_version varchar

apply version

action varchar

action : REMOVED INSTALLED

status varchar

status : "APP FAILED" "APP SUCCESS" "INSTANCE FAILED" "SUCCESS"

create_time timestamp

patch create time

update_time timestamp

patch update time


F.17.2. Functions

lt_patch(showtext boolean) returns setof record

The lt_patch table is defined in terms of a function also named lt_patch.

F.17.3. Sample Output

lightdb@postgres=# select * from lt_patch;
      name      | dependency | component_type | apply_type | apply_version | action  | status |     create_time     |     update_time
----------------+------------+----------------+------------+---------------+---------+--------+---------------------+---------------------
 patch-1.0-8717 |            | patch          | BOTH       | 13.8-22.4     | removed |        | 2022-12-29 18:25:48 | 2022-12-29 19:24:33
 1.0-8719       |            | patch          | BOTH       | 13.8-22.4     | removed |        | 2022-12-29 19:58:39 | 2022-12-29 21:18:52
(2 rows)

lightdb@postgres=# select lt_patch();
                                          lt_patch
---------------------------------------------------------------------------------------------
 (patch-1.0-8717,,patch,BOTH,13.8-22.4,removed,,"2022-12-29 18:25:48","2022-12-29 19:24:33")
 (1.0-8719,,patch,BOTH,13.8-22.4,removed,,"2022-12-29 19:58:39","2022-12-29 21:18:52")
(2 rows)