skip to Main Content

When i run metasploit i get this message:

WARN: Version mismatch for collation in database 'msf'
DETAIL: The database was created with collation version 2.36, but the operating system provides version 2.37.
HINT: Rebuild all objects in this database that use the primary collation and ALTER DATABASE msf REFRESH COLLATION VERSION, or build PostgreSQL with the correct library version.

I’m not good at databases and SQL, i tried to use sudo -u postgres psql and execute command in hint ALTER DATABASE msf REFRESH COLLATION VERSION but nothing happened.

2

Answers


  1. Chosen as BEST ANSWER

    This commands helped me:

    sudo -u postgres psql -U postgres  -d msf
    REINDEX DATABASE msf;
    ALTER DATABASE msf REFRESH COLLATION VERSION;
    

  2. The issue is that all objects depending on the database default collation need to be rebuilt using REINDEX before the default collation version can be refreshed using the command ALTER DATABASE 'msf' REFRESH COLLATION VERSION.

    This will update the system catalog to record the current collation version and will make the WARN: Version mismatch for collation in database 'msf' warning go away.

    The following query can be used to identify all collations in the current database that need to be refreshed and the objects that depend on them:

    SELECT pg_describe_object(refclassid, refobjid, refobjsubid) AS "Collation",
               pg_describe_object(classid, objid, objsubid) AS "Object"
    FROM pg_depend d JOIN pg_collation c
               ON refclassid = 'pg_collation'::regclass AND refobjid = c.oid
    WHERE c.collversion <> pg_collation_actual_version(c.oid)
    ORDER BY 1, 2;
    

    You can read more about this in the "Notes" here: https://www.postgresql.org/docs/current/sql-altercollation.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search