Open smurthys opened 3 years ago
I have confirmed again that the issue is indeed due to the missing column added in Postgres 13. I have also verified that the following code to conditionally add the missing column works if the server version is later than 12.x. I have tested this patch only on Postgres 13.1. It needs to be tested on 13.0 and any version earlier than 13.0. This code should added immediately after temp table ImportedLogData
is created.
IF ClassDB.isServerVersionAfter('12', FALSE) THEN
ALTER TABLE ImportedLogData ADD COLUMN backend_type TEXT;
END IF;
I no longer feel that a prefix exception:
should be included in the values of info
column, because that column presently gets a value only when there is an exception. In all other cases, that column's value is NULL
. I suggest revising this issue if the column is ever populated when there are no exceptions. Thus, I'm removing the "missing" characterization from the issue title.
Running the function
classdb.importConnectionLog
on an instance of Postgres 13 fails to import any data. Here is an example of the result table the function returns when the function is run without any parameter:The failure to import is due to an exception, but the content of the column
info
in the result table does not include any hint there was an exception.Looking into the code and Postgres docs, the failure to import is due to Postgres 13 adding a new column (named
backend_type
) to the server log. The solution is to conditionally include the new column in the temporary tableImportedLogData
.Further, it will help to to prefix the text in the
info
column with a string such asexception:
instead of placing just the value ofSQLERRM
in that column when an exception occurs.