Skip to content

Commit 44065d4

Browse files
committed
Address review comments
1 parent 1907589 commit 44065d4

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

contrib/pg_tde/pg_tde--1.0-rc.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,13 @@ CREATE FUNCTION pg_tde_delete_key()
295295
RETURNS VOID
296296
LANGUAGE C
297297
AS 'MODULE_PATHNAME';
298+
REVOKE ALL ON FUNCTION pg_tde_delete_key() FROM PUBLIC;
298299

299300
CREATE FUNCTION pg_tde_delete_default_key()
300301
RETURNS VOID
301302
LANGUAGE C
302303
AS 'MODULE_PATHNAME';
304+
REVOKE ALL ON FUNCTION pg_tde_delete_default_key() FROM PUBLIC;
303305

304306
CREATE FUNCTION pg_tde_key_info()
305307
RETURNS TABLE ( key_name TEXT,

contrib/pg_tde/src/access/pg_tde_tdemap.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -515,19 +515,16 @@ pg_tde_delete_principal_key_redo(Oid dbOid)
515515
{
516516
char path[MAXPGPATH];
517517

518-
LWLockAcquire(tde_lwlock_enc_keys(), LW_EXCLUSIVE);
519-
520518
pg_tde_set_db_file_path(dbOid, path);
521-
durable_unlink(path, WARNING);
522519

520+
LWLockAcquire(tde_lwlock_enc_keys(), LW_EXCLUSIVE);
521+
durable_unlink(path, WARNING);
523522
LWLockRelease(tde_lwlock_enc_keys());
524523
}
525524

526525
/*
527526
* Deletes the principal key for the database. This fucntion checks if key map
528527
* file has any entries, and if not, it removes the file. Otherwise raises an error.
529-
*
530-
* The caller must hold an exclusive lock on the files before calling this function.
531528
*/
532529
void
533530
pg_tde_delete_principal_key(Oid dbOid)
@@ -686,8 +683,6 @@ pg_tde_find_map_entry(const RelFileLocator *rlocator, TDEMapEntryType key_type,
686683
* positive is more harmful this might not be.
687684
*
688685
* Works even if the database has no map file.
689-
* The caller must hold a shared or exclusive lock on the
690-
* tde_lwlock_enc_keys() lock.
691686
*/
692687
int
693688
pg_tde_count_relations(Oid dbOid)

contrib/pg_tde/src/catalog/tde_principal_key.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,6 @@ pg_tde_delete_default_key(PG_FUNCTION_ARGS)
707707
pg_tde_delete_principal_key(dbOid);
708708
clear_principal_key_cache(dbOid);
709709
}
710-
list_free(dbs);
711710

712711
systable_endscan(scan);
713712
table_close(rel, RowExclusiveLock);
@@ -717,6 +716,9 @@ pg_tde_delete_default_key(PG_FUNCTION_ARGS)
717716
clear_principal_key_cache(DEFAULT_DATA_TDE_OID);
718717

719718
LWLockRelease(tde_lwlock_enc_keys());
719+
720+
list_free(dbs);
721+
720722
PG_RETURN_VOID();
721723
}
722724

0 commit comments

Comments
 (0)