Don’t forget to upgrade the YSQL system catalog

YugabyteDB stores YSQL system metadata, referred to as the YSQL system catalog, in special tables.

The metadata includes information about tables, columns, functions, users, views, privileges, etc.

When new features are added to YugabyteDB, objects such as new tables and functions need to be added to the system catalog. 

After completing the YugabyteDB upgrade process, be sure to use the yb-admin utility to upgrade the YSQL system catalog!

The command has the following syntax:

				
					./bin/yb-admin -master_addresses <master-addresses> upgrade_ysql
				
			

Example:

				
					[root@localhost ~]# yb-admin -master-addresses 127.0.0.1 upgrade_ysql
YSQL successfully upgraded to the latest version
				
			

If you forget this step, you might run into system errors like the following, where a manual upgrade was perfromed from YugabyteDB 2.16 to 2.18:

				
					[root@yb-tserver-0 bin]# ./ysql_dump --format=t --create --clean --blobs --if-exists --dbname=mydb --file=./db_backup.sql
ysql_dump: [archiver (db)] query failed: ERROR:  function yb_is_database_colocated(boolean) does not exist
LINE 1: SELECT yb_is_database_colocated(false), yb_is_database_coloc...
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
ysql_dump: [archiver (db)] query was: SELECT yb_is_database_colocated(false), yb_is_database_colocated(true)
				
			

Have Fun!

Foggy morning!