Skip to content

Commit

Permalink
Fix is_encrypted function name prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreydwalter committed Jul 17, 2024
1 parent b5ef829 commit 490a00c
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ toast_extended_storage \
move_large_tuples \
non_sorted_off_compact \
update_compare_indexes \
pgtde_is_encrypted \
pg_tde_is_encrypted \
test_issue_153_fix \
multi_insert \
trigger_on_view \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ docker build . -f ./docker/Dockerfile -t your-image-name

The extension provides the following helper functions:

### pgtde_is_encrypted(tablename)
### pg_tde_is_encrypted(tablename)

Returns `t` if the table is encrypted (uses the pg_tde access method), or `f` otherwise.

Expand Down
12 changes: 6 additions & 6 deletions expected/change_access_method.out
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ SELECT * FROM country_table;
3 | USA | North America
(3 rows)

SELECT pgtde_is_encrypted('country_table');
pgtde_is_encrypted
SELECT pg_tde_is_encrypted('country_table');
pg_tde_is_encrypted
--------------------
t
(1 row)
Expand All @@ -53,8 +53,8 @@ SELECT * FROM country_table;
6 | Canada | North America
(6 rows)

SELECT pgtde_is_encrypted('country_table');
pgtde_is_encrypted
SELECT pg_tde_is_encrypted('country_table');
pg_tde_is_encrypted
--------------------
f
(1 row)
Expand All @@ -79,8 +79,8 @@ SELECT * FROM country_table;
9 | Australia | Oceania
(9 rows)

SELECT pgtde_is_encrypted('country_table');
pgtde_is_encrypted
SELECT pg_tde_is_encrypted('country_table');
pg_tde_is_encrypted
--------------------
t
(1 row)
Expand Down
8 changes: 4 additions & 4 deletions expected/pgtde_is_encrypted.out
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ SELECT amname FROM pg_class INNER JOIN pg_am ON pg_am.oid = pg_class.relam WHERE
heap
(1 row)

SELECT pgtde_is_encrypted('test_enc');
pgtde_is_encrypted
SELECT pg_tde_is_encrypted('test_enc');
pg_tde_is_encrypted
--------------------
t
(1 row)

SELECT pgtde_is_encrypted('test_norm');
pgtde_is_encrypted
SELECT pg_tde_is_encrypted('test_norm');
pg_tde_is_encrypted
--------------------
f
(1 row)
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ tests += {
'move_large_tuples',
'non_sorted_off_compact',
'update_compare_indexes',
'pgtde_is_encrypted',
'pg_tde_is_encrypted',
'test_issue_153_fix',
'multi_insert',
'keyprovider_dependency',
Expand Down
2 changes: 1 addition & 1 deletion pg_tde--1.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ RETURNS table_am_handler
AS 'MODULE_PATHNAME'
LANGUAGE C;

CREATE FUNCTION pgtde_is_encrypted(table_name VARCHAR)
CREATE FUNCTION pg_tde_is_encrypted(table_name VARCHAR)
RETURNS boolean
AS $$
SELECT EXISTS (
Expand Down
6 changes: 3 additions & 3 deletions sql/change_access_method.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SELECT pg_tde_set_principal_key('test-db-principal-key','file-vault');

SELECT * FROM country_table;

SELECT pgtde_is_encrypted('country_table');
SELECT pg_tde_is_encrypted('country_table');

-- Try changing the encrypted table to an unencrypted table
ALTER TABLE country_table SET access method heap;
Expand All @@ -27,7 +27,7 @@ INSERT INTO country_table (country_name, continent)
('Canada', 'North America');

SELECT * FROM country_table;
SELECT pgtde_is_encrypted('country_table');
SELECT pg_tde_is_encrypted('country_table');

-- Change it back to encrypted
ALTER TABLE country_table SET access method pg_tde_basic;
Expand All @@ -37,7 +37,7 @@ INSERT INTO country_table (country_name, continent)
('Brazil', 'South America'),
('Australia', 'Oceania');
SELECT * FROM country_table;
SELECT pgtde_is_encrypted('country_table');
SELECT pg_tde_is_encrypted('country_table');

DROP TABLE country_table;
DROP EXTENSION pg_tde;
4 changes: 2 additions & 2 deletions sql/pgtde_is_encrypted.sql → sql/pg_tde_is_encrypted.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ CREATE TABLE test_norm(
SELECT amname FROM pg_class INNER JOIN pg_am ON pg_am.oid = pg_class.relam WHERE relname = 'test_enc';
SELECT amname FROM pg_class INNER JOIN pg_am ON pg_am.oid = pg_class.relam WHERE relname = 'test_norm';

SELECT pgtde_is_encrypted('test_enc');
SELECT pgtde_is_encrypted('test_norm');
SELECT pg_tde_is_encrypted('test_enc');
SELECT pg_tde_is_encrypted('test_norm');

SELECT key_provider_id, key_provider_name, principal_key_name
FROM pg_tde_principal_key_info();
Expand Down

0 comments on commit 490a00c

Please sign in to comment.