What are the columns of the file table?  E.g. run "psql -U bacula bacula" and
use the "\d file" command.

If the columns include filenameid and not filename, then I suspect part of the
update_postgres_tables script was never run, because that is supposed to fix
these columns.

__Martin


>>>>> On Tue, 10 Nov 2026 11:50:00 -0500, Brian  said:
> 
> (I've been having some trouble with my outbound e-mail; please excuse if 
> this is a repost)
> 
> Hello,
> 
> This past weekend I upgraded a Debian 12 server to Debian 13 with 
> `apt-get full-upgrade`.  There were errors involving upgrading 
> postgresql and bacula, seemingly because dpkg tried to configure 
> packages in the wrong order.  A few iterations eventually led to no 
> further errors from apt-get or dpkg.
> 
> I had to manually run the update_postgres_tables script, and that 
> required modding the script to correct for the fact that bash will 
> convert "$$" into the current PID, breaking psql if-blocks.
> 
> Bacula no longer complains about database versions (found 1019, want 
> 1026, etc), but now all my backup jobs fail at the end with the 
> following log message:
> 
> JobId 48: Fatal error: backup.c:343 [DE0028] Query failed: DECLARE 
> _bac_cursor CURSOR FOR SELECT Path, Filename, FileIndex, JobId, LStat, 
> DeltaSeq     , JobTDate FROM ((SELECT Path.Path, T1.Filename, 
> T1.FileIndex, T1.JobId, LStat, DeltaSeq     , JobTDate FROM ( SELECT 
> DISTINCT ON (Filename, PathId) JobTDate, JobId, FileId, FileIndex, 
> PathId, Filename, LStat     , DeltaSeq FROM (SELECT FileId, JobId, 
> PathId, Filename, FileIndex, LStat     , DeltaSeq FROM File WHERE JobId 
> IN (1,23) UNION ALL SELECT File.FileId, File.JobId, PathId, Filename, 
> File.FileIndex, LStat     , DeltaSeq FROM BaseFiles JOIN File USING 
> (FileId) WHERE BaseFiles.JobId IN (1,23) ) AS T JOIN Job USING (JobId) 
> ORDER BY Filename, PathId, JobTDate DESC  ) AS T1 JOIN Path ON 
> (Path.PathId = T1.PathId) WHERE FileIndex > 0 )  ) AS U1 ORDER BY 
> JobTDate, FileIndex ASC: ERR=ERROR:  column "filename" does not exist
> LINE 1: ...   , DeltaSeq FROM (SELECT FileId, JobId, PathId, Filename, ...
> 
> Googling gives results that talk about fixing SQL files that don't exist 
> on my system and/or do not contain the quoted query.
> 
> All tips on what to do next will be greatly appreciated.
> 
> Bacula version 15.0.3 as packaged for Debian Trixie (13).
> Postgresql version 13.
> 
> Thanks,
> -Brian
> 
> 
> _______________________________________________
> Bacula-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bacula-users
> 


_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to