Felix
Felix

Reputation: 25

PostgreSQL server closed the connection unexpectedly - temporal_tables extension - pgAdmin4

I recently installed the PostgreSQL extension temporal_tables (v1.2.2) on our PostgreSQL database (version 15.2 installed on Microsoft Windows Server 2022 Standard - x64). Note: Installing this extension added the public Trigger Function "versioning()" to my database.

As per the extension's installation instructions, I created a new "insert/update/delete" trigger on my existing, target table (myschema.mytable):

CREATE TRIGGER versioning_trigger BEFORE INSERT OR UPDATE OR DELETE ON myschema.mytable FOR EACH ROW EXECUTE PROCEDURE versioning('sys_period','myschema.mytablehistory',true);`

Now, however, whenever I execute any SQL command using pgAdmin 4 (Version 6.21) that inserts, updates or deletes a row in myschema.mytable, I receive the following message:

ERROR: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.

The PostgreSQL log file contains the following messages:

2024-08-15 07:06:58.500 EDT [12380] FATAL: the database system is in recovery mode

2024-08-15 07:06:58.611 EDT [18000] LOG: database system was interrupted; last known up at 2024-08-15 07:05:48 EDT

2024-08-15 07:07:01.261 EDT [18000] LOG: database system was not properly shut down; automatic recovery in progress

2024-08-15 07:07:01.278 EDT [18000] LOG: redo starts at F/69CBB4E8

2024-08-15 07:07:01.279 EDT [18000] LOG: invalid record length at F/69CBBC28: wanted 24, got 0 2024-08-15 07:07:01.279 EDT [18000] LOG: redo done at F/69CBBBF0 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s

2024-08-15 07:07:01.299 EDT [10208] LOG: checkpoint starting: end-of-recovery immediate wait

2024-08-15 07:07:01.333 EDT [10208] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.008 s, sync=0.006 s, total=0.037 s; sync files=4, longest=0.002 s, average=0.002 s; distance=1 kB, estimate=1 kB

I can't tell if the temporal_tables extension I installed (or its trigger function) is failing or if there's a PostgreSQL setting I need to change in order to make this work.

Any and all advice much appreciated.

Upvotes: 0

Views: 84

Answers (0)

Related Questions