Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/src/sql/dbinit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
CREATE DATABASE omicron;
CREATE USER omicron;
GRANT INSERT, SELECT, UPDATE, DELETE ON DATABASE omicron to omicron;
ALTER DEFAULT PRIVILEGES GRANT INSERT, SELECT, UPDATE, DELETE ON TABLES to omicron;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the message, I'm afraid you might need a use omicron before this. I had previously avoided that in this file (that's why all the create table statements say omicron.public.rack) but I don't remember a particularly good reason...I may not have been super sure that it would behave correctly, especially if it failed for some reason. Or maybe would leave the connection in a state associated with omicron in a way that would break the next transaction? I'm not sure.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saw your comment -- if it worked, great (though I'm not sure how)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see now: since we're not using "FOR":

If you do not specify a FOR ... clause, CockroachDB alters the default privileges on objects created by the current user.

So this affects everything created by the user that's established this connection, not just the "omicron" database. I think that's fine for now.


/*
* Racks
Expand Down