Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Connection log import fails on Postgres 13 (W) #283

Open

Description

@smurthys

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:

logdate numconnections numdisconnections info
2021-02-26T00:00:00Z 0 0 extra data after last expected column

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 table ImportedLogData.

Further, it will help to to prefix the text in the info column with a string such as exception: instead of placing just the value of SQLERRM in that column when an exception occurs.

Activity

  1. changed the title [-]Connection log import fails on Postgres 13 (W)[/-] [+]Connection log import fails on Postgres 13 (WM)[/+] on Feb 27, 2021
  2. smurthys commented on Feb 27, 2021

    @smurthys
    MemberAuthor

    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;
  3. smurthys commented on Feb 27, 2021

    @smurthys
    MemberAuthor

    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.

  4. changed the title [-]Connection log import fails on Postgres 13 (WM)[/-] [+]Connection log import fails on Postgres 13 (W)[/+] on Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions