--- /dev/null
+ After a sql error, the error message that is printed
+ is incorrect and does not include the postgresql error message.
+ It fixes #989
+
+ This patch applies to Bacula version 2.2.5 (and previous versions),
+ and can be applied with the following:
+
+ cd <bacula-source>
+ patch -p0 <2.2.5-postgresql-errors.patch
+ ./configure (your options)
+ make
+ ...
+ make install
+
+
+Index: src/cats/cats.h
+===================================================================
+--- src/cats/cats.h (révision 5763)
++++ src/cats/cats.h (copie de travail)
+@@ -498,7 +498,7 @@
+ #define sql_fetch_row(x) my_postgresql_fetch_row(x)
+ #define sql_query(x, y) my_postgresql_query((x), (y))
+ #define sql_close(x) PQfinish((x)->db)
+-#define sql_strerror(x) PQresultErrorMessage((x)->result)
++#define sql_strerror(x) PQerrorMessage((x)->db)
+ #define sql_num_rows(x) ((unsigned) PQntuples((x)->result))
+ #define sql_data_seek(x, i) my_postgresql_data_seek((x), (i))
+ #define sql_affected_rows(x) ((unsigned) atoi(PQcmdTuples((x)->result)))