Skip to content

Instantly share code, notes, and snippets.

@beargiles
Created October 26, 2021 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beargiles/b228f90fa523ccc0d3903711a0e83cf3 to your computer and use it in GitHub Desktop.
Save beargiles/b228f90fa523ccc0d3903711a0e83cf3 to your computer and use it in GitHub Desktop.
PostgreSQL user-defined RECORD type
--
-- Create user-defined record type for symmetric keys
--
CREATE TYPE skey AS (
key_id int4,
key bytea,
type text
);
--
-- Create user-defined record type for symmetric key ciphertext
--
CREATE TYPE sciphertext AS (
data bytea,
key skey,
iv bytea
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment