ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Seeing error "Must be owner of extension plpgsql" during a Postgres database restore.


Article ID: 4307


Updated On:


CA Application Performance Management Agent (APM / Wily / Introscope) INTROSCOPE


The following message appears in the console when executing "dbrestore-postgres.bat" or "":

pg_restore: [archiver (db)] Error while PROCESSING TOC: 

pg_restore: [archiver (db)] Error from TOC entry nnnnn; 0 0 COMMENT EXTENSION plpgsql 
pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of extension plpgsql 
Command was: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';


The message means that the command "COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'" had the error. In most cases, this message can be ignored. 
During the restore, it tries restoring this comment. However, the restore user was not owner of the extension plpgsql, causing the error.
The comment of extension plpgsql already exists, there is no problem as a result.


All supported APM Releases.


This is a typical scenario and these messages can be safely ignored in most cases. Note that the restore process continues and finishes normally.

If the error is still a concern or hinders restoration, please see articles such as for additional steps