Skip to content
New issue

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

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

Already on GitHub? # to your account

jsonb type support #87

Open
Code-Hex opened this issue Jun 30, 2023 · 1 comment
Open

jsonb type support #87

Code-Hex opened this issue Jun 30, 2023 · 1 comment

Comments

@Code-Hex
Copy link

Code-Hex commented Jun 30, 2023

Hello! Thank you for the great extension.

Are there any plans to enable TCE on jsonb data? It would be even better if it could be supported!

Currently, we got this error:

ECURITY LABEL FOR pgsodium ON COLUMN temp_table.content IS 'ENCRYPT WITH KEY ID c9c52d1c-372d-4187-bcd6-dad2a06c3992';
ERROR:  syntax error at or near ","
LINE 12: ,
         ^
QUERY:
    DROP VIEW IF EXISTS pg_temp_13.decrypted_temp_table;
    CREATE VIEW pg_temp_13.decrypted_temp_table AS SELECT
                id,
        content,
,
        created_at
    FROM temp_table;
    ALTER VIEW pg_temp_13.decrypted_temp_table OWNER TO postgres;

CONTEXT:  PL/pgSQL function pgsodium.create_mask_view(oid,integer,boolean) line 39 at EXECUTE
SQL statement "SELECT pgsodium.create_mask_view(objoid, objsubid, debug)
    FROM pg_catalog.pg_seclabel sl
    WHERE sl.objoid = target
      AND sl.label ILIKE 'ENCRYPT%'
      AND sl.provider = 'pgsodium'"
PL/pgSQL function pgsodium.update_mask(oid,boolean) line 4 at PERFORM
SQL statement "SELECT pgsodium.update_mask(objoid, debug)
    FROM pg_catalog.pg_seclabel sl
    JOIN pg_catalog.pg_class cl ON (cl.oid = sl.objoid)
    WHERE label ilike 'ENCRYPT%'
       AND cl.relowner = session_user::regrole::oid
       AND provider = 'pgsodium'
           AND objoid::regclass != 'pgsodium.key'::regclass"
PL/pgSQL function pgsodium.update_masks(boolean) line 3 at PERFORM
SQL statement "SELECT pgsodium.update_masks()"
PL/pgSQL function pgsodium.trg_mask_update() line 9 at PERFORM
CREATE TABLE temp_table (
    id varchar(128) NOT NULL,
    content jsonb NOT NULL,
    created_at timestamp with time zone NOT NULL,
    PRIMARY KEY (id)
);

We use this on supabase (hosted):

> SELECT VERSION();
PostgreSQL 15.1 (Ubuntu 15.1-1.pgdg20.04+1) on aarch64-unknown-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit
@OndrejValenta
Copy link

That is definitely highly important feature, I would say.. I didn't think it would be an issue, to be honest.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants