ArroyoSystems / arroyo

Distributed stream processing engine in Rust

Home Page:https://arroyo.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[ Docs ] Enhancement: Load PGCRYPTO Extension | fix gen_random() error

dfirence opened this issue · comments

Hey Folks,

Small Contribution for the docs in dev setup. Please ensure all ARROYO users run these PGSQL setps before attempting to build services.

The one missing is the extension loadup so the refinery migrations work during setup `

-- DevSetup
-- Load PG_CRYPTO
create extension pgcrypto;

-- Create User Used By Arroyo Platform
create user arroyo with password 'whatever_password_here' superuser;

Please close once the docs are updated, thanks for this awesome project!

Thanks for reporting this! Do you mind including the error you were getting running refinery without the pgcrypto extension, and which migration is causing the issue? I don't believe we should be depending on that extension.

Specific to gen_random_uuid()

CREATE TABLE cluster_info (
    id UUID PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
    singleton INT NOT NULL DEFAULT 0 UNIQUE CHECK (singleton = 0)
);

INSERT INTO cluster_info (id, name) VALUES (gen_random_uuid(), 'default');

Interesting — what version of postgres is this? I believe gen_random_uuid has been available without loading an extension since PG 13.

It's worth adding a note for older versions though.