Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#243: Rename pgtde_is_encrypted() to pg_tde_is_encrypted() #242

Merged
merged 4 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
18 changes: 9 additions & 9 deletions expected/change_access_method.out
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ 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,9 +53,9 @@ 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,9 +79,9 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ 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
Loading