SQLStreams

the messaging platform that is just Postgres

You last visited on 9999-99-99 Show what's new since then
[SOLVED]

the connecting role cannot create the schema [SQL0064]

Edit this page
code SQL0064 · recovery permanent — an unchanged retry cannot succeed; retry machinery stops immediately
the log line · Report this thread
SQL0064 Permanent error

As it arrives in your log or error chain — example values stand where yours will:

the connecting role cannot create the schema: schema "sqlstreams" -- grant it CREATE on the database, or create schema sqlstreams yourself and grant the role USAGE and CREATE on it [SQL0064]

SQLStreams keeps its tables in a schema of their own, sqlstreams by default, so the shared control-plane tables and the ten tables every stream creates never land beside your own. Client.System().Register - or the first stream Register, which registers the system - creates that schema before it creates anything else, and Postgres refused: the role in the connection string has no CREATE privilege on the database.

Nothing was created. No schema, no tables, no system row.

Either grant the role the privilege:

GRANT CREATE ON DATABASE orders_db TO app_user;

Or create the schema yourself - useful when the application role is deliberately not allowed to create schemas - and let the role work inside it:

CREATE SCHEMA sqlstreams;
GRANT USAGE, CREATE ON SCHEMA sqlstreams TO app_user;

CREATE on the schema is still needed after the first path too: SQLStreams creates a table per stream, and per stream partition, for as long as the system runs.

Choosing a different schema

ClientConfig.Schema moves every table somewhere else. One schema holds exactly one SQLStreams installation, so two schemas in the same database are two independent systems that share nothing.

client, err := sqlstreams.NewClient(ctx, pool,
	&sqlstreams.ClientConfig{Schema: "sqlstreams_staging"})
if err != nil {
	return err
}

The name has to be a lowercase unquoted identifier - it reaches CREATE SCHEMA and every statement’s table qualifier as written, so anything else is rejected by Validate rather than quoted.

ACCEPTED ANSWER Posted: 2026-09-09
brandon Site Admin brandon profile Posts: 677

grant it CREATE on the database, or create schema {schema} yourself and grant the role USAGE and CREATE on it

Nothing pasted yet — the queries above show their blanks.

Looking for a different code? Search every thread.