Skip to content

add a postgres history backend#2322

Merged
slingamn merged 4 commits intoergochat:masterfrom
slingamn:postgres
Mar 5, 2026
Merged

add a postgres history backend#2322
slingamn merged 4 commits intoergochat:masterfrom
slingamn:postgres

Conversation

@slingamn
Copy link
Copy Markdown
Member

@slingamn slingamn commented Jan 1, 2026

First, I had Claude convert the MySQL backend to Postgres: diff

Then I copied and pasted the Postgres backend into a separate package, behind a build tag that builds a stub by default. (As per #1648 the binary size increase from pulling in the postgres driver is very large, about 28%.)

The resulting implementation passes irctest (after patching irctest to talk to postgres).

A least-privileges setup looks like:

user@claudevm:~$ sudo -u postgres psql template1
psql (16.11 (Ubuntu 16.11-0ubuntu0.24.04.1))        
Type "help" for help. 

template1=# ALTER USER postgres with encrypted password 'asdfasdf';
ALTER ROLE
template1=# create user ergo with password 'hunter2';
CREATE ROLE 
template1=# create database ergo_history;        
CREATE DATABASE 
template1=# grant all privileges on database ergo_history to ergo;  
GRANT  
template1=# quit  

user@claudevm:~$ sudo -u postgres psql ergo_history
psql (16.11 (Ubuntu 16.11-0ubuntu0.24.04.1))
Type "help" for help.
ergo_history=# GRANT ALL ON SCHEMA public TO ergo;
GRANT

@slingamn slingamn added this to the v2.18 milestone Jan 1, 2026
@slingamn slingamn merged commit 5fd8ed8 into ergochat:master Mar 5, 2026
1 check passed
@slingamn
Copy link
Copy Markdown
Member Author

slingamn commented Mar 5, 2026

I didn't completely figure out the performance issues here, but I think this is OK to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant