From b0a8a69203f63c62db24815e80f0ebcef4232eba Mon Sep 17 00:00:00 2001 From: Gursharan Singh <3442979+G8XSU@users.noreply.github.com> Date: Mon, 25 Sep 2023 21:46:28 -0700 Subject: [PATCH] Allow Longer keys upto 600 chars Motivation: Earlier we were conservative about our key-size since it is easier to increase but difficult to increase in backward compatible fashion. Now with introduction of sub_namespace and directly allowing upto 360char keys in LDK, we need support for longer key lengths. * We use varchar over text as it is sql standard and can be indexed in all sql-implementations while limiting key size. * LDK can have keys of length up to 362(120*3+2), we use 600 as a safe limit with some buffer and considering applications other than LDK. --- .../main/java/org/vss/impl/postgres/sql/v0_create_vss_db.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/vss/impl/postgres/sql/v0_create_vss_db.sql b/app/src/main/java/org/vss/impl/postgres/sql/v0_create_vss_db.sql index 2e27028..bd81216 100644 --- a/app/src/main/java/org/vss/impl/postgres/sql/v0_create_vss_db.sql +++ b/app/src/main/java/org/vss/impl/postgres/sql/v0_create_vss_db.sql @@ -1,6 +1,6 @@ CREATE TABLE vss_db ( store_id character varying(120) NOT NULL CHECK (store_id <> ''), - key character varying(120) NOT NULL, + key character varying(600) NOT NULL, value bytea NULL, version bigint NOT NULL, PRIMARY KEY (store_id, key)