]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix org#2588 About incorrect Object/ObjectId type in update_postgresql_tables
authorEric Bollengier <eric@baculasystems.com>
Wed, 6 Jan 2021 14:29:40 +0000 (15:29 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:59 +0000 (09:02 +0100)
The Object/ObjectId field has the type serial when the schema is upgraded with
update_postgresql_tables while it has the type bigserial when the DB is created
with make_postgresql_tables.

To fix manually the problem, it is possible to exectute the following SQL command:

ALTER TABLE Object ALTER ObjectId TYPE BIGINT;

bacula/src/cats/update_postgresql_tables.in

index a2acd488e56e4ac24077acff1cbe0032ca89a99d..bd40f5181768f475a1a596157c92134117ad1cc3 100644 (file)
@@ -569,6 +569,7 @@ fi
 if [ "$DBVERSION" -eq 1022 ] ; then
     if psql -f - -d ${db_name} $* <<END-OF-DATA
 begin;
+ALTER TABLE Object ALTER ObjectId TYPE BIGINT;
 ALTER TABLE Object ADD COLUMN ObjectCategory text not null;
 create index object_category_idx on Object  (ObjectCategory);
 INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES