CSS Tools - Backup - Fatal Error - pgdump schema with OID xxxxx does not exist
Description
During a backup (using PGADMIN III or pg_dump) the following error occurs:
schema with OID xxxxxx does not exist

Applicable in CAST Version
| Release | Yes/No |
|---|---|
| 8.3.x | ✅ |
Observed on RDBMS
| RDBMS | Yes/No |
|---|---|
| CSS | ✅ |
Step by Step scenario
- Perform a backup of one database using PGADMIN or pg_dump
- The “schema with OID xxxxxx does not exist” is raised and stop the Backup
Cause
The error is due to a corrupted database for example because of a network failure while inserting data in Cast Storage Service or when dropping a schema.
Action Plan
You need to delete rows on catalog tables where specified OID is specified.
select oid, nspname from pg_namespace where oid=xxxxxxx;
The catalog pg\_namespace stores namespaces. A namespace is the structure underlying SQL schemas.
<div class="alert alert-success" role="alert"><div class="h4 alert-heading" role="heading">Tip</div>
If there is no rows raised, that means that the schema has been dropped. In that case, go to the point 2.
If there is one row raised, then a solution is to perform a component reinstall. You don't need to go to the point 2.
</div>
2. If there are no entries when the above query is run, it means that this namespace has been removed from the Server. Then we assume that some entries in the following system catalog are corrupted. You have to remove the rows that are raised in the following queries
1. 1. ```sql
select * from pg_type where typnamespace=xxxxxxx;
The catalog pg\_type stores information about data types. Base types and enum types (scalar types) are created with [CREATE TYPE](http://www.postgresql.org/docs/8.4/static/sql-createtype.html), and domains with [CREATE DOMAIN](http://www.postgresql.org/docs/8.4/static/sql-createdomain.html)
select * from pg_class where relnamespace = xxxxxxx;
The catalog pg\_class catalogs tables and most everything else that has columns or is otherwise similar to a table. This includes indexes (but see also pg\_index), sequences, views, composite types, and TOAST tables
3. ```sql
select * from pg_operator where oprnamespace = xxxxxxx;
The catalog pg\_operator stores information about operators.
select * from pg_conversion where connamespace = xxxxxxx;
The catalog pg\_conversion describes the available encoding conversion procedures
5. ```sql
select * from pg_opclass where opcnamespace = xxxxxxx;
The catalog pg\_opclass defines index access method operator classes.
select * from pg_aggregate where aggfnoid = xxxxxxx or aggtransfn = xxxxxxx or aggfinalfn = xxxxxxx;
The catalog pg\_aggregate stores information about aggregate functions. An aggregate function is a function that operates on a set of values (typically one column from each row that matches a query condition) and returns a single value computed from all these values. Typical aggregate functions are `sum`, `count`, and `max`.
7. ```sql
select * from pg_proc where pronamespace = xxxxxxx;
The catalog pg\_proc stores information about functions (or procedures).
–> Delete rows where oid xxxxxx appears and re-execute the backup in PGADMIN or pg_dump, it should work.
Notes / Comments
Related Pages