File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Orm/Xtensive.Orm.PostgreSql/Sql.Drivers.PostgreSql/v8_0 Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -441,7 +441,12 @@ protected virtual void ExtractSchemaContents(ExtractionContext context)
441441 && SqlDml . In ( relationsTable [ "relkind" ] , SqlDml . Row ( 'r' , 'v' , 'S' ) ) ;
442442
443443 if ( targetSchemes != null && targetSchemes . Count > 0 ) {
444- var schemesIndexes = catalog . Schemas . Where ( sch => targetSchemes . ContainsKey ( sch . Name ) ) . Select ( sch => context . ReversedSchemaMap [ sch ] ) ;
444+ var schemesIndexes = catalog . Schemas . Where ( sch => targetSchemes . ContainsKey ( sch . Name ) )
445+ . Select ( sch =>
446+ context . ReversedSchemaMap . TryGetValue ( sch , out var oid )
447+ ? oid
448+ : throw new InvalidOperationException ( string . Format ( Resources . Strings . ExSchemaXDoesNotExistOrBelongsToAnotherUser , sch . Name ) )
449+ ) ;
445450 select . Where &= SqlDml . In ( relationsTable [ "relnamespace" ] , CreateOidRow ( schemesIndexes ) ) ;
446451 }
447452 select . Columns . Add ( relationsTable [ "oid" ] , "reloid" ) ;
You can’t perform that action at this time.
0 commit comments