|
From: Martin S. <ma...@li...> - 2026-06-12 18:12:37
|
>>>>> On Fri, 12 Jun 2026 00:10:50 +0200, Carsten Leonhardt said: > > Hi, > > we got a Debian bug¹ report about the postgres database upgrade script > where the user executed "update_postgresql_tables" and it failed in step > "15 to 1017", specifically the part with the dump to file and restore > from file. > > The part where data is written to file is executed as > > psql ... set ... set ... set ... (and then the actual data is generated) > > see: > https://gitlab.bacula.org/bacula-community-edition/bacula-community/-/blob/Branch-15.0/bacula/src/cats/update_postgresql_tables.in?ref_type=heads#L189 > > which results in the file containing three "SET" statements at the > beginning. That looks wrong? The user reported that he needed to add a > "-q" for "quiet" to the dump, which supresses the output of the "SET" > statements into the file and then the upgrade worked. > > I do wonder though why nobody else reported the problem. > > Any thoughts? It depends on the version of postgres. Prior to version 15, psql only printed the results of the last command, but this was changed in version 15 to print all results by default (see "Make psql output all results" at https://www.postgresql.org/docs/release/15.0/). The version of Bacula (11) that introduced these three SET statements predates postgres 15 by 2 years, so possibly most people upgraded Bacula before that postgres release? __Martin |