@ -529,7 +529,7 @@ pg_tde_delete_principal_key(Oid dbOid)
char path [ MAXPGPATH ] ;
char path [ MAXPGPATH ] ;
Assert ( LWLockHeldByMeInMode ( tde_lwlock_enc_keys ( ) , LW_EXCLUSIVE ) ) ;
Assert ( LWLockHeldByMeInMode ( tde_lwlock_enc_keys ( ) , LW_EXCLUSIVE ) ) ;
Assert ( pg_tde_count_relation s ( dbOid ) = = 0 ) ;
Assert ( pg_tde_count_encryption_key s ( dbOid ) = = 0 ) ;
pg_tde_set_db_file_path ( dbOid , path ) ;
pg_tde_set_db_file_path ( dbOid , path ) ;
@ -672,17 +672,15 @@ pg_tde_find_map_entry(const RelFileLocator *rlocator, TDEMapEntryType key_type,
}
}
/*
/*
* Counts number of encrypted objects in a databas e .
* Counts number of encryption keys in a key fil e .
*
*
* Does not check if objects actually exist but just that they have keys in
* Does not check if objects actually exist but just that they have keys in
* the map file . For the only current caller , checking if we can use
* the key file .
* FILE_COPY , this is good enough but for other workloads where a false
* positive is more harmful this might not be .
*
*
* Works even if the database has no map file .
* Works even if the database has no key file .
*/
*/
int
int
pg_tde_count_relation s ( Oid dbOid )
pg_tde_count_encryption_key s ( Oid dbOid )
{
{
char db_map_path [ MAXPGPATH ] ;
char db_map_path [ MAXPGPATH ] ;
File map_fd ;
File map_fd ;